[Dovecot] Wrong message information reported shortly after delivery

Timo Sirainen tss at iki.fi
Mon Mar 10 04:00:01 EET 2008


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:

1. deliver adds "message appended" to index file
2. quota plugin runs for a while
3. 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:

1. Create dovecot-uidlist.lock
2. Write uidlist to the dovecot-uidlist.lock
3. 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:

1. Create dovecot-uidlist.lock
2. Write uidlist to dovecot-uidlist.tmp
3. rename() .tmp to dovecot-uidlist
4. 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..
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20080310/b33999d8/attachment.bin 


More information about the dovecot mailing list