我们的 postfix 有时会拒绝电子邮件。我在我们的 postfix 日志 (/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=<[email protected]> to=<[email protected]>
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
我甚至不知道问题是出在我们这边还是出在发送方这边。
答案1
这是由reject_unknown_client指令引起的(http://www.postfix.org/postconf.5.html#reject_unknown_client_hostname)
答案2
这是因为发送电子邮件的 IP 地址(在您的例子中为 xxxx)没有返回有效的反向 DNS 条目 - 要么是因为其名称服务器上没有提供有效主机名的 ptr 记录,要么是因为您的 DNS 查找失败。首先要尝试的是“nslookup xxxx”,看看会得到什么。