我试图发送自动通知电子邮件给我的网站的用户。 这些电子邮件通过自定义守护进程发送给用户,自定义守护进程通过进程4发送它们.Exim的作用就是将邮件转发到与收件人地址关联的邮件服务器。 所有传出的电子邮件必须中继。 没有本地电子邮件,也没有收到邮件。
但是,当我尝试发送电子邮件时,守护进程总是得到以下响应:
com.sun.mail.smtp.SMTPAddressFailedException: 451 Temporary local problem - please try later
在/var/log/exim4/mainlog ,我有以下几行
2014-09-09 22:30:50 no host name found for IP address 10.0.2.2 2014-09-09 22:30:50 H=(lotp-lanbox) [10.0.2.2] F=<[email protected]> temporarily rejected RCPT <[email protected]>: host lookup did not complete
(请注意,10.0.2.2是安装了发件人守护程序的主机的IP地址。)
这个消息很奇怪,但缺乏细节。 这是另一个我已经启动的debugging命令:
user@host:~$ exim4 -bt -d-resolver [email protected] Exim version 4.82 uid=0 gid=0 pid=14035 D=fbb95cfd Berkeley DB: Berkeley DB 5.3.28: (September 9, 2013) Support for: crypteq iconv() IPv6 GnuTLS move_frozen_messages DKIM Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmjz dbmnz dnsdb dsearch nis nis0 passwd Authenticators: cram_md5 plaintext Routers: accept dnslookup ipliteral manualroute queryprogram redirect Transports: appendfile/maildir/mailstore autoreply lmtp pipe smtp Fixed never_users: 0 Size of off_t: 8 Compiler: GCC [4.8.2] Library version: GnuTLS: Compile: 2.12.23 Runtime: 2.12.23 Library version: PCRE: Compile: 8.31 Runtime: 8.31 2012-07-06 Total 13 lookups WHITELIST_D_MACROS: "OUTGOING" TRUSTED_CONFIG_LIST: "/etc/exim4/trusted_configs" changed uid/gid: forcing real = effective uid=0 gid=0 pid=14035 auxiliary group list: <none> seeking password data for user "uucp": cache not available getpwnam() succeeded uid=10 gid=10 changed uid/gid: calling tls_validate_require_cipher uid=109 gid=116 pid=14036 auxiliary group list: <none> tls_validate_require_cipher child 14036 ended: status=0x0 configuration file is /var/lib/exim4/config.autogenerated log selectors = 00000ffc 00632001 trusted user admin user seeking password data for user "mail": cache not available getpwnam() succeeded uid=8 gid=8 user name "root" extracted from gecos field "root" originator: uid=0 gid=0 login=root name=root sender address = root@dev Address testing: uid=0 gid=116 euid=0 egid=116 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Testing [email protected] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Considering [email protected] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> routing [email protected] --------> hubbed_hosts router <-------- local_part=foobar domain=romandie.com checking domains expansion of "${if exists{/etc/exim4/hubbed_hosts}{partial-lsearch;/etc/exim4/hubbed_hosts}fail}" forced failure: assume not in this list hubbed_hosts router skipped: domains mismatch --------> dnslookup_relay_to_domains router <-------- local_part=foobar domain=romandie.com checking domains romandie.com in "@:localhost"? no (end of list) romandie.com in "*"? yes (matched "*") romandie.com in "! +local_domains : +relay_to_domains"? yes (matched "+relay_to_domains") R: dnslookup_relay_to_domains for [email protected] calling dnslookup_relay_to_domains router dnslookup_relay_to_domains router called for [email protected] domain = romandie.com DNS lookup of romandie.com (MX) succeeded dnslookup_relay_to_domains router: defer for [email protected] message: host lookup did not complete [email protected] cannot be resolved at this time: host lookup did not complete search_tidyup called >>>>>>>>>>>>>>>> Exim pid=14035 terminating with rc=1 >>>>>>>>>>>>>>>>
下面是我看起来特别怪异的摘录(从输出结尾开始):
dnslookup_relay_to_domains router called for [email protected] domain = romandie.com DNS lookup of romandie.com (MX) succeeded dnslookup_relay_to_domains router: defer for [email protected] message: host lookup did not complete [email protected] cannot be resolved at this time: host lookup did not complete
如何才能成功和不完整的DNS查找? 我究竟做错了什么?
我已经尝试使用安装了exim4的机器进行dig ,并且结果对我来说很好:
user@host:~$ dig mx romandie.com ;; Warning: Message parser reports malformed message packet. ; <<>> DiG 9.9.5-3-Ubuntu <<>> mx romandie.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36151 ;; flags: qr aa rd ra ad; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1 ;; WARNING: Message has 1 extra bytes at end ;; QUESTION SECTION: ;romandie.com. IN MX ;; ANSWER SECTION: romandie.com. 3600 IN A 37.35.105.169 romandie.com. 3600 IN A 37.35.105.166 ;; Query time: 19 msec ;; SERVER: 10.0.2.3#53(10.0.2.3) ;; WHEN: Tue Sep 09 23:14:45 UTC 2014 ;; MSG SIZE rcvd: 63
查找本身看起来很好。
为什么exim说同时成功和失败呢?
您正在使用的recursionDNSparsing器( 10.0.2.3上的10.0.2.3 )严重中断。 在你的挖掘命令,你要求它的MXlogging。 但它会发送一个包含两个Alogging的答案。 这甚至不是因为该域没有MXlogging。 我只是检查,并确实在该域名MXlogging。 此外, dig会警告你答复数据包格式不正确。 WARNING: Message has 1 extra bytes at end 。
我build议你停止使用那个错误的DNS服务器。 尝试在/etc/resolv.conf另一个DNSparsing器。 我使用8.8.8.8有很好的经验。
DNS MXlogging必须指向名称,而不是IP地址。 看起来您可能需要使用allow_mx_to_ip选项作为解决方法。
你有两个具体的问题,我一次回答一个问题:
没有为IP地址10.0.2.2find主机名称的消息仅仅意味着当主机10.0.2.2连接到exim服务器上的端口25时,exim对该IP地址进行了rDNS查找,而DNS使用NXDOMAIN进行响应(实际上是一个答案指的是NXDOMAIN)。 它对Exim是否接受信息没有影响。
消息451临时本地问题是Exim告诉你,它被configuration为通过它发送电子邮件时做一些事情,其中的一件事情是失败的。 您在该域中没有MXlogging,因此您依赖于某个称为“logging回退”的内容,根据RFC的规定,这是可以的,但这样做是不明智的。 最后,Exim服务器确定该域名无法访问。 检查你的networking设置是否正确,你实际上可以得到它提供的IP地址。
我可能会误解这一点,但我认为“DNS查找成功”的消息并不意味着它得到了它所要求的logging。 这仅仅意味着Exim问,并得到了一个不是拒绝的回应。 之后的行是Exim实际分析响应时,由于某种原因决定它没有得到它想要的答案。