Re: [imapext] SEARCHRES RFC5182

Alexey Melnikov <alexey.melnikov@isode.com> Wed, 10 March 2021 10:07 UTC

Return-Path: <alexey.melnikov@isode.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 3B74A3A20F5 for <imapext@ietfa.amsl.com>; Wed, 10 Mar 2021 02:07:32 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Level:
X-Spam-Status: No, score=-2.099 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, NICE_REPLY_A=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=isode.com
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 GbqvypebSzFY for <imapext@ietfa.amsl.com>; Wed, 10 Mar 2021 02:07:30 -0800 (PST)
Received: from waldorf.isode.com (waldorf.isode.com [62.232.206.188]) by ietfa.amsl.com (Postfix) with ESMTP id A70C83A20F3 for <imapext@ietf.org>; Wed, 10 Mar 2021 02:07:30 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1615370846; d=isode.com; s=june2016; i=@isode.com; bh=/D52Bt78tmzGpxaHhFT0ezFi8z+Nl63L6iD5PFiWTyk=; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version: In-Reply-To:References:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description; b=NgBaFyi7gdEA2shNlkdQpIE13NC4l0ZzH/M4c+Ws49K8bvwHIst5u1jLAhdVeJ4+tOgcP5 tqsPj5hsS++hYJyKZuHSmg1lv07T9/pf7GLPUIwbfWUYB91m7hWF/tlY8Lpa8w7pzkbOSh fp+NobDf8dkE4f/Xt4+4aYQVzoHcTQQ=;
Received: from [192.168.0.5] (4e697ac1.skybroadband.com [78.105.122.193]) by waldorf.isode.com (submission channel) via TCP with ESMTPSA id <YEiaXQAuQcXZ@waldorf.isode.com>; Wed, 10 Mar 2021 10:07:26 +0000
From: Alexey Melnikov <alexey.melnikov@isode.com>
To: Adrien de Croy <adrien@qbik.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>
Cc: "imapext@ietf.org" <imapext@ietf.org>
Message-ID: <23240094-4827-f85e-6ad5-6b22bc09905b@isode.com>
Date: Wed, 10 Mar 2021 10:07:25 +0000
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1
In-Reply-To: <em68d5d29d-695c-4b42-be1c-4d99ee6bcf08@bombadil>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="------------0A813B625497C00D280239E2"
Content-Language: en-GB
Archived-At: <https://mailarchive.ietf.org/arch/msg/imapext/nFURvqmDq5UKhWtt6PMJrIA0hag>
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 10:07:32 -0000

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?

> * 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.

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