我试图设置一个邮件服务器,使用后缀和dovecot。 一切工作正常,我可以使用Mozilla Thunderbird在IMAP中连接。 但是当我试图使用smtp服务器发送电子邮件时,遇到以下情况,无法从日志中find您的主机名错误,并且发送邮件失败:
mail postfix/smtpd[15822]: NOQUEUE: reject: RCPT from unknown[xxx.xxx.xxx.xxx]: 550 5.7.1 Client host rejected: cannot find your hostname, [xxx.xxx.xxx.xxx]; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<[192.168.10.47]>
xxx.xxx.xxx.xxx是客户端(不是服务器)的IP地址。 我有谷歌一点点找不到你的主机名错误,它似乎是有关的PTR的DNSlogging。 但我的服务器的PTR DNSlogging似乎configuration正确:
这里是dig -x yyy.yyy.yyy.yyy的结果,其中yyy.yyy.yyy.yyy是我的服务器的IP地址:
;; QUESTION SECTION: ;yyy.yyy.yyy.yyy.in-addr.arpa. IN PTR ;; ANSWER SECTION: yyy.yyy.yyy.yyy.in-addr.arpa. 86400 IN PTR mail.domain.com.
在我的/etc/postfix/main.cf ,我有关于smtp限制的以下几行:
## Customized smtpd paramters smtpd_banner = $myhostname ESMTP smtpd_helo_required = yes smtpd_helo_restrictions = permit_mynetworks, reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname, reject_unknown_helo_hostname, permit smtpd_recipient_restrictions = reject_unknown_client_hostname, reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_invalid_hostname, reject_non_fqdn_sender smtpd_sender_restrictions = reject_unknown_sender_domain, reject_sender_login_mismatch smtpd_sender_login_maps = $virtual_mailbox_maps
而在我的/etc/postfix/master.cf ,我只有默认的,没有任何限制:
smtp inet n - - - - smtpd
我还可以补充一点,我使用非自签名证书的saslauthentication,而且我的服务器是Debian Wheezy,但我认为这与我的问题没有关系。
任何线索如何解决我的问题,或在哪里看?
您已将服务器设置为拒绝HELO中使用的无效和未知主机名。
smtpd_helo_restrictions = permit_mynetworks, reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname, reject_unknown_helo_hostname, permit
(也就是那条线以permit结束;你错过了configuration的一部分。)
如果您希望能够发送来自客户端的电子邮件,而这些客户端没有使用有效的主机名发出适当的HELO,请移除reject_invalid_helo_hostname和reject_unknown_helo_hostname 。