[Imap-protocol] [noob] multiple fetch responses for the same message?

Bron Gondwana brong at fastmail.fm
Sun Nov 13 12:56:59 PST 2011

On Sun, Nov 13, 2011 at 09:37:48PM +0100, Petite Abeille wrote:

> >> * 1 FETCH (FLAGS (\Seen))

> >> * 1 FETCH (RFC822.SIZE 44827)

> On Nov 13, 2011, at 9:14 PM, Bron Gondwana wrote:


> > Compliant or not, I can bet you it will break a lot of clients.


> But, on the other hand, doesn't it happen already? For example when a BODY fetch triggers a FLAGS fetch?



> * 1 FETCH (BODY[HEADER] {342}

> ...

> * 1 FETCH (FLAGS (\Seen))

> ABC OK FETCH completed

Not with Cyrus - we collect up all the data about which fetches will
be required first, and then iterate the mailbox, spitting them out
in order.

This is quite specific, and for a reason - we calculate what flag
changes might be needed and do them with a mailbox lock, then we
release the lock before sending the response, so that other clients
are not waiting on the lock while network traffic is going on.

But it does have the other advantage of never generating duplicate
FETCH responses too.


More information about the Imap-protocol mailing list