如何在 Debian 上设置 exim4 sender_helo_name

如何在 Debian 上设置 exim4 sender_helo_name

我在运行 debian 8.9 的 vps 上使用 exim4 邮件服务器,问题是我可以收到电子邮件但不能发送邮件,所以当我从 roundcube 向 gmail 发送邮件时出现错误

SMTP 错误(550):无法设置发件人(拒绝访问 - HELO 名称无效(参见 RFC2821 4.1.3))。

所以我检查了 exim4 模板并对其进行了调试,发现 $sender_helo_name 已设置为我的服务器 ip 地址。所以我想知道如何将 $sender_helo_name 值设置为我的站点域

更新 exim 主日志:

2017-09-28 09:33:56 H=localhost (198.50.220.183) [127.0.0.1] rejected MAIL <[email protected]>: Access denied - Invalid HELO name ( 198.50.220.183) (See RFC2821 4.1.3)
2017-09-28 09:36:23 no host name found for IP address 123.56.151.114
2017-09-28 09:36:24 no host name found for IP address 123.56.151.114
2017-09-28 09:39:01 1dxQbF-0003dy-6j <= [email protected] U=root P=local S=1044
2017-09-28 09:39:01 1dxQbF-0003dy-6j => root <[email protected]> R=localuser T=local_delivery
2017-09-28 09:39:01 1dxQbF-0003dy-6j Completed
2017-09-28 09:43:17 no IP address found for host 207-101-169-181.fibertel.com.ar (during SMTP connection from [181.169.101.207])
2017-09-28 09:43:18 no IP address found for host 207-101-169-181.fibertel.com.ar (during SMTP connection from [181.169.101.207])
2017-09-28 09:46:36 no IP address found for host ip-187.94.111-100.globalwave.com.br (during SMTP connection from [187.94.111.100])
2017-09-28 09:46:37 no IP address found for host ip-187.94.111-100.globalwave.com.br (during SMTP connection from [187.94.111.100])
2017-09-28 09:53:15 no host name found for IP address 41.191.224.5
2017-09-28 09:53:16 no host name found for IP address 41.191.224.5
2017-09-28 09:54:23 exim 4.84_2 daemon started: pid=15145, -q30m, listening for SMTP on port 25 (IPv4) port 587 (IPv4) port 2525 (IPv4) and for SMTPS on port 465 (IPv4)

答案1

定义宏 MAIN_HARDCODE_PRIMARY_HOSTNAME 并将其设置为所需的名称。通常,这将是类似于 mail.example.com 或 smtp.example.com 的内容。如果您使用拆分配置,请使用 中的文件/etc/exim4/conf.d/main。否则,请使用/etc/exim4/exim4.conf.localmacros

接收服务器发送 550 错误,表示您的 HELO 名称无效。应将其设置为与服务器 IP 地址的 PTR 记录相同的值。要设置 PTR 记录,您需要一个静态 IP 地址和提供商的合作。您还需要一个与邮件服务器名称对应的 A 记录。这将启用名称的 rDNS 验证。您的 MX 记录应指向此名称。

还要考虑为您的邮件服务器和域设置 SPF 记录。

使用您的 VPS 提供商的中继服务器可能是一个更简单的解决方案。使用smarthost本地邮件配置。将中继服务器配置为智能主机服务器。修改您的 SPF 记录以指示中继服务器可以为您的域发送邮件。

相关内容