1

This question already has an answer here:

Im setting up postfix SMTP relay, that will be placed right after Exchange server.

Details: 1) postfix server name mail.server.com 2) we have several domains: a-domain.com, b-domain.com and etc..

I need to rewrite somehow emails headers. So recipient will not receive email like:

Received: from mail.server.com ([XX.XX.XX.X])

But will receive it from mail.a-domain.com ([XX.XX.XX.X]) if sender is user@a-domain.com OR from mail.b-domain.com ([XX.XX.XX.X]) if sender is user@b-domain.com

is this possible anyhow?

marked as duplicate by masegaloeh, mailq, MadHatter, Andrew Schulman, Sven Nov 30 '14 at 20:14

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

Postfix does not support directly this feature, but you can fiddle with transport maps in order to achieve your goal.

You can add many transports in master.cf, each for every domain, with a -o directive that adds a remap rule

In the transport file you set up the transport rule to use the transports specified in master.cf accordinf to the domain name

This blog post contains some examples and some links.

  • Thank you. Seems this is what i need exactly. I'll just create bunch of email gateways (for each domain) and strip the headers – Shirker Nov 16 '14 at 7:59
  • finally I found this link tekman.livejournal.com/83609.html sender_dependent_relayhost_maps = hash:/etc/postfix/sender_dependent_relayhost works for me (as on my testing) – Shirker Nov 19 '14 at 18:35

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