2

What is the best practice when one has to implement this sort of ruleset in postfix:

  • Email sent from local domain1.com, domain2.com to example.com, example1.com ought to be relayed to smtp.external.com.
  • Email sent to everyone else example.com and example1.com ought to be relayed locally

I know there is a way to do a relay filtering recipient address using transport_maps, but I do not know how to filter depending on the sender address too.

Can you help me please?? Thanks in advance

1 Answer 1

2

To choose the relay based on sender address, have a look into Postfix sender_dependent_relayhost_maps.

2
  • sender_dependent_relayhost_maps is used to filter mail senders, but I want to filter both senders and receivers at the same time. With a certain incoming mail and outgoing mail, filter using an external relay. Jan 20, 2017 at 8:31
  • Not sure you can have it both ways. Would running two postfix instances help? Maybe you could use the second instance as a next hop for the first instance. On the first instance apply transport_maps filtering, and on the second apply sender_dependent_relayhost_maps? Jan 20, 2017 at 18:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .