问题原文
原帖链接 · Max Muster · CC BY-SA 4.0
I have two email servers: mx1.example.com (IMAP, SMTP) and mx2.example.com (SMTP gateway).
mx1.example.comis handling email forexample.com,example.netandexample.org.mx2.example.comis configured as a gateway formx1.example.com
(I want him to send out all mails that originate frommx1.example.com)
Now I want to send the emails
- from
example.comandexample.netviamx1.example.comnormally - from
example.orgviamx1.example.com(password auth) to the gatewaymx2.example.com(IP).
How can I configure this?
UPDATE: Please hurry up guys, the bounty expires in 2 days.
To be more clear:
I know how to relay via mx2.example.com (how to send everything via mx2.)
I just have to put the IP of mx2 in relayhost in the main.cf in mx1. But I want to make this selectively, just for example.org.
已采纳解答
原帖链接 · Anylyn Hax · CC BY-SA 4.0
you cannot use transport as it is used to transport emails to the MAILBOX, you need to use
sender_dependent_relayhost_maps
it works like this in your main.cf:
relayhost = mx1.example.org, mx2.example.org
relay_domains = example.com, example.org, example.net
smtp_sender_dependent_authentication = yes
sender_dependent_relayhost_maps = hash:/etc/postfix/relaymap
/etc/postfix/relaymap looks like this :
@example.com mx1.example.com
@example.net mx1.example.com
@example.org mx2.example.com
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
