Email

Postfix 正在拒絕一些傳入的電子郵件(“客戶端主機被拒絕:找不到您的主機名”)

  • February 5, 2017

我們的後綴有時會拒絕電子郵件。我在我們的後綴日誌(/var/log/mail.log)中看到了這個錯誤:

Feb  9 16:16:33 sd-15xxx postfix/smtpd[1972]: NOQUEUE: reject: RCPT from
   unknown[x.x.x.x]: 450 4.7.1 Client host rejected: cannot find your hostname,
   [x.x.x.x]; from=<someone@sender.com> to=<someone.else@my-domain.com>
   proto=ESMTP helo=<smtp.sender.com>

這是我的 postconf -n :

append_dot_mydomain = yes
biff = no
config_directory = /etc/postfix
disable_vrfy_command = yes
inet_interfaces = all
mydestination = localhost, localhost.localdomain, sd-15xxx.dedibox.fr
mydomain = my-domain.com
myhostname = my-domain.com
mynetworks = 127.0.0.0/8 192.168.0.0/24 y.y.y.y <our server IP address>
relayhost = 
smtpd_banner = $myhostname ESMTP (Debian/GNU)
smtpd_client_restrictions = reject_unknown_client,
   permit_mynetworks
smtpd_helo_required = yes
smtpd_recipient_restrictions = permit_mynetworks,
   reject_unauth_destination,
   reject_unknown_recipient_domain,
   reject_non_fqdn_recipient
smtpd_sender_restrictions = permit_mynetworks,
   reject_unknown_sender_domain,
   warn_if_reject reject_unverified_sender
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_aliases.cf,mysql:/etc/postfix/mysql-virtual_aliases_mailbox.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /var/spool/vmail/
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_uid_maps = static:5000

它不會經常發生,但如果我們錯過了重要的電子郵件,它可能會產生嚴重的後果。

你知道這個問題是從哪裡來的嗎?是配置問題還是反向 DNS 問題(正如我在某處讀到的那樣)?

這是 nslookup xxxx 的結果:

41.180.106.89.in-addr.arpa  name = Smtp16.sender.com.

Authoritative answers can be found from:
180.106.89.in-addr.arpa nameserver = dns2.iland.com.
180.106.89.in-addr.arpa nameserver = dns3.iland.com.
180.106.89.in-addr.arpa nameserver = dns1.iland.com.
dns1.iland.com  internet address = 65.57.248.5
dns2.iland.com  internet address = 63.211.182.4
dns3.iland.com  internet address = 64.154.20.10

以及 dig xxxx 的結果:

; <<>> DiG 9.5.1-P3 <<>> x.x.x.x
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 5920
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;x.x.x.x.           IN  A

;; AUTHORITY SECTION:
.           10800   IN  SOA a.root-servers.net. nstld.verisign-grs.com. 2010020901 1800 900 604800 86400

;; Query time: 227 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Wed Feb 10 13:45:54 2010
;; MSG SIZE  rcvd: 106

我什至不知道問題是來自我們方面還是來自發件人方面。

這是由reject_unknown_client 指令(http://www.postfix.org/postconf.5.html#reject_unknown_client_hostname)引起的

那是因為發送電子郵件的 IP 地址(在您的情況下為 xxxx)沒有返回有效的反向 dns 條目 - 要麼是因為他們的名稱伺服器上沒有提供有效主機名的 ptr 記錄,要麼是因為您的 dns 查找失敗。首先要嘗試的是“nslookup xxxx”,看看你得到了什麼。

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