主题: 部分邮件用户发送失败问题:temporary failure

==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本号:0.9.0
- 使用哪个数据库存储用户帐号(OpenLDAP,MySQL,PostgreSQL):MySQL
- 使用的 Linux/BSD 发行版名称及版本号:centos6.5
- 与您的问题相关的日志信息:
Jun 21 15:47:35 mailserver postfix/pipe[9178]: E07B53DC062D: to=<aa@mail.com>, relay=dovecot, delay=606, delays=593/12/0/0.1, dsn=4.3.0, status=deferred (temporary failure)
Jun 21 15:47:35 mailserver postfix/pipe[8937]: E07B53DC062D: to=<dd@mail.com>, relay=dovecot, delay=606, delays=593/0.91/0/11, dsn=2.0.0, status=sent (delivered via dovecot service)
Jun 21 15:47:35 mailserver postfix/pipe[8931]: E07B53DC062D: to=<cc@mail.com>, relay=dovecot, delay=606, delays=593/0.82/0/12, dsn=2.0.0, status=sent (delivered via dovecot service)
Jun 21 15:47:35 mailserver postfix/pipe[8943]: E07B53DC062D: to=<dd@mail.com>, relay=dovecot, delay=606, delays=593/12/0/0.09, dsn=4.3.0, status=deferred (temporary failure)
Jun 21 15:47:35 mailserver postfix/pipe[8939]: E07B53DC062D: to=<ee@mail.com>, relay=dovecot, delay=606, delays=593/0.93/0/12, dsn=2.0.0, status=sent (delivered via dovecot service)
Jun 21 15:47:35 mailserver postfix/pipe[8949]: E07B53DC062D: to=<ff@mail.com>, relay=dovecot, delay=606, delays=593/11/0/1.2, dsn=4.3.0, status=deferred (temporary failure)
Jun 21 15:47:35 mailserver postfix/pipe[8012]: E07B53DC062D: to=<gg@mail.com>, relay=dovecot, delay=606, delays=593/12/0/1, dsn=4.3.0, status=deferred (temporary failure)
Jun 21 15:47:36 mailserver postfix/pipe[8959]: E07B53DC062D: to=<hh@mail.com>, relay=dovecot, delay=606, delays=593/13/0/0.15, dsn=4.3.0, status=deferred (temporary failure)
Jun 21 15:47:36 mailserver postfix/pipe[8959]: E07B53DC062D: to=<ii@mail.com>, relay=dovecot, delay=606, delays=593/13/0/0.18, dsn=4.3.0, status=deferred (temporary failure)
Jun 21 15:47:36 mailserver postfix/pipe[8955]: E07B53DC062D: to=<jj@mail.com>, relay=dovecot, delay=606, delays=593/13/0/0.15, dsn=4.3.0, status=deferred (temporary failure)
Jun 21 15:47:36 mailserver postfix/pipe[5065]: E07B53DC062D: to=<kk@mail.com>, relay=dovecot, delay=606, delays=593/0.74/0/12, dsn=2.0.0, status=sent (delivered via dovecot service)
Jun 21 15:47:36 mailserver postfix/pipe[8955]: E07B53DC062D: to=<ll@mail.com>, relay=dovecot, delay=607, delays=593/13/0/0.19, dsn=4.3.0, status=deferred (temporary failure)
====
张工,你好!我们公司同事在发邮件(发给将近500个用户)时,出现了大量的temporary failure错误,最终有100多个用户发送失败。之前iredapd升级过,我这边用的是iRedAPD-1.6.0。不知道这是什么问题导致的,该如何解决,请帮忙解答下。谢谢!

回复: 部分邮件用户发送失败问题:temporary failure

邮件服务我在main.cf中注释了content_filter配置,amavisd配置中注释了bypass_spam_checks_maps => [1],bypass_virus_checks_maps => [1],bypass_header_checks_maps => [1]配置,关闭了杀毒和内容过滤的功能,但检查时amavisd和clamd服务仍在跑,不知道和这个有没有关系。

回复: 部分邮件用户发送失败问题:temporary failure

叶嘉文 写道:

Jun 21 15:47:36 mailserver postfix/pipe[8955]: E07B53DC062D: to=<ll@mail.com>, relay=dovecot, delay=607, delays=593/13/0/0.19, dsn=4.3.0, status=deferred (temporary failure)

