Postfix return Path

I am using postfix as a relay to send email from our web applications, can i set the return path on the emails in the postfix config so it is always the same.  Instead of the fromaddress of the email.  So when an email sent via postfix bounces the bounce always goes to

Many Thanks
LVL 11
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

   When the delivery SMTP server makes the "final delivery" of a
   message, it inserts a return-path line at the beginning of the mail
   data.  This use of return-path is required; mail systems MUST support
   it.  The return-path line preserves the information in the <reverse-
   path> from the MAIL command.  Here, final delivery means the message
   has left the SMTP environment.  Normally, this would mean it had been
   delivered to the destination user or an associated mail drop, but in
   some cases it may be further processed and transmitted by another
   mail system.

So it sound to me like all you need to do is to change the MAIL FROM (Evnvelope) sender address.
You could still retain the From: header so the recipient sees the email come from the fromaddress.
You may also want to set a reply-to header.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
How you actually do this will depend on the language of your web application.
eg: in php

$recip_email = "";
$recip_fullname = "Some One";
$hdrs = "To: <$recip> $recipfullname";
$hdrs .= "From: <> User Name\r\n";
$hrds .= "Reply-to: <> User Name\r\n";
$msg = "this is the body";
$sbj = "email message"
$retpath = "";

mail  ( $recip_email ,  $sbj  ,  $msg ,  $hdrs , "-f $retpath");


Open in new window

If you can't change the application, you can have postfix use a translation table to re-write the from addresses on the emails sent.
Create a file with the old and new addresses listed.

you can then use it as a canonical map.

For more information on this see
There is another header that might be worth setting for SPF purposes.  see

$hdrs .= "Sender: <$retpath> Web Application";
Ross-CAuthor Commented:
Because I was using the .net namespace setting the return path seperately wasn't an option.  All the above are useful thanks but in the end i purchased a reasonably priced smtp library for .net that has lots of extra properties including a return path. For anyone else who might want to do this i used aspnetemail.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Email Servers

From novice to tech pro — start learning today.