解决exim4发不了邮件到公司邮箱的怪问题
本文可自由转载,但请遵循“署名-非商业用途-保持一致”的创作共用协议。 永久链接:JoeCen's 小猫窝-----------------------------
某台debian服务器有一个附加的功能,是使用自带的exim4群发邮件给相关同事。今天一个同事报障说,没有收到邮件。上去查看,发现之前设置的iptables规则有问题,将25端口都deny了,于是更改规则,允许25端口的包进入。测试后发现,还是不能收到邮件,发给gmail的邮件却可以收到,那应该就不是防火墙的问题了。
打开exim的mainlog查看,发现有一个错误:
retry time not reached for any host after a long failure period
使用tcpdump抓了一下包,发现exim根本就没有发包到smtp服务器上。从exim的FAQ上找到相关的信息:
This message means that all hosts to which the message could be sent
have been failing for so long that the end of the retry period
(typically 4 or 5 days) has been reached. In this situation, Exim still
computes a next time to retry, but any messages that arrive in the
meantime are bounced straight away. You can alter this behaviour by
unsetting the <tt>delay_after_cutoff</tt> option on the smtp transport. Then Exim
will try most messages for those hosts once before giving up.
have been failing for so long that the end of the retry period
(typically 4 or 5 days) has been reached. In this situation, Exim still
computes a next time to retry, but any messages that arrive in the
meantime are bounced straight away. You can alter this behaviour by
unsetting the <tt>delay_after_cutoff</tt> option on the smtp transport. Then Exim
will try most messages for those hosts once before giving up.
我想造成不能发邮件到公司邮箱的原因,应该是之前由于有防火墙的拦截,尝试次数太多导致现在exim已经不去立即尝试发邮件给该主机,而是等到超时时间到了,再进行尝试。
从另外一个exim的文档可以找到关于delay_after_cutoff的信息。但是其它的信息却很少,找了很久,才知道应该将delay_after_cutoff设置在哪里。
如果是debian操作系统的话,可以在
/etc/exim4/conf.d/transport/30_exim4-config_remote_smtp
文件中加入
delay_after_cutoff = false
重启exim即可。
November 1st, 2006 at 12:24 am Quote
惭愧,搞这么久邮件,居然没有用过exim4
November 1st, 2006 at 12:22 pm Quote
其实也不必所有软件都用过呀。
找到适合用的就可以了。
December 1st, 2006 at 11:56 am Quote
我非常喜欢你Blog的风格,能不能共享给我一份?
将感激不尽!
我的电子邮件cherio2002@gmail.com,期待您的恢复!
December 1st, 2006 at 6:54 pm Quote
Michael:
这是wordpress的其中一个模版,叫GanjaPress。
在网上很容易找得到。
December 2nd, 2006 at 11:07 pm Quote
Thanx!我找到了!
June 4th, 2008 at 12:59 pm Quote
需要清空 /var/spool/exim4/ 下所有目录才行。
不然依然没有作用。