Bug with shared access to mailbox

van der Kamp, John jkamp at amazon.nl
Mon May 30 13:41:52 UTC 2016


I'm testing dovecot with some setups, and one of them is with shared
mailboxes. The test I wrote will create and delete mail using multiple
connections to the same user and folder. Each connection makes a couple of
mails, remembers the uid from APPENDUID, and will delete those emails again.
At the end of the test I expect an empty folder.

This is not what happens. At the end I still have several mails in the
folder. I lack insight in the dovecot source to tell exactly what's going
on. I've tested this with different setups:
1) local system user, connecting over localhost -> bug is present
2) local system user, connecting over internet -> bug is present, but is
harder to reproduce
3) dovecot as proxy to another imap server -> bug is present
In step 3, you can even setup a dovecot to be a proxy to another dovecot

>From logging in the other imap server I've seen that a client command to the
proxy like:
TAG UID STORE 1:3 +FLAGS (\Deleted)
will be sent to the other imap server in 3 steps, one for each message. When
running the test with multiple threads, that logging shows that some uids
are never sent to the other imap server, and some uids are sent over
different connections than they original were sent to. (Thread 1 deletes
1:3, Thread 2 deletes 4:6, the proxy of Thread 1 might expunge messages from
Thread 2 and vice versa).

Attached is a python script which tests the behavior. The script expects a
file named "testmail.eml" to upload to the imap server. I used an email
which was about 75 kB.
I tested using version: 2.2.22 (fe789d2).
Let me know if I can help in any other way too.


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dovecot-threading-bug.py
URL: <http://dovecot.org/pipermail/dovecot/attachments/20160530/89d17fdc/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5332 bytes
Desc: not available
URL: <http://dovecot.org/pipermail/dovecot/attachments/20160530/89d17fdc/attachment.p7s>

More information about the dovecot mailing list