I need to configure postfix on a localhost as a relay to an smtp server.
This external smtp server requires From:
header to be consistent with the authenticated user name.
I want to fixup the From:
header for all the messages originating on this local machine to say authenticated@example.com
I tried the following:
sender_canonical_maps
The problem is: it seems to be overwriting theReply-To:
header as well, I don't need this, on the contrary, I want to use it extensively.
How I checked this:
- Put
sender_canonical_maps = regexp:/etc/postfix/sender_canonical
in main.cf REPLYTO="some.addr@gmail.com" mail my_addr@gmail.com
- Actual results: received message has overwritten
Reply-To
toauthenticated@example.com
Vs:
- Remove
sender_canonical_maps
from main.cf REPLYTO="some.addr@gmail.com" mail -r authenticated@example.com my_addr@gmail.com
- Actual results: received message has correct
Reply-To
The problem is this doesn't work without -r authenticated@example.com
.
header_checks
: apparently doesn't work forFrom:
fields (http://www.postfix.org/header_checks.5.html see Bugs: section)
How can I simply force the From:
header on all outgoing mail, but leave Reply-To:
alone for local users to specify?