Score:0

have postfix relay emails through a third party smtp only when From is *@domain-a.tld and To is *@domain-b.tld, otherwise process emails normally

il flag

I'm looking for a way to have postfix relay outgoing emails through a specific SMTP on two simultaneous conditions:

When email From address is *@domain-a.tld AND when To address is *@domain-b.tld

If none or only one of those two conditions occur i want to process mails normaly (i.e don't pass them through the relay).

I can't use header_checks because it only processes one header at a time, i can't check From and To at the same time and FILTER smtp:smtp.mysmarthost.tld

if i use transport_maps i can only act on the second condition (destination domain), but that means every emails intended to domaine-b.tld will be relayed, no matter the From address if i use sender_dependent_relay_maps i can only act on the first condition...

is there a way to combine both to achieve what i want?

Any help would be much appreciated.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.