Centos – Rewriting from headers in Postfix

aliascentospostfixsmtp-headers

I want to configure Postfix to replace the 'From' header in all forwarded/aliased messages with a custom email address, and the 'Reply-To' header with the original sender's address. Is that something that can be done with a simple configuration change, or am I looking at a more complex problem? For example:

Original Message:

From: "John Smith" <john@smith.com>
To: "Jane Rice" <jane@mydomain.com>

Would get translated to:

From: "My Email Forwarding Service" <no-reply@mydomain.com>
Reply-To: "John Smith" <john@smith.com>
To: "Jane Rice" <jane@rice.com>

Ideally, I would also have it rewrite the message body (adding something about how the message was forwarded for them), but I know that's much more difficult. We have a number of email aliases, and everytime someone reports spam they received through their alias, our server gets flagged. I'm trying to minimize that damage as much as possible.

Any help is greatly appreciated!

Best Answer

The right solution is to use standards for that. Either see BATV for Postfix or VERP for Postfix. Where ever VERP is to be preferred.