该日志显示邮件已由 postfix 转交给 dovecot LDA 程序处理,但 LDA 投递时出现错误。所以请看 /var/log/dovecot.log 和 /var/log/dovecot-sieve.log 以确定具体为何出错。

回复: 部分邮件用户发送失败问题:temporary failure

========dovecot.log
Jun 21 15:47:40 dict: Error: mysql(127.0.0.1): Connect failed to database (vmail): Too many connections - waiting for 25 seconds before retry
Jun 21 15:47:40 dict: Error: dict sql lookup failed: Not connected to database
Jun 21 15:47:40 dict: Error: dict sql lookup failed: Not connected to database
========dovecot-sieve.log
Jun 21 15:47:40 lda(lll@mail.com): Error: Internal quota calculation error
Jun 21 15:47:40 lda(lll@mail.com): Error: sieve: msgid=<001a01d1cb8f$d10877d0$73196770$@mail.com>: failed to store into mailbox 'INBOX': Internal error occurred. Refer to server log for more information. [2016-06-21 15:47:40]
Jun 21 15:47:40 lda(lll@mail.com): Error: sieve: script //var/vmail/vmail1/mail.com/y/a/n/lll-2013.03.25.10.30.51//sieve/dovecot.sieve failed with unsuccessful implicit keep (user logfile //var/vmail/vmail1/mail.com/l/l/l/lll-2013.03.25.10.30.51//sieve/dovecot.sieve.log should reveal additional details)

张工,我看了下dovecot.log日志提示数据库连接数不够,已经调整了max_connections参数,但dovecot-sieve.log日志中的错误信息不是很明白,还要做其他调整吗?

回复: 部分邮件用户发送失败问题:temporary failure

=========maillog
1)
Jun 20 10:16:30 mailserver postfix/trivial-rewrite[17190]: warning: proxy:mysql:/etc/postfix/mysql/virtual_mailbox_domains.cf: table lookup problem
Jun 20 10:16:30 mailserver postfix/trivial-rewrite[17190]: warning: virtual_mailbox_domains lookup failure
Jun 20 10:16:30 mailserver postfix/trivial-rewrite[17190]: warning: proxy:mysql:/etc/postfix/mysql/virtual_mailbox_domains.cf: table lookup problem
Jun 20 10:16:30 mailserver postfix/trivial-rewrite[17190]: warning: virtual_mailbox_domains lookup failure
Jun 20 10:16:30 mailserver postfix/trivial-rewrite[17190]: warning: proxy:mysql:/etc/postfix/mysql/virtual_mailbox_domains.cf: table lookup problem
Jun 20 10:16:30 mailserver postfix/trivial-rewrite[17190]: warning: virtual_mailbox_domains lookup failure
2)
Jun 20 10:16:42 mailserver postfix/error[20414]: 8B6D93DC0638: to=<bbb@mail.com>, relay=none, delay=17, delays=4.6/0.6/0/12, dsn=4.3.0, status=deferred (address resolver failure)
3)
Jun 22 16:39:18 mailserver postfix/smtpd[1029]: NOQUEUE: reject: RCPT from unknown[172.17.73.1]: 451 4.3.0 <aaa@mail.com>: Temporary lookup failure; from=<aaa@mail.com> to=<lll@mail.com> proto=ESMTP helo=<127.0.0.1>
张工,邮件日志里还有上面几种发送邮件失败的错误(virtual_mailbox_domains lookup failure),(address resolver failure),(Temporary lookup failure),不知道是不是因为数据库连接数不够引起的,还是有其他的原因。

回复: 部分邮件用户发送失败问题:temporary failure

将 mysql 的 max connections 参数调大点,重启各个服务,再跟踪一下日志文件。

回复: 部分邮件用户发送失败问题:temporary failure

=======dovecot.log
Jun 23 16:33:00 master: Warning: service(dict): process_limit (100) reached, client connections are being dropped
Jun 23 16:33:00 dict: Info: mysql(127.0.0.1): Connected to database vmail

