procmail
[Top] [All Lists]

Re: changing headers upon forwarding

2003-09-10 13:02:34
On Wed, 10 Sep 2003, Professional Software Engineering wrote:

At 19:45 2003-09-10 +0200, Nikolaus Hiebaum wrote:
Can I modify the "Return-Path:" header with formail?

:0c
| formail -i "Return-Path: somewhere" | $SENDMAIL account2 -f account1

That'll change the return-path as seen by $SENDMAIL, but it won't change
the return-path seen by the recipient at account2.

(Aside:  Shouldn't that be "$SENDMAIL -f account1 account2" ?)

The Return-Path: field is supposed to be set by the final delivery MTA to
be the envelope sender address, which in the example above has been set 
to "account1" by using sendmail's -f option.  Any existing Return-Path is
clobbered, if the receiving MTA is properly configured.

So to force the return-path to be "somewhere" you don't use formail, you
just do

:0c
| $SENDMAIL -f somewhere account2

(Aside again:  I believe it also works to do

:0c
! -f somewhere account2

but the $SENDMAIL version makes it clearer.)

Final note: Depending on the configuration and on what user is forwarding,
using -f may cause sendmail to insert an X-Authentication-Warning: header
showing the address it would have used as the envelope sender if -f had
not been given.


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail