AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 1017560
Accepted
Max Muster
Max Muster
Asked: 2020-05-18 17:44:16 +0800 CST2020-05-18 17:44:16 +0800 CST 2020-05-18 17:44:16 +0800 CST

POSTFIX 如何仅将中继服务器用于特定域?

  • 772

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

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

现在我想发送电子邮件

  • 从example.com和example.net通过mx1.example.com通常
  • 从example.orgvia mx1.example.com(password auth) 到网关 mx2.example.com(IP)。

我该如何配置?

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

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

postfix
  • 2 2 个回答
  • 5822 Views

2 个回答

  • Voted
  1. Best Answer
    Anylyn Hax
    2020-06-16T11:43:44+08:002020-06-16T11:43:44+08:00

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

    sender_dependent_relayhost_maps
    

    它在你的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看起来像这样:

    @example.com    mx1.example.com
    @example.net    mx1.example.com
    
    @example.org    mx2.example.com
    
    • 4
  2. Bash Stack
    2020-06-10T05:02:49+08:002020-06-10T05:02:49+08:00

    通过使用选择性中继功能:

    在 mx1.example.com 上:

    • 添加一行:example.org smtp:mx2.example.com到/etc/postfix/transport

    • 添加一行:transport_maps = hash:/etc/postfix/transport到/etc/postfix/main.cf

    • 跑postmap /etc/postfix/transport
    • 跑postfix reload

    在 mx2.example.com 上:

    • 添加mx1.example.com到/etc/postfix/main.cf中的 mynetworks
    • 确保你有类似的东西:

      smtpd_relay_restrictions = permit_mynetworks, reject_unauth_destination 在/etc/postfix/main.cf 它丢失了

    • 跑postfix reload

    用于将邮件中继到特定域的其他 SMTP 的后缀

    http://www.postfix.org/STANDARD_CONFIGURATION_README.html

    http://www.postfix.org/SMTPD_ACCESS_README.html#lists

    https://xdeb.org/post/2017/12/20/mail-relay-mx-backup-and-spam-filtering-with-postfix/

    https://www.howtoforge.com/community/threads/postfix-relay-one-domain-to-smarthost-a-all-else-to-smarthost-b.62955/

    http://verchick.com/mecham/public_html/spam/relay_recipients.html

    • 1

相关问题

  • Postfix 在特定端口上接受邮件

  • 让 Postfix 以两种方式处理垃圾邮件

  • Postfix 或 exim:自动/程序化和转发电子邮件设置

  • 后缀电子邮件地址

  • 什么是最好的开源电子邮件解决方案包

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve