【问题标题】:Postfix Whitelist Not Working As It ShouldPostfix 白名单无法正常工作
【发布时间】:2021-09-29 00:01:42
【问题描述】:

我的 main.cf 配置如下。我无法接收来自已列入白名单的域或 IP 地址的电子邮件。

错误: 450 4.7.25 客户端主机被拒绝:找不到您的主机名... 或者 450 4.7.1 Helo 命令被拒绝:找不到主机...

我猜是因为reject_invalid_hostname 和reject_non_fqdn_helo_hostname。

即使我已将其列入白名单,为什么还会出现这样的错误? 不删除reject_invalid_hostname规则和reject_non_fqdn_helo_hostname怎么办?

如果过滤器中有匹配项,则后缀应应用相关规则。如果没有匹配,后缀应该遵循下一个规则。逻辑上不应该是这样吗?

有人可以帮助我吗?我哪里做错了?

对不起我的英语。 提前谢谢大家。

### main.cf:
..........

header_checks = regexp:/etc/postfix/header_checks

#HELO restriction
smtpd_helo_required = yes
smtpd_helo_restrictions =
  permit_mynetworks,
  permit_sasl_authenticated,
  check_helo_access pcre:/etc/postfix/helo_access,
#reject_invalid_helo_hostname,
  reject_non_fqdn_helo_hostname,
  reject_invalid_hostname,
  reject_unknown_helo_hostname

#Client restrictions
smtpd_client_restrictions = 
  permit_mynetworks,
  permit_sasl_authenticated,
  reject_unknown_client

#Sender restrictions
smtpd_sender_restrictions =
  permit_mynetworks,
  permit_sasl_authenticated,
  check_sender_access hash:/etc/postfix/sender_whitelist,
  check_sender_access pcre:/etc/postfix/reject_domains,
  reject_non_fqdn_sender,
#reject_unverified_sender,
  reject_unknown_sender_domain

#Recipient restrictions
smtpd_recipient_restrictions =
  permit_mynetworks,
  permit_sasl_authenticated,
  check_policy_service inet:127.0.0.1:10031,
  check_recipient_access hash:/etc/postfix/sender_whitelist,
  check_recipient_access hash:/etc/postfix/sender_blacklist,
  reject_unauth_destination,
  reject_non_fqdn_recipient,
  reject_unknown_recipient_domain,
  reject_rhsbl_helo dbl.spamhaus.org,
  reject_rhsbl_reverse_client dbl.spamhaus.org,
  reject_rhsbl_sender dbl.spamhaus.org,
  reject_rbl_client zen.spamhaus.org,
  reject_rbl_client bl.spamcop.net,
  reject_rbl_client b.barracudacentral.org,
  reject_rbl_client zombie.dnsbl.sorbs.net,
  reject_rbl_client spam.dnsbl.anonmails.de,
  reject_rbl_client dyna.spamrats.com,
  reject_rbl_client spam.spamrats.com

#Relay restrictions
smtpd_relay_restrictions = 
  permit_mynetworks,
  permit_sasl_authenticated,
  check_policy_service inet:127.0.0.1:10031,
  reject_unauth_destination

#Other restrictions
smtpd_delay_reject = yes
unknown_local_recipient_reject_code = 550
disable_vrfy_command = yes
smtpd_data_restrictions = reject_unauth_pipelining
enable_original_recipient = no
show_user_unknown_table_name = no

.........



### sender_whitelist:
.........

mail.gelirler.gov.tr OK
#mail.gelirler.gov.tr ip adresi
212.133.164.130 OK
bplas.com.tr OK
bsmtp2.iletisim.yapikredi.com.tr OK
bsmtp3.iletisim.yapikredi.com.tr OK

.........

【问题讨论】:

    标签: postfix-mta whitelist


    【解决方案1】:

    在你的smtpd_helo_restrictions 中你显示 check_helo_access pcre:/etc/postfix/helo_access, 但是你没有显示/etc/postfix/helo_access 的内容,你有这样的文件吗?如果您的 /etc/postfix/helo_access 文件相似,您将显示“sender_whitlist”的内容,您不需要使用“pcre”,只需使用即可;

    在 main.cf check_helo_access hash:/etc/postfix/helo_access, 确保您在 /etc/postfix/helo_access 文件中有域/IP 并运行 postmap /etc/postfix/helo_access 然后重新加载 postfix。

    (如果你在 etc/postfix/helo_access 中使用正则表达式,显然使用 pcre: 而不是 hash:

    【讨论】:

      猜你喜欢
      • 2016-05-10
      • 2015-10-27
      • 2017-09-03
      • 1970-01-01
      • 2016-12-01
      • 2011-09-20
      • 2016-03-11
      • 2017-05-23
      • 2017-11-11
      相关资源
      最近更新 更多