Hi, I'm working on an IMAP client and had a question about the order in which commands are responded to in Dovecot. In other IMAP servers I've looked at, when you issue two commands simultaneously (i.e. pipelining) it looks something like this: a fetch something b fetch something else * 1 FETCH (result) a OK FETCH completed * 1 FETCH (result) b OK FETCH completed This works well because it's clear which results are associated with which tag; the 'a' fetch results immediately precede the a's OK response, and likewise the 'b' fetch results immediately precede the b's OK response. But in Dovecot (version 2.0.13) the results of the two simultaneous commands are ordered like this: a fetch something b fetch something else * 1 FETCH (result) * 1 FETCH (result) a OK FETCH completed b OK FETCH completed This makes associating the results of the fetch commands quite a bit more difficult, since it's not entirely clear which results are paired with which tag. My question is this: is this Dovecot's intended behavior, or did I find a bug? I realize the IMAP spec is really vague about this. If this is the intended behavior, is there any advice for clients on how to determine which results are associated with which command? Thanks! - Eric
On 18.2.2012, at 3.54, Eric Gregory wrote:> But in Dovecot (version 2.0.13) the results of the two simultaneous > commands are ordered like this: > > a fetch something > b fetch something else > * 1 FETCH (result) > * 1 FETCH (result) > a OK FETCH completed > b OK FETCH completed > > This makes associating the results of the fetch commands quite a bit more > difficult, since it's not entirely clear which results are paired with > which tag. > > My question is this: is this Dovecot's intended behavior, or did I find a > bug? I realize the IMAP spec is really vague about this. If this is the > intended behavior, is there any advice for clients on how to determine > which results are associated with which command?This is intended behavior. And if you issue two long FETCH commands, their replies may even be intertwined. IMAP protocol allows all kinds of variations for this actually (e.g. it would be valid for a server to return each FETCHed field in its own untagged FETCH reply). You're not supposed to care about matching FETCH replies to FETCH commands, you just need to know that you've received all the data you asked for (after all tagged commands have replied). http://imapwiki.org/ClientImplementation