Hi!
I should report yet another problem with dovecot index files. Suppose we have a user with his filesystem disk quota exceeded. He logins via POP3 or IMAP to remove some mail messages and fix this problem. When he logins for the first time, everything works fine, and he can read and remove something. But if his disk quota is still exceeded when he logs out, he cannot login any more.
I guess it is not fair to give user only one chance to clean his mail folders :)
The problem is that dovecot tries to rewrite index files on logout, but it cannot do it correctly because the user's filesystem quota is exceeded. So the next time dovecot just replies "Mailbox is in inconsistent state, please relogin".
I believe that dovecot should work with any kind of corrupted index files, this is why I report such kind of bugs here.
Here is a sample session with dovecot which shows the problem:
======================================== dovtest# telnet localhost pop3 Trying ::1... Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. +OK Dovecot ready.6e56.7.439bbc09.Ciej0vGPllkO4txCYDEkWA==@dovtest.ru user test +OK pass q1 +OK Logged in. list +OK 1 messages: 1 324 . dele 1 +OK Marked to be deleted. quit +OK Logging out, messages deleted. Connection closed by foreign host. dovtest# telnet localhost pop3 Trying ::1... Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. +OK Dovecot ready.6e56.8.439bbc1a.yUc5zYQ1KXeITsKTYaKlGg==@dovtest.ru user test +OK pass q1 +OK Logged in. -ERR Mailbox is in inconsistent state, please relogin. Connection closed by foreign host. dovtest# tail /var/log/maillog Dec 11 05:41:03 dovtest dovecot: pop3-login: Login: user=<test>, method=PLAIN, rip=82.146.33.127, lip=82.146.33.127 Dec 11 05:41:06 dovtest dovecot: pop3(test): Logout. top=0/0, retr=0/ del=0/1, size=324 Dec 11 05:41:14 dovtest dovecot: pop3-login: Login: user=<test>, method=PLAIN, rip=82.146.33.127, lip=82.146.33.127 Dec 11 05:41:22 dovtest dovecot: pop3(test): Logout. top=0/0, retr=1/ del=0/1, size=324 Dec 11 05:41:36 dovtest dovecot: pop3-login: Login: user=<test>, method=PLAIN, rip=82.146.33.127, lip=82.146.33.127 Dec 11 05:41:44 dovtest dovecot: pop3(test): Logout. top=0/0, retr=0/ del=1/1, size=324 Dec 11 05:41:53 dovtest dovecot: pop3-login: Login: user=<test>, method=PLAIN, rip=82.146.33.127, lip=82.146.33.127 Dec 11 05:41:53 dovtest dovecot: pop3(test): Corrupted index cache file /home/dovtest.ru/data/mail/.imap/INBOX/dovecot.index.cache: indexid changed Dec 11 05:41:53 dovtest dovecot: pop3(test): Mailbox is in inconsistent state. top=0/0, retr=0/ del=0/0, size=0 Dec 11 05:41:53 dovtest dovecot: pop3(test): Mailbox init failed top=0/0, retr=0/ del=0/0, size=0 dovtest# ls -la /home/dovtest.ru/data/mail/.imap/INBOX/ total 4 drwx------ 2 test test 512 Dec 11 05:41 . drwx------ 3 test test 512 Dec 11 05:38 .. -rw------- 1 test test 240 Dec 11 05:38 dovecot.index -rw------- 1 test test 628 Dec 11 05:41 dovecot.index.log dovtest#
It's a pity I did not report this yesterday, before 1.0.alpha5 was released...
By the way I tested this on 1.0.alpha5 compiled from source on a FreeBSD 4.11 VDS.
-- Sergey