使用临时错误代码的Postfix永久性错误

Postfix正在返回一个临时错误代码(4xx),而不是一个永久性错误代码(5xx),用于“拒绝中继访问”,导致MX继续重试:

日志:

postfix/smtpd[14279]: connect from unknown[10.244.xx] postfix/smtpd[14279]: NOQUEUE: reject: RCPT from unknown[10.244.xx]: 454 4.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<mx.somewhere.com> postfix/smtpd[14279]: disconnect from unknown[10.244.xx] 

相关configuration:

 smtpd_recipient_restrictions = reject_unauth_destination reject_unknown_reverse_client_hostname, reject_invalid_helo_hostname, reject_non_fqdn_helo_hostname, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_invalid_hostname, reject_rbl_client zen.spamhaus.org, permit virtual_alias_domains = example.com virtual_alias_maps = hash:/etc/postfix/virtual 

我宁愿如果Postfix会回应一个554错误,所以远程服务器停止重试一些永远不会工作的东西。

reject_unauth_destination的数字响应代码由relay_domains_reject_code参数定义,但是这已经是默认的554了。 因此,我怀疑reject_unauth_destination永远不会在您的服务器上触发。 请通过input以下内容来检查(稍微更新的) smtpd_relay_restrictions参数的当前configuration值:

 postconf smtpd_relay_restrictions 

这些中继限制收件人限制之前被检查并且默认为:

 permit_mynetworks, permit_sasl_authenticated, defer_unauth_destination 

这个默认的defer_unauth_destination会发送一个非永久性的错误代码。 如果是这种情况,只需更改您的configuration,并将reject_unauth_destination置于中继限制之下。 您现在可以从收件人的限制中删除它:

 smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination smtpd_recipient_restrictions = reject_unknown_reverse_client_hostname reject_invalid_helo_hostname reject_non_fqdn_helo_hostname reject_non_fqdn_sender reject_non_fqdn_recipient reject_unknown_sender_domain reject_unknown_recipient_domain reject_rbl_client zen.spamhaus.org permit 

我还删除了reject_invalid_hostname因为这是您已经指定的reject_invalid_helo_hostname值的旧名称(Postfix <2.3)。

在这里可以find所有限制列表的说明,这些限制列表可以检查限制条件以及跳过限制列表: Postfix SMTP中继和访问控制

主机名似乎没有在您的SMTP可以解决的命名服务器中的基于DNS的logging。 由于哪个SMTP阻止了Postfix“reject_unknown_reverse_client_hostname”的每个SMTPconfiguration。

因此,请尝试为您尝试从SMTP服务器中继电子邮件的主机添加DNS条目。

否则,请尝试删除与检查FQDN相关的参数,或者也可能需要检查域相关的事项。