[Imap-protocol] Where to start?

Bron Gondwana brong at fastmail.fm
Sun Jun 5 21:57:06 PDT 2011

On Mon, Jun 06, 2011 at 10:20:59AM +1000, Robert Mueller wrote:

> So one client might delete + expunge a message, but another connection

> won't see that expunge until they do a command that allows it to be

> seen. This can significantly affect how you design your internal state

> management, namely that when you expunge a message, you probably just

> want to mark it as expunged on disk and actually cleanup later, rather

> than removing it immediately from your mailbox state. This is useful

> longer term for things like QRESYNC as well.


> I'm sure Bron (cc'd) can make some comments on this as well, given the

> significant changes he made to cyrus to make this work correctly.

Yes indeed. Cyrus was keeping an mmaped previous file (now unlinked)
around after every expunge - which was all well and good, but it meant
that flags got stale and modseqs were totally broken and things got
significantly odd.

One comment I would definitely make,


Use it. There's nothing better than a test suite that can be used
to automatically test your implementation. If you find any tests
missing, write them yourself and push them back to Timo. We have
started a separate test suite called 'Cassandane' for testing Cyrus,
which is available at:


(git repository only)

This is designed to test things that ImapTest realistically can't, by
running up instances of Cyrus (possibly multiple in replication or
murder (aggregation) configurations) - and then running tests and making
sure things are correct across all instances.

Testing by hand with clients is great too, but if you have to do a test
by hand it won't catch regressions as easily, because you can't run every
test by hand for every change you make, or you'll never get anywhere.

Finally - best of luck! I did consider writing my own IMAP server at one
point, but sanity prevailed and I decided to fix up Cyrus to do what we
needed instead.



More information about the Imap-protocol mailing list