I have a Postfix instance that has 4 domains listed in the mydestination
option. Dovecot LMTP is setup as the mailbox_transport
. We can refer to these as domain1.tld through domain4.tld. I also have a second Postfix instance that does "stuff" with any mail relayed through it, the details of which are irrelevant for this question.
I would like email sent from domain1.tld to domain2.tld to be relayed through the second Postfix instance before getting delivered to the local Dovecot instance. Same with email sent from domain1.tld to domain3.tld. However email sent from domain3.tld to domain2.tld should be delivered without being relayed, same with email sent from domain2.tld to either domain1.tld or domain3.tld.
Another way to put it is I want to be able to have all mail including local delivery that is sent from domain1.tld to pass through a relay. I should also have to option to enable this feature for domain4.tld.
I've looked at a few of the available options such as sender_dependent_default_transport_maps
, local_transport
, default_transport
, and the transport
table (aka transport_maps
). None of these will do what I want based on the documentation and my experiments.
Preferably, I'd avoid using content filters and message re-injection if possible, but if that's the only way to do it then it's fine so long as the content filter only applies to the one domain that needs to be relayed.