Alexander Wiedeck asked,
| I've created a user (lo_mailer) with a .forward and a .procmailrc file to
| transport incomming mail to the right user. That is working fine, but the
| Return-Path: Line is set to the local procmail user (lo_mailer) and does
| not contain the original Return-Path!
|
| What can I do to win back the original-line? Please help me :)
Normally when you forward mail you should NOT keep the original return path.
If the forwarding destination is invalid or unreachable, mail has to be
returned to the forwarder, who can fix the forwarding routine, not to the
original sender, who can't do anything about it and probably never even heard
of the final destination address.
But, though you should change the return path, you do not have to lose the
information that the original return path contiained. You can safely put
that into the body or into another header line. Try this in lo_mailer's
.procmailrc:
:0fwh # if there's a return path, save it as Old-Return-Path:
* ^Return-Path:.*<.+>
| formail -iReturn-Path: # lower-case i
:0Efwh # if there's no return path but there is a From_, use that
* ^^From[ ]+\/[^ ]+
| formail -A "Old-Return-Path: <$MATCH>"
:0Efwh # if there was neither a Return-Path: nor a From_
| formail -A "Old-Return-Path: unknown"
The first set of brackets in the condition line of the second recipe enclose
a space and a tab; the second set enclose caret, space, tab.
On the forwarding leg from lo_mailer to the final recipient, the return path
will be to lo_mailer, as it should, but if the final recipient wants to know
where it originated, he or she can look at the Old-Return-Path: header.
There is one caution here. If lo_mailer is taking mail to a general response
address and distributing it to specific people based on subject or body
content or just by rotation to balance the workload, fine. But if you have
a personal domain and your ISP is routing all mail for any address in your
domain to your account on the ISP, and you're depending on procmail to
deliver it to the right address in your own domain by reading To: or Cc:
headers, that is the wrong approach. The correct recipient will be on the
envelope, which is removed from incoming mail before procmail can see it.
Your ISP has to do something that lets you know the true envelope recipient
or recipients of a message, and others here know a lot more about that than
I do (and way, way more than I could tell you without making mistakes).