POSTFIX 如何仅针对特定域使用中继服务器?

Max*_*ter 6 postfix

我有两个电子邮件服务器:mx1.example.com(IMAP、SMTP)和mx2.example.com(SMTP 网关)。

  • mx1.example.com正在处理example.comexample.net和的电子邮件example.org
  • mx2.example.com被配置为网关mx1.example.com
    (我希望他发送来自 的所有邮件 mx1.example.com

现在我想发送电子邮件

  • 通常从example.comexample.net通过mx1.example.com
  • example.orgvia mx1.example.com(密码验证)到网关 mx2.example.com(IP)。

我该如何配置这个?

更新:请快点,赏金将在 2 天后到期。

更清楚地说:我知道如何通过 mx2 进行中继mx2.example.com(如何通过 mx2 发送所有内容)。我只需要将 mx2 的 IP 放在 mx1 的 main.cf 中的中继主机中即可。但我想有选择地进行此操作,仅以 example.org 为例。

小智 5

您不能使用传输,因为它用于将电子邮件传输到 MAILBOX,您需要使用

sender_dependent_relayhost_maps
Run Code Online (Sandbox Code Playgroud)

它在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
Run Code Online (Sandbox Code Playgroud)

/etc/postfix/relaymap看起来像这样:

@example.com    mx1.example.com
@example.net    mx1.example.com

@example.org    mx2.example.com
Run Code Online (Sandbox Code Playgroud)