I wish to set up Postfix to use an external relay depending on the destination hostname, ie:
- If destination hostname is *.outlook.com, use relay some_smtp.example.com
- If any other destination hostname, use local relay
What I mean by destination hostname is the hostname obtained from MX record. If the recipient domain has MX record
microsoft-com.mail.protection.outlook.com, then use a different relay
I know it is possible to specify a relay depending on the sender address (using
sender_dependent_relayhost_maps), but it's impractical in my situation.
The goal is to use a different relay for finicky destination hosts: maybe Mandrill, or another Postfix installation.