Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Postfix as a gateway for my domain and need it to change or rewrite the Envelope From address to match the From header. For example, the From: header is "" and the Envelope From is "". I want Postfix to make the Envelope From "" before relaying it on. I took a look at the Postfix Address Rewriting document but couldn't find anything that matched my use case.

(In case you're curious why I need to do this: Gmail uses the same Envelope From when sending from a particular account, no matter which From: address you choose to use. I would prefer not to disclose the account being used to send the email. Also, it messes with SPF/DMARC domain alignment - see 4.2.2 of the DMARC draft spec.)

share|improve this question
It would be helpful if you could give some examples. So what the headers currently look like and what you're trying to get them to look like. – webtoe Mar 13 '12 at 14:51

I believe you want "sender_canonical_maps" (and "recipient_canonical_maps" if you want inbound mail to be translated backwards):

share|improve this answer
As far as I can tell, this only implements a table lookup. However, there might be several different From header addresses used with the same Envelope From address, so the table needs to act somewhat dynamically. Is there a variable for the From header address that can be used for the result? – lid Mar 23 '12 at 9:38
You could specify a regular expression: – Frederick Nord Nov 29 '13 at 12:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.