Jun 23 16:33:10 imap(aa@mail.com): Error: read(/var/run/dovecot/dict) failed: Connection reset by peer
Jun 23 16:33:10 imap(bb@mail.com): Error: read(/var/run/dovecot/dict) failed: Connection reset by peer
Jun 23 16:33:10 imap(cc@mail.com): Error: read(/var/run/dovecot/dict) failed: Connection reset by peer
Jun 23 16:33:10 imap(dd@mail.com): Error: Internal quota calculation error

张工,调整完后还是存在少量的退信问题,其中报错日志如上。是不是由于dovecot服务中处理限制的值过小导致的。是否把default_process_limit参数值调大点即可。还是说有其他什么原因造成以上错误。

=======maillog
Jun 24 02:29:17 mailserver postfix/local[30177]: 70BCC3DC05CE: to=<sa@mailserver.mail.com>, relay=local, delay=555, delays=555/0.02/0/0.07, dsn=4.3.0, status=deferred (temporary failure. Command output: Can't open log file /var/log/dovecot-sieve.log: Permission denied )
-rw-------  1 vmail       vmail        32370055 6月  24 09:22 dovecot-sieve.log
还有,日志中报了少量无法打开日志文件,没有权限的问题。我看了下,应该是对该文件有读写的权限,不知道是什么原因导致的。

回复: 部分邮件用户发送失败问题:temporary failure

========dovecot.log
Jun 24 09:11:47 imap(aaa@mail.com): Warning: read(/var/run/dovecot/dict): dict lookup took 23 seconds
Jun 24 09:11:47 imap(aaa@mail.com): Error: dict quota: Quota update failed, it's now desynced
Jun 24 09:11:47 imap(aaa@mail.com): Warning: read(/var/run/dovecot/dict): dict lookup took 22 seconds
Jun 24 09:11:47 imap(aaa@mail.com): Warning: read(/var/run/dovecot/dict): dict lookup took 22 seconds
Jun 24 09:11:47 imap(aaa@mail.com): Error: dict quota: Quota update failed, it's now desynced
Jun 24 09:11:47 imap(aaa@mail.com): Error: dict quota: Quota update failed, it's now desynced

Jun 24 09:12:06 dict: Error: sql dict: commit failed: Lock wait timeout exceeded; try restarting transaction
Jun 24 09:12:06 dict: Error: sql dict: commit failed: Lock wait timeout exceeded; try restarting transaction
Jun 24 09:12:06 dict: Error: sql dict: commit failed: Lock wait timeout exceeded; try restarting transaction

张工,邮件退信时dovecot组件还报了这些错误。看起来像是dovecot与数据库对接时有问题,不知道这个该怎么处理。

回复: 部分邮件用户发送失败问题:temporary failure

叶嘉文 写道:

Jun 23 16:33:00 master: Warning: service(dict): process_limit (100) reached, client connections are being dropped

把 dovecot.conf 里的 dict 服务的 process_limit 参数调大,重启dovecot服务后试试。
默认没有添加 process_limit 参数,自己加上即可。

回复: 部分邮件用户发送失败问题:temporary failure

=======maillog
Jun 27 02:29:17 mailserver postfix/local[31583]: 38B133DC0623: to=<sa@mailserver.mail.com>, relay=local, delay=555, delays=555/0.02/0/0.08, dsn=4.3.0, status=deferred (temporary failure. Command output: Can't open log file /var/log/dovecot-sieve.log: Permission denied )
-rw------- 1 vmail vmail 5955639 6月  27 17:32 dovecot-sieve.log
张工,邮件日志里还是有少量这种类型的邮件退信日志。虽然日志里已经说明没有权限访问这个文件(上面是文件的权限),但是我理解是不是有什么其他原因造成的。

回复: 部分邮件用户发送失败问题:temporary failure

先检查文件是否存在?权限是否正确?

回复: 部分邮件用户发送失败问题:temporary failure

-rw------- 1 vmail vmail 8904712 6月  28 08:25 /var/log/dovecot-sieve.log
文件存在,且只有vmail用户有读写权限。而且这种错误只有少量的,如果没有文件,在邮件投递的过程中应该会全部报这个错吧。所以我现在也很疑惑到底是什么原因造成的。

回复: 部分邮件用户发送失败问题:temporary failure

叶嘉文 写道:

to=<sa@mailserver.mail.com>, relay=local

这个是投递给系统账号 sa 的。在 /etc/postfix/aliases 里给它添加一个 alias,将邮件转发到某个真实的邮件地址即可解决。