MBOX-Line: From brong at fastmail.fm  Sun Jun  5 21:57:06 2011
To: imap-protocol@u.washington.edu
From: Bron Gondwana <brong@fastmail.fm>
Date: Fri Jun  8 12:34:46 2018
Subject: [Imap-protocol] Where to start?
In-Reply-To: <1307319659.7961.1459831005@webmail.messagingengine.com>
References: <4DEBB242.2090200@BusCom.net> <4DEBB58D.3090101@logicprobe.org>
	<4DEBBAB3.2030301@BusCom.net> <4DEBBEC1.3080600@BusCom.net>
	<201106051924.p55JOwpG003543@mxout12.cac.washington.edu>
	<4DEBDFF5.9000301@BusCom.net>
	<1307319659.7961.1459831005@webmail.messagingengine.com>
Message-ID: <20110606045706.GA6121@brong.net>

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,

http://www.imapwiki.org/ImapTest

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:

http://git.cyrusimap.org/cassandane/

(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.

Regards,

Bron.

