Re: [Extra] I-D Action: draft-ietf-extra-imap-messagelimit-03.txt

Phillip Tao <ptao@apple.com> Fri, 09 June 2023 21:18 UTC

Return-Path: <ptao@apple.com>
X-Original-To: extra@ietfa.amsl.com
Delivered-To: extra@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id D645EC14CE44 for <extra@ietfa.amsl.com>; Fri, 9 Jun 2023 14:18:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Level:
X-Spam-Status: No, score=-2.097 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=apple.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gT-tyViREyYg for <extra@ietfa.amsl.com>; Fri, 9 Jun 2023 14:18:36 -0700 (PDT)
Received: from ma-mailsvcp-mx-lapp02.apple.com (ma-mailsvcp-mx-lapp02.apple.com [17.32.222.23]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5A1EAC14CE30 for <extra@ietf.org>; Fri, 9 Jun 2023 14:18:36 -0700 (PDT)
Received: from rn-mailsvcp-mta-lapp02.rno.apple.com (rn-mailsvcp-mta-lapp02.rno.apple.com [10.225.203.150]) by ma-mailsvcp-mx-lapp02.apple.com (Oracle Communications Messaging Server 8.1.0.22.20230228 64bit (built Feb 28 2023)) with ESMTPS id <0RW000ISH8IYDG00@ma-mailsvcp-mx-lapp02.apple.com> for extra@ietf.org; Fri, 09 Jun 2023 14:18:35 -0700 (PDT)
X-Proofpoint-ORIG-GUID: Xp9dWP2zbi-sxS5CrLYG5EI3-wYuedXD
X-Proofpoint-GUID: Xp9dWP2zbi-sxS5CrLYG5EI3-wYuedXD
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.573, 18.0.957 definitions=2023-06-09_16:2023-06-09, 2023-06-09 signatures=0
X-Proofpoint-Spam-Details: rule=interactive_user_notspam policy=interactive_user score=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306090179
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=from : message-id : content-type : mime-version : subject : date : in-reply-to : cc : to : references; s=20180706; bh=NNE76V4LcAU7i2XbO3I1cNC6IJfm+XBiRCw3f9dBj1s=; b=FbiCZ/2UTp7Af1IBIP2MYMftmH7sLCdojh4tpmZ2brpq+oLx+5Iz/eIHyQbh+m5FqenC C7WnNeKWkE+avxMt3W2adVObfhQ71zJY5ZbcsGppfQ0Kjqto3Ox73Tu61+2EhoNIukPB sSfe80k0HcHSL89Q/+BcOOv+lhwJYphrlmRo3whSeYuB+MZDTQuNFetM5cp2O07VYPZJ wwrPnoWsfckVr9370SCak3GtU6n7XhHWNsBTuNEV0rMovSLQ11hMnrPqGpBOCNnjSM8L Cz0VSy6xxLs5cNemrCxPYbaK37stZFX2JkkD0HPl1Solket9me/MuaY9z96IcGWgteiK Ow==
Received: from rn-mailsvcp-mmp-lapp04.rno.apple.com (rn-mailsvcp-mmp-lapp04.rno.apple.com [17.179.253.17]) by rn-mailsvcp-mta-lapp02.rno.apple.com (Oracle Communications Messaging Server 8.1.0.22.20230228 64bit (built Feb 28 2023)) with ESMTPS id <0RW000K718IYDO40@rn-mailsvcp-mta-lapp02.rno.apple.com>; Fri, 09 Jun 2023 14:18:34 -0700 (PDT)
Received: from process_milters-daemon.rn-mailsvcp-mmp-lapp04.rno.apple.com by rn-mailsvcp-mmp-lapp04.rno.apple.com (Oracle Communications Messaging Server 8.1.0.22.20230228 64bit (built Feb 28 2023)) id <0RW000800829C800@rn-mailsvcp-mmp-lapp04.rno.apple.com>; Fri, 09 Jun 2023 14:18:34 -0700 (PDT)
X-Va-A:
X-Va-T-CD: 6cf99c39a43b2a69a3a4f9a537a29252
X-Va-E-CD: 1c1b15bd2374d2b3e7a4117154030938
X-Va-R-CD: 57d4d7480bc8395466fbedd749b8a3f3
X-Va-ID: d39a93ea-bffb-4984-a75c-62a91ef046e3
X-Va-CD: 0
X-V-A:
X-V-T-CD: 6cf99c39a43b2a69a3a4f9a537a29252
X-V-E-CD: 1c1b15bd2374d2b3e7a4117154030938
X-V-R-CD: 57d4d7480bc8395466fbedd749b8a3f3
X-V-ID: 54a55bff-af93-4db5-a69c-0d0b7ed17cbb
X-V-CD: 0
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.573, 18.0.957 definitions=2023-06-09_16:2023-06-09, 2023-06-09 signatures=0
Received: from smtpclient.apple ([17.11.105.245]) by rn-mailsvcp-mmp-lapp04.rno.apple.com (Oracle Communications Messaging Server 8.1.0.22.20230228 64bit (built Feb 28 2023)) with ESMTPSA id <0RW000BDY8IYUF00@rn-mailsvcp-mmp-lapp04.rno.apple.com>; Fri, 09 Jun 2023 14:18:34 -0700 (PDT)
From: Phillip Tao <ptao@apple.com>
Message-id: <43061B0C-8DCF-42EE-8E7D-69C251538618@apple.com>
Content-type: multipart/alternative; boundary="Apple-Mail=_AF8C5E76-F5A7-430C-B093-CE1E21CF4932"
MIME-version: 1.0 (Mac OS X Mail 16.0 \(3731.600.3\))
Date: Fri, 09 Jun 2023 14:18:33 -0700
In-reply-to: <f801ffdd-a4ef-8f43-8d0c-076332df2040@isode.com>
Cc: extra@ietf.org
To: Alexey Melnikov <alexey.melnikov@isode.com>
References: <00770A87-789E-4477-87F2-3EC059EE01FE@apple.com> <f801ffdd-a4ef-8f43-8d0c-076332df2040@isode.com>
X-Mailer: Apple Mail (2.3731.600.3)
Archived-At: <https://mailarchive.ietf.org/arch/msg/extra/G3PI712S5hDgGpuSzCBPcNGAcLk>
Subject: Re: [Extra] I-D Action: draft-ietf-extra-imap-messagelimit-03.txt
X-BeenThere: extra@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Email mailstore and eXtensions To Revise or Amend <extra.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/extra>, <mailto:extra-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/extra/>
List-Post: <mailto:extra@ietf.org>
List-Help: <mailto:extra-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/extra>, <mailto:extra-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 09 Jun 2023 21:18:40 -0000

Hi Alexey,

Thanks for the response. More comments inline.

- Phillip

> On Jun 9, 2023, at 10:39 AM, Alexey Melnikov <alexey.melnikov@isode.com> wrote:
> 
> Hi Phillip,
> 
>> On 25 May 2023, at 23:10, Phillip Tao <ptao=40apple.com@dmarc.ietf.org> <mailto:ptao=40apple.com@dmarc.ietf.org> wrote:
>> 
>> What is the expected outcome for clients which do not support this extension? The Introduction states:
>> 
>> > This extension is compatible with both IMAP4rev1 [RFC3501] and IMAP4rev2 [RFC9051].
>> 
>> But "always return NO" seems like a very loose definition of "compatible".
> You have a point, but this only relates to COPY/UID COPY command.

Yes, I could've worded this better. However, I think even this is may lead to issues. Some clients may not have implemented IMAP4 (or RFC 6851 MOVE), and may still be relying on COPY + UID STORE DELETED + EXPUNGE for move operations. Such clients, given that they haven't even implemented support for MOVE, seem unlikely to implement support for this extension. Then, this may well break the ability for them to do bulk operations (perhaps in the worst case, leading to repeated attempts to perform the same action [on the assumption that the NO is a transient server error]).

This is somewhat mitigated by the fact that they may never sync more than N messages, due to the limits for SEARCH and FETCH. However, that's not reliable, because they may have a batched syncing strategy but not a batched COPY strategy.

The above obviously requires a very specific set of client behaviors, and I'm not sure what percentage of clients would fall into that bucket. However, disregarding any quantitative measure of real world impact, this seems to depart philosophically from previous IMAP extensions. To my knowledge (which is admittedly limited), it seems like all previous extensions have strived to maintain complete backwards compatibility, such that clients/servers which do not support it would experience no change in behavior when talking to a client/server that does support it.

>> I can't think of any similar IMAP extensions in the past which radically alters server behavior without having the client explicitly opting in to it (either by using new commands/new command parameters, or by requiring an ENABLE).
> This is true. What this is trying to say is that this extension can be advertised by both IMAP4rev1 and IMAP4rev2 servers.
>> Clients may not be able to adopt this extension for some time, and some clients may never adopt it (either due to an explicit decision not to, or due to that client or client version no longer being actively maintained). Those clients will therefore be unable to communicate successfully with any server which has implemented this extension.
> I don't think what you are describing above is completely correct. I think what would happen with clients that don't specially handle this extension would encounter one of the following (let's assume that the server advertises MESSAGELIMIT=N):
> 
> 1) If a specific mailbox is smaller than N, then the client would never observe MESSAGELIMIT response code, so it would not be affected.
> 
> 2) If a specific mailbox is larger than N, then the client would be limited to operating on at most N messages at a time. For example SEARCH and FETCH will return N most recent messages in the specified range.
> 
> The client would also be unable to copy more than N messages at a time. (But a client using MOVE will be able to move at most N messages.)
> 
> Does this help?
> 
> Several notes in relation to this:
> 
> 1) If N is small, this would make life very interesting for clients. I think the document should recommend which values are reasonable for servers to pick.
> 
> 2) I think some explanation along the lines of what I explained above should be added to the document to make it clearer what the intent is for casual readers. 
> 
To me, this seems like this has a very high potential to lead to unexpected client behavior for non-adopting clients. Because the MESSAGELIMIT is applied per-command, this seems likely to lead to inconsistencies between commands. For example, searching for UNSEEN UNDELETED messages may return more results than searching for UNSEEN or UNDELETED alone. This seems likely to cause confusion for clients for the flag state (or even existence) of certain UIDs.

