Re: [imapext] SEARCHRES RFC5182

Adrien de Croy <adrien@qbik.com> Wed, 10 March 2021 20:14 UTC

Return-Path: <adrien@qbik.com>
X-Original-To: imapext@ietfa.amsl.com
Delivered-To: imapext@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DE01D3A1737 for <imapext@ietfa.amsl.com>; Wed, 10 Mar 2021 12:14:28 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.896
X-Spam-Level:
X-Spam-Status: No, score=-1.896 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UwOZFUvMiVlV for <imapext@ietfa.amsl.com>; Wed, 10 Mar 2021 12:14:27 -0800 (PST)
Received: from smtp.qbik.com (smtp.qbik.com [122.56.26.1]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 997A53A1736 for <imapext@ietf.org>; Wed, 10 Mar 2021 12:14:26 -0800 (PST)
Received: From [192.168.1.162] (unverified [192.168.1.162]) by SMTP Server [192.168.1.3] (WinGate SMTP Receiver v9.4.2 (Build 6000)) with SMTP id <0002430418@smtp.qbik.com>; Thu, 11 Mar 2021 09:14:20 +1300
From: Adrien de Croy <adrien@qbik.com>
To: Alexey Melnikov <alexey.melnikov@isode.com>
Cc: "imapext@ietf.org" <imapext@ietf.org>
Date: Wed, 10 Mar 2021 20:14:22 +0000
Message-Id: <emedd85d67-977f-4847-922b-541a4f97294d@bombadil>
In-Reply-To: <23240094-4827-f85e-6ad5-6b22bc09905b@isode.com>
References: <CAO0d3bLXzYynT-9BxDy2DS4nHGzVM2hBTAQyyy2nhu-s1FmsNg@mail.gmail.com> <CAO0d3bJ_ma7R+0Xti0sO8fEL9g1qJWfs8F25O7GODT2r4eEzaQ@mail.gmail.com> <f53b4661-1d6c-4243-b76d-169ba1a33017@gulbrandsen.priv.no> <40f8d9ec-2387-4e38-819d-fdb4407c5709@spark> <e90008f2-fde5-4596-a1a9-4dc6d8ea9753@gulbrandsen.priv.no> <3089d87b-5884-44bf-8eb9-ef5d34f16756@spark> <em68d5d29d-695c-4b42-be1c-4d99ee6bcf08@bombadil> <23240094-4827-f85e-6ad5-6b22bc09905b@isode.com>
Reply-To: Adrien de Croy <adrien@qbik.com>
User-Agent: eM_Client/8.1.1054.0
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="------=_MB7B96A514-F5CC-47C2-937A-7670668BDB8E"
Archived-At: <https://mailarchive.ietf.org/arch/msg/imapext/Nhn7aD1nj6wgAlrk50QpCNsUyTs>
Subject: Re: [imapext] SEARCHRES RFC5182
X-BeenThere: imapext@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Discussion of IMAP extensions <imapext.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/imapext>, <mailto:imapext-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/imapext/>
List-Post: <mailto:imapext@ietf.org>
List-Help: <mailto:imapext-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/imapext>, <mailto:imapext-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 10 Mar 2021 20:14:29 -0000

Hi Alexey

------ Original Message ------
From: "Alexey Melnikov" <alexey.melnikov@isode.com>
To: "Adrien de Croy" <adrien@qbik.com>
Cc: "imapext@ietf.org" <imapext@ietf.org>
Sent: 10/03/2021 11:07:25 pm
Subject: Re: [imapext] SEARCHRES RFC5182

>Hi Adrien,
>
>On 09/03/2021 23:21, Adrien de Croy wrote:
>>Hi Everyone
>>
>>I've been looking into this extension, but it has a number of problems 
>>and uncertainties in the spec especially:
>>
>>* in relation to storing results of ESEARCH extensions, it refers to 
>>them as messages).
>Can you elaborate/quote specific text which is confusing?
>


When the SAVE result option is combined with the MIN or MAX [ESEARCH]
    result option, and none of the other ESEARCH result options are
    present, the corresponding MIN/MAX is returned (if the search result
    is not empty), but the "$" marker would contain a single message as
    returned in the MIN/MAX return item.


It's not clear if $ is storing the result of the MIN, or something else. 
  But I guess those are the same for MIN and MAX - the IDs.

$ only stores message IDs, not messages.  Maybe replace "contain a 
single message" with "refers to a single message" or "contains the 
message ID"

I guess I should have read it a few more times.  Maybe it's not so 
unclear.

>
>
>>* in relation to reporting errors if the saved results are 
>>incompatible (e.g. stored SEQ but asked to use as UID or vice versa)
>The document is quite clear that $ references message numbers or UIDs 
>as appropriate in the corresponding context. So a saved result is never 
>incompatible.
>

So we save both UIDs and SEQ and adjust these on expunge, and just use 
whichever one is appropriate in the subsequent commands.

Thanks!

Adrien

>
>
>You can see this in the last paragraph of section 2.1:
>
>    Implementation note: server implementors should note that "$" can
>    reference IMAP message sequences or UID sequences, depending on the
>    context where it is used.  For example, the "$" marker can be set as
>    a result of a SEARCH (SAVE) command and used as a parameter to a UID
>    FETCH command (which accepts a UID sequence, not a message 
>sequence),
>    or the "$" marker can be set as a result of a UID SEARCH (SAVE)
>    command and used as a parameter to a FETCH command (which accepts a
>    message sequence, not a UID sequence).
>
>>* dealing with expunging of messages.
>I think this is also clear, from Section 2.1:
>
>    When a message listed in the search result variable is EXPUNGEd, it
>    is automatically removed from the list.  Implementors are reminded
>    that if the server stores the list as a list of message numbers, it
>    MUST automatically adjust them when notifying the client about
>    expunged messages, as described in Section 7.4.1 of [IMAP4].
>
>
>
>If it helps, the best way of implementing this (IMHO) is to store a 
>list of UIDs in some form and translate them to sequence numbers in the 
>server, when needed. When messages are expunged, this list is purged of 
>expunged messages.
>
>>So my first question relates to whether I'm even wasting my time.  The 
>>imapwiki shows very few servers support it, but are any clients known 
>>to support it?
>I don't know the answer to this.
>
>
>Best Regards,
>
>Alexey
>