问题原文
原帖链接 · BinaryDeuce · CC BY-SA 3.0
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.
社区高分解答
原帖链接 · Arul Selvan · CC BY-SA 4.0
You can setup a transport map to selectively choose mails with @outlook.com as destination address and relay them via some_smtp.example.com as shown below.
Add the entry below to /etc/postfix/transport
outlook.com smtp:[some_smtp.example.com]
Add the entry below to /etc/postfix/main.cf
transport_maps = hash:/etc/postfix/transport
Restart postfix after the following command
sudo postmap /etc/postfix/transport
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