It doesn't seem to be explicitly stated in RFC 9051 that I can find, but I imagine most existing clients assume that an OK for a SEARCH or FETCH means that all matching results were returned.

It's not hard to imagine cases where this may lead to unexpected data loss. For example, if a user has setup a rule (in a client which supports client-side rules) to "delete all read messages". That client may do a SEARCH UNSEEN, get back N messages that are UNSEEN, and assume all remaining messages are SEEN and proceed to delete them.
> 
>> I see that version 1 of this draft did require an ENABLE, but that was subsequently removed in version 2. From the mailing list archive, it seems like there may have been some discussion in person at IETF 115 which led to this, but unfortunately the reasoning was not captured in the mailing list. Can you shed more light on why the newer versions have moved away from requiring an explicit ENABLE?
> Basically MESSAGELIMIT conveys a server limitation. There is no way for clients to opt out of it, so using ENABLE doesn't work. And the idea here is to make sure that clients using 1:* in various IMAP commands still need to be subject to the server limit.
> 
I understand the motivation for this. I also understand that this is largely for the benefit of the server, and therefore clients have little incentive to ENABLE it, so to some extent, it must be "imposed". However, I'm just concerned that it's not being imposed in a "safe" way for non-adopting clients.

Have other approaches been discussed to solve this problem? A couple ideas:

