【问题标题】:How to relay all local mail through external SMTP relay如何通过外部 SMTP 中继中继所有本地邮件
【发布时间】:2015-05-13 00:06:15
【问题描述】:

我在我的 CentOS 服务器上安装了 Postfix 2.6.6。我将 SendGrid 用于所有外发邮件,并在我的 Postfix main.cf 文件中有以下设置...

smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = static:Username:Password
smtp_sasl_security_options = noanonymous
smtp_tls_security_level = encrypt
header_size_limit = 4096000
relayhost = smtp.sendgrid.net:587
smtp_tls_CAfile = /home/artmgr/certs/gd_bundle-g2-g1.crt 

此服务器运行一些 PHP 站点,这些站点会生成自动电子邮件。通常,服务器上生成的所有电子邮件都会中继到 SendGrid。但是,当发送到使用与我的服务器主机名相同的域的电子邮件地址时,电子邮件会到达本地服务器上的 root 邮箱,而不是中继到 SendGrid。

例如,假设我的服务器的主机名是mydomain.com。当在服务器上生成要发送到support@mydomain.com 的电子邮件时,它会到达本地服务器上的root 邮箱。

有没有办法告诉 Postfix 通过 SendGrid 中继发送所有电子邮件,甚至包括使用本地主机名的邮件?

【问题讨论】:

    标签: email postfix-mta sendgrid


    【解决方案1】:

    在 shell 上,运行以下代码,

    postconf -e "mydestination="
    postfix reload
    

    这将清除mydestination 变量,因此没有邮件被视为本地邮件。

    【讨论】:

      猜你喜欢
      • 2018-11-13
      • 2015-01-11
      • 2010-10-24
      • 1970-01-01
      • 2021-01-11
      • 1970-01-01
      • 2010-10-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多