Set PostFix Return-Path

How do I explicitly set the Return-Path to in Postfix?
This is a real mailbox for collecting bounces.

At the moment Postfix is automatically setting it to the From field from the email app.

Setting the Return-Path via the email app is no good. Doing so allows the headers to display a correct Return-Path but Postfix won't bounce to it.

I've looked at Flags, Canonical Maps - but not sure what I'm doing here.

I would love an example.
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.

Have you looked at
and I assume you been looking at

You could just try adding a header to all non local emails usig a cidr table.
eg:             permit   dunno             prepend Return-Path: <>

Actually maybe you want to add the head to local mails.             permit   prepend Return-Path: <>
Do you want to collect bounces in special mailbox, not postmaster?
Parameters "bounce_notice_recipient" and "2bounce_notice_recipient" in (default postmaster).
See man bounce.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

   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 (Envelope) 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: and/or Sender: header.
If you can't specify the envelope address in the application the you could use canonical maps to rewrite the from address to a new one.
If you were sending from the command line using sendmail you can use the -f to specify the from address.

# sendmail -s subject -f
To: bob, john, mike
From: dave

Message Text

Note that specifying recips and from this woay on the command line does not set or change the headers which must be done as part of the message as shown above.
In php you could do it like this...
$recip_email = "";
$recip_fullname = "Some One";
$hdrs = "To: <$recip> $recipfullname";
$hdrs .= "From: <> User Name\r\n";
$hrds .= "Reply-to: <> User Name\r\n";
$hrds .= "Sender: <> Apache Web Server\r\n";
$msg = "this is the body";
$sbj = "email message"
$retpath = "";

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


Open in new window

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
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.