* Have this be an ENABLE-able extension. Non-ENABLEing clients face strict throttling.
* Rather than limiting per command, impose a mailbox-wide limit. Meaning that only the largest N UIDs in each given mailbox would be exposed to the client at all (whether for EXISTS, FETCH, etc.). Searches would then return the subset of those N messages which fulfill the search criteria. This would be a larger change and touching many other commands/responses not covered by this current draft, and would be more limiting for adopting clients, but would present a more consistent view and therefore be safer for non-adopting clients.
> When a server returns the MESSAGELIMIT capability, clients can at least discover the server limitation.
> 
Clients can discover the limitation if they've been updated to do so. Not all clients may be able to, and I'm still not clear how we expect those clients to behave.
> Best Regards,
> 
> Alexey
> 
>> 
>> - Phillip
>> 
>>> On May 17, 2023, at 5:45 AM, Alexey Melnikov <alexey.melnikov@isode.com> <mailto:alexey.melnikov@isode.com> wrote:
>>> 
>>> Hi all,
>>> 
>>> On 17/05/2023 13:42, internet-drafts@ietf.org <mailto:internet-drafts@ietf.org> wrote:
>>>> A New Internet-Draft is available from the on-line Internet-Drafts
>>>> directories. This Internet-Draft is a work item of the Email mailstore and
>>>> eXtensions To Revise or Amend (EXTRA) WG of the IETF.
>>>> 
>>>>    Title           : IMAP MESSAGELIMIT Extension
>>>>    Authors         : Alexey Melnikov
>>>>                      Arun Prakash Achuthan
>>>>                      Vikram Nagulakonda
>>>>                      Luis Alves
>>>>    Filename        : draft-ietf-extra-imap-messagelimit-03.txt
>>>>    Pages           : 9
>>>>    Date            : 2023-05-17
>>>> 
>>>> Abstract:
>>>>    The MESSAGELIMIT extension of the Internet Message Access Protocol
>>>>    (RFC 3501/RFC 9051) allows servers to announce a limit on the number
>>>>    of messages that can be processed in a single
>>>>    FETCH/SEARCH/STORE/COPY/MOVE command.  This helps servers to control
>>>>    resource usage when performing various IMAP operations.
>>> 
>>> This version addes UIDAFTER and UIDBEFORE SEARCH keys.
>>> 
>>> If people are happy with their inclusion, I think this is ready for WGLC.
>>> 
>>> Best Regards,
>>> 
>>> Alexey
>>> 
>>> _______________________________________________
>>> Extra mailing list
>>> Extra@ietf.org <mailto:Extra@ietf.org>
>>> https://www.ietf.org/mailman/listinfo/extra
>>