Postfix SMTP收件人筛选器没有筛选

我已经设置了Postfix列表的黑名单收件人,以便Postfix服务器不应该中继邮件(main.cf中的smtpd_recipient_access参数)。

这些地址在每行末尾都有一个REJECT文件。 我做了标准的步骤来创build数据库哈希(postmap哈希:/ etc / postfix / recipient_access)。

我可以testing,邮件被拒绝使用例如:

postmap -q [email protected] hash:/etc/postfix/recipient_access 

我收到了答复:按预期拒绝。

黑名单文件中的所有地址都是非本地的,即它们不包含在“mydestinations”variables中。

但是,使用Thunderbird通过Postfix SMTP服务器发送邮件只需将邮件发送到没有拒绝的黑名单地址。 我猜想一些其他的中继configuration,我可能会得到这个邮件中继,尽pipe我的黑名单匹配,但无法find问题。

我认为相关的configuration参数是:

 mydestination = $ myhostname,localhost,localhost.localdomain,localhost。$ myhostname
 relay_domains = $ mydestination,proxy:ldap:/etc/postfix/ldap/relay_domains.cf
 relayhost =
 smtpd_data_restrictions = reject_unauth_pipelining
 smtpd_end_of_data_restrictions = check_policy_service inet:127.0.0.1:10031
 smtpd_helo_required =是
 smtpd_helo_restrictions = permit_mynetworks,permit_sasl_authenticated,check_helo_access pcre:/etc/postfix/helo_access.pcre
 smtpd_recipient_restrictions = permit_sasl_authenticated,reject_unknown_sender_domain,reject_unknown_recipient_domain,reject_non_fqdn_sender,reject_non_fqdn_recipient,reject_unlisted_recipient,check_recipient_access哈希:/等/后缀/ recipient_access,check_policy_service INET:127.0.0.1:7777,check_policy_service INET:127.0.0.1:10031,permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination,reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname
 smtpd_reject_unlisted_recipient =是
 smtpd_reject_unlisted_sender =是
 smtpd_sasl_auth_enable =是
 smtpd_sasl_authenticated_header = no

如果其他参数可能是相关的,我可以发布整个configuration

限制列表中指定的限制(如smtpd_helo_restrictionssmtpd_recipient_restrictions等)按指定的顺序应用; 第一个限制匹配胜。

由于您的smtp_recipient_restrictions已将permit_sasl_authenticated作为第一个条件并在路的某个地方执行check_recipient_access ,因此任何经过身份validation的客户端都是允许的,而不会在以后再次检查。

您也可以阅读http://www.postfix.org/SMTPD_ACCESS_README.html