Re: [Imap-protocol] Multiple non-waiting UID SEARCH commands

Alexey Melnikov <[email protected]>
Newsgroups gmane.mail.imap.general
Message-ID <[email protected]>
On 21/08/2013 11:26, Lasse Jansen wrote:
> Hi,
>
> I'm trying to find out if it's possible to issue multiple non-waiting 
> UID SEARCH commands like this:
>
> 1 UID SEARCH UNSEEN
> 2 UID SEARCH FLAGGED
> 3 UID SEARCH DELETED
>
> RFC 3501 says this:
>
> UID SEARCH + UID SEARCH may be valid or invalid as a non-waiting
>        command sequence, depending upon whether or not the second UID
>        SEARCH contains message sequence numbers.
> As none of the commands contain message sequence numbers, I would say this should be allowed.
>
> With Gmail and Courier-IMAP everything seems to work fine, but with Dovecot, although both the tagged and untagged responses have the correct order within their category in my testing, sometimes an untagged response is sent before the tagged response of the preceding command:
Both are legal.
>
> 1 UID SEARCH UNSEEN
> 2 UID SEARCH FLAGGED
> 3 UID SEARCH DELETED
> * SEARCH 33085
> 1 OK Search completed (0.000 secs).
> * SEARCH
> * SEARCH
> 2 OK Search completed (0.000 secs).
> 3 OK Search completed (0.000 secs).
> But this should be fine as long as I can rely on the order of the untagged responses. So my questions are:
>
> 1. Is my interpretation correct that the above commands are valid according to the RFC?
> 2. Do you know of any servers that don't respond in the order of the commands?
Servers should not reorder responses to such commands or they will be in 
violation of RFC 3501. So yes, you can rely on the order.

_______________________________________________
Imap-protocol mailing list
[email protected]
http://mailman2.u.washington.edu/mailman/listinfo/imap-protocol
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.