I would like to add a Postfix re-write rule to insert a
Reply-To: header if there is not one already defined.
This server is a web server with PHP and Perl scripts, we do not want the mail sent from this server to reply back to this server. Some of the scripts specify
Reply-To: headers, others do not. I want set
Reply-To: email@example.com if the script has not already set one.
It would be better (and easier) to simply rewrite the sender’s address; this will have the same effect, as well as doing some hiding of the internal topology (e.g. the sender won’t anymore be something like
You can easily rewrite the sender of all outgoing mail with
smtp_generic_maps. For instance, to change the sender of all outgoing mail to
smtp_generic_maps = hash:/etc/postfix/generic
postmap /etc/postfix/generic and
service postfix reload.
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.