http://dovecot.procontrol.fi/test/
Maildir syncing now works pretty much as described in my earlier mail. It was quite a large change, so please test this :)
So the new and great features:
It's faster.
If someone renames maildir file just before we try to use it, we now resync the maildir and try to find it again. Before we just failed. It's also possible that the filename changed again while we resynced, so we try max. 10 times before failing (yes, we know if we should try resyncing so we don't always scan it 10 times).
Read-only maildirs work now. If we don't have write access to dovecot-uidlist, we'll show only those mails which are already there.
Out of quota/disk space failures are handled well now. All except updating dovecot-uidlist file which is a bit tricky.
:CONTROL=dir in default_mail_env can specify where to save dovecot-uidlist and .customflags files. Useful for above problems.
I think maildir support is getting near perfect now. Only thing left is to deal with failure to write dovecot-uidlist when out of quota. Oh, and NFS safe .customflags file.