Postfix

後綴忽略 smtpd_recipient_restrictions 的順序

  • July 11, 2017

我每天收到大約 50 封被拒絕的電子郵件,因為發送電子郵件地址中有錯字,而且它正在命中reject_unknown_sender_domain

Jul 10 12:21:31 serverb3 postfix/smtpd[6647]: NOQUEUE: reject: RCPT from smtp.correctly-spelt-domain.co.uk[X.X.X.X]: 450 4.1.8 <email@mis-spelt-domain.co.uk>: Sender address rejected: Domain not found; from=<email@mis-spelt-domain.co.uk> to=<email@mydomain.co.uk> proto=ESMTP helo=<smtp.correctly-spelt-domain.co.uk>

我已經添加email@mispelt-domain.co.uk OK/etc/postfix/sender_access,執行 postmap /etc/postfix/sender_access並重新啟動後綴。

儘管在電子郵件之前check_sender_access hash:/etc/postfix/sender_access出現在我的smtpd_recipient_restrictions列表中,reject_unknown_sender_domain但由於這個原因仍然被拒絕。為什麼會這樣,我該如何解決?

後綴 v2.11.3

輸出postconf -n

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
biff = no
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
disable_vrfy_command = yes
home_mailbox = Mail/
mailbox_command = /usr/lib/dovecot/deliver
mailbox_size_limit = 0
message_size_limit = 20480000
mydestination = b3.localdomain, localhost.localdomain, localhost, /etc/postfix/bubbadomains, $myhostname
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
recipient_delimiter = +
relayhost = smtp.gmail.com
sender_bcc_maps = hash:/etc/postfix/sender_bcc
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_helo_required = yes
smtpd_recipient_restrictions = permit_mynetworks check_sender_access hash:/etc/postfix/sender_access reject_unauth_destination reject_unauth_pipelining reject_invalid_hostname reject_non_fqdn_sender reject_unknown_sender_domain reject_non_fqdn_recipient reject_unknown_recipient_domain reject_rbl_client bl.spamcop.net reject_rbl_client zen.spamhaus.org reject_rbl_client dul.dnsbl.sorbs.net permit
smtpd_reject_unlisted_sender = yes
smtpd_relay_restrictions = permit_mynetworks reject_unauth_destination reject_unauth_pipelining reject_invalid_hostname reject_non_fqdn_sender reject_unknown_sender_domain reject_non_fqdn_recipient reject_unknown_recipient_domain check_sender_access hash:/etc/postfix/sender_access reject_rbl_client bl.spamcop.net reject_rbl_client zen.spamhaus.org reject_rbl_client dul.dnsbl.sorbs.net permit
smtpd_tls_cert_file = /etc/letsencrypt/live/mydomain.co.uk/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/mydomain.co.uk/privkey.pem
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtpd_use_tls = yes
unknown_local_recipient_reject_code = 550

PS。我還嘗試通過聯繫相關域的所有者並通知他們來解決根本原因。我沒有屏住呼吸,他們會解決它。

我從 Postfix 郵件列表中得到了答复:

您在“smtpd_relay_restrictions”中有“reject_unknown_sender_domain”,它在“smtpd_recipient_restrictions”之前進行評估。請注意,拒絕延遲到 RCPT TO。

引用自:https://serverfault.com/questions/861268