Security

Helo 命令被拒絕:需要完全限定的主機名錯誤

  • January 14, 2019

我的郵件伺服器在一些垃圾郵件的黑名單中。我重新配置了後綴。然後我的客戶收到此錯誤,他們無法發送電子郵件。

404 4.5.2 <PLLAMNAZIFE>: Helo command rejected: need fully-qualified hostname

在 Mail.log 中:

postfix/smtpd[9853]: NOQUEUE: reject: RCPT from unknown[xx.xx.xx.xx]: 
404 4.5.2 <PLLAMNAZIFE>: Helo command rejected: need fully-qualified hostname; 
from=<info@domain.com> to=<mail@mail.com> proto=ESMTP helo=<PLLAMNAZIFE>

在我的 main.cf 中:

  # rules restrictions
smtpd_client_restrictions =
       permit_sasl_authenticated 
smtpd_helo_restrictions =
       permit_mynetworks,
       reject_non_fqdn_helo_hostname,
       reject_invalid_helo_hostname,
       permit
smtpd_sender_restrictions =
smtpd_recipient_restrictions = 
       permit_sasl_authenticated, 
       reject_unauth_pipelining,
       reject_non_fqdn_recipient,
       reject_unknown_recipient_domain,
       permit_mynetworks, 
       reject_unauth_destination, 
       reject_invalid_hostname, 
       reject_non_fqdn_sender, 
       reject_unknown_sender_domain,
       reject_rhsbl_client blackhole.securitysage.com, 
       reject_rhsbl_sender blackhole.securitysage.com, 
       reject_rbl_client zen.spamhaus.org, 
       reject_rbl_client bl.spamcop.net, 
       reject_rbl_client blackholes.easynet.nl, 
       reject_rbl_client cbl.abuseat.org, 
       reject_rbl_client proxies.blackholes.wirehub.net, 
       reject_rbl_client dnsbl.njabl.org

smtpd_helo_required = yes
unknown_local_recipient_reject_code = 550
disable_vrfy_command = yes
smtpd_data_restrictions = reject_unauth_pipelining

HELO出現該錯誤消息是因為郵件客戶端在 SMTP 事務的/EHLO部分和您的 Postfix 伺服器中僅發送裸主機名(“PLLAMNAZIFE”)而不是完全限定的主機名(例如“PLLAMNAZIFE.example.com”)配置為拒絕此類郵件。

許多郵件客戶端程序不會在 / 中發送格式正確、完全限定、有效的主機HELOEHLO。由於您必須接受來自付費客戶的此類郵件,並且對他們使用的郵件客戶端幾乎沒有控制權(並且因為HELO檢查在阻止垃圾郵件方面並沒有多大用處),所以最好禁用HELO檢查。

要禁用HELO檢查,請從 Postfix 配置中刪除以下兩行:

   reject_non_fqdn_helo_hostname,
   reject_invalid_helo_hostname,

更好的是,刪除整個smtpd_helo_restrictions = ...規則和smtpd_helo_required = yes.

引用自:https://unix.stackexchange.com/questions/91749