On Sun, 2008-03-09 at 09:01 -0700, Ron Avriel wrote:
Can you reproduce it without your IMAP client? For example using
imaptest (http://imapwiki.org/ImapTest) as the client and running:Hi,
Here's some more information on how to easily reproduce the problem. First, I'd like to describe my environment: OS - RHEL4, FS - ext3, dovecot 1.0.12. See dovecot -n at end of message. Messages are delivered via dovecot deliver invoked by postfix. The problem is reproduced when the system is completely idle - no user is logged in, except the test user.
Thanks, in my previous tests I didn't use quota plugin with deliver which was needed to notice this. The problem is:
- deliver adds "message appended" to index file
- quota plugin runs for a while
- deliver updates filename<->uid mapping in dovecot-uidlist
The problem is when:
1.5. imap sees the new message from index file and wants to fetch its size (or something else). But it doesn't find the filename from dovecot-uidlist, so it assumes the message has been expunged and returns a "default value" for the fetch, in rfc822.size case it returns 0.
The fix would be to write dovecot-uidlist before index file. v1.1 actually does this already and this bug isn't reproducible there. But this isn't that easy to fix in v1.0 without changing code more than I'd like to. With v1.0 uidlist updating goes like:
- Create dovecot-uidlist.lock
- Write uidlist to the dovecot-uidlist.lock
- rename() it to dovecot-uidlist
This can't be done before index is updated, because the lock would be lost too early. v1.1 does this:
- Create dovecot-uidlist.lock
- Write uidlist to dovecot-uidlist.tmp
- rename() .tmp to dovecot-uidlist
- Delete dovecot-uidlist.lock
Since you're the first one to notice this problem, I think I'd rather not risk breaking v1.0 with this change..