MBOX-Line: From alexey.melnikov at isode.com  Wed Aug 21 08:08:07 2013
To: imap-protocol@u.washington.edu
From: Alexey Melnikov <alexey.melnikov@isode.com>
Date: Fri Jun  8 12:34:51 2018
Subject: [Imap-protocol] Multiple non-waiting UID SEARCH commands
In-Reply-To: <CAC4RtVDtTBK6EOGtqJNkCQewgc-ZpMMOMq=046j+Umh6H6imvA@mail.gmail.com>
References: <520A622E-1A91-4B04-AD6F-361896D439F5@lasselog.com>
	<5214A27E.8030300@isode.com>
	<CAC4RtVDtTBK6EOGtqJNkCQewgc-ZpMMOMq=046j+Umh6H6imvA@mail.gmail.com>
Message-ID: <5214D7D7.8080100@isode.com>

On 21/08/2013 15:47, Barry Leiba wrote:
>>> 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.
> Really?  Can you show us where in 3501 it's required that untagged
> responses be in any particular order?  I don't think it does.
I was looking at:

5.5.    Multiple Commands in Progress

    The client MAY send another command without waiting for the
    completion result response of a command, subject to ambiguity rules
    (see below) and flow control constraints on the underlying data
    stream.  Similarly, a server MAY begin processing another command
    before processing the current command to completion, subject to
    ambiguity rules.  However, any command continuation request responses
    and command continuations MUST be negotiated before any subsequent
    command is initiated.

    The exception is if an ambiguity would result because of a command
    that would affect the results of other commands.  Clients MUST NOT
    send multiple commands without waiting if an ambiguity would result.
    If the server detects a possible ambiguity, it MUST execute commands
    to completion in the order given by the client.

(The last sentence) But I suppose it doesn't cover cases when there is 
no ambiguity, for example if commands are truly independent.

So I suppose I was not quite correct. In reality though, I don't know of 
any server that would execute multiple SEARCHes out of order. I am 
curious to learn if any such server exists.


