Dovecot 损坏的事务日志文件延迟了电子邮件

Ama*_*rus 3 email postfix nfs dovecot

我们运行 dovecot 作为 IMAP 服务器和 postfix 来传递邮件。我们的一位用户抱怨电子邮件被延迟了(不,我们没有使用灰名单或类似的东西)。/var/log/mail.info 在用户应该收到此电子邮件的时间显示这些日志消息。邮件目录(例如 /mail)安装在 NFS 上(如果有帮助)

Jul 26 18:31:08 mail1 deliver(user@example.com): Corrupted transaction log file /mail/example.com/user/dovecot.index.log: start_offset (5160) > file size (5140)
Jul 26 18:31:08 mail1 deliver(user@example.com): fscking index file /mail/example.com/user/dovecot.index
Jul 26 18:31:08 mail1 deliver(user@example.com): msgid=<20090726173107.8361B2DD@mail.example.com>: save failed to INBOX: Internal error occurred. Refer to server log for more information. [2009-07-26 18:31:08]
Run Code Online (Sandbox Code Playgroud)

Ave*_*yne 6

哦!延迟的原因是 dovecot 正在尝试处理损坏的索引。

只需让用户退出邮件,删除索引文件,当他们登录时它会自动重新创建。因此,只需执行以下操作:

rm /mail/example.com/user/dovecot.*
Run Code Online (Sandbox Code Playgroud)

Dovecot 为每条消息创建临时索引文件;当用户第一次登录时,如果索引不存在,则从头开始创建索引,因此这是一个简单有效的修复方法,并且每次都有效。我在早期版本的 Dovecot 中遇到过这种情况,删除索引在所有情况下都是 100% 有效的。

正在以 maildir 格式将邮件存储在该 NFS 挂载上,对吗?

顺便说一下,Dovecot 的 1.0 之前或 beta 版本经常有这个问题。较新的版本已修复此问题。