I've configured Postfix to use SMTP through another relay host. Now I need to change the email headers in order to be accepted by the relay host because the application which runs on my server is an obsolete management software that puts the user's email address into the FROM
header (this is dumb and a reason to get rejected) - since I don't have the time to change the code, I want to force Postfix to alter the headers. What I'm trying to achieve:
- The current
FROM
header should be moved into theREPLY-TO
header - The
FROM
header should be set per default using the same email address for every outgoing message
Regarding the second point - I've figured out how to do it, simply by putting the following contents into /etc/postfix/sender_canonical_maps
and /etc/postfix/header_check
(and by updating main.cf
of course):
# /etc/postfix/sender_canonical_maps
/.+/ [email protected]
# /etc/postfix/header_check
/From:.*/ REPLACE From: [email protected]
But the first point is causing me problems - how can this be done with Postfix? How can I put the current FROM
header into the REPLY-TO
header?
REPLACE
a header, then postfix will still fixup missing headers afterwards, so just replacing theFrom:
withReply-To:
might be sufficient.FROM
should move toREPLY-TO
and how I set theFROM
(which automatically sets theenvelope-from
as well) has been done already :) Do you know how I could replace theFrom:
withReply-To:
?/From:(.*)/ REPLACE Reply-To:$1
not your solution?