RFC 7889

The IMAP APPENDLIMIT Extension

πŸ“… published May 2016, from ietf

Part 1 of 2 🌈

RFC 7889: The IMAP APPENDLIMIT Extension ✨

Okay bestie, let's do the header stuff first πŸ’… This is RFC 7889, called The IMAP APPENDLIMIT Extension. It's a Standards Track doc, so it's an actual Internet standard and not just vibes. It was written by J. Srimushnam Boovaraghamoorthy and N. Bisht from Samsung Electronics America, and it came out in May 2016. Its ISSN is 2070-1721. The header doesn't list anything it obsoletes or updates πŸŽ€

Abstract πŸ¦‹

Okay so the big idea is that this doc adds an extension to IMAP where a server can tell the client the biggest message it'll accept for upload. That way the client doesn't waste time sending APPEND commands that are gonna fail because the message is too chonky 🐳

Status of This Memo πŸ“œ

This is an Internet Standards Track document πŸ’–

This doc is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community, it went through public review, and the Internet Engineering Steering Group (IESG) approved it for publication. More info on Internet Standards is in Section 2 of RFC 5741.

If you want the current status, any errata, or a way to send feedback, check out http://www.rfc-editor.org/info/rfc7889 ✨

Copyright (c) 2016 IETF Trust and the persons identified as the document authors. All rights reserved.

This doc is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as they stood on the publication date. Please read those carefully, because they spell out your rights and restrictions for this doc. Code Components pulled out of this doc must include the Simplified BSD License text described in Section 4.e of the Trust Legal Provisions, and they come without warranty as described in the Simplified BSD License πŸ”₯

Table of Contents πŸ—‚οΈ

1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
  1.1.  Conventions . . . . . . . . . . . . . . . . . . . . . . .   2
2.  APPENDLIMIT Extension . . . . . . . . . . . . . . . . . . . .   3
3.  Mailbox-Specific APPENDLIMIT  . . . . . . . . . . . . . . . .   3
  3.1.  STATUS Response to the STATUS Command . . . . . . . . . .   4
  3.2.  STATUS Response to the LIST Command . . . . . . . . . . .   4
  3.3.  APPENDLIMIT Behavior  . . . . . . . . . . . . . . . . . .   4
4.  APPEND Response . . . . . . . . . . . . . . . . . . . . . . .   4
5.  Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . .   5
6.  Security Considerations . . . . . . . . . . . . . . . . . . .   5
7.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   5
8.  References  . . . . . . . . . . . . . . . . . . . . . . . . .   6
  8.1.  Normative References  . . . . . . . . . . . . . . . . . .   6
  8.2.  Informative References  . . . . . . . . . . . . . . . . .   6
Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . . .   7
Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .   7

1. Introduction 🌸

Some IMAP servers have upload size limits, and those limits aren't published to the email client. So when the client APPENDs a message with huge attachments using non-synchronizing literals, the APPEND fails because of the limit, but the client has already sent all the message data anyway. That's a lot of wasted resources 😭 Especially on mobile, uploading a message with huge attachments eats up device resources like battery power and mobile data.

The IMAP APPENDLIMIT extension lets a server advertise its maximum upload size, so the email client knows the limit ahead of time. Once you implement this extension, the server doesn't have to process huge attachments above the maximum upload size in the first place. It's giving efficiency πŸ¦‹

1.1. Conventions πŸ“–

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].

In examples, "C:" means lines sent by the client and "S:" means lines sent by the server. If a single "C:" or "S:" label covers multiple lines, the line breaks between them are just there for editorial clarity and aren't part of the actual protocol exchange 🧚


2. APPENDLIMIT Extension πŸŽ€

An IMAP server that supports the APPENDLIMIT extension says so by putting the name APPENDLIMIT in its capability list in the authenticated state. The server may also advertise this extension before the user has logged in. If the capability is left out, no info gets conveyed about the server's fixed maximum size for mail uploads. An IMAP server can publish the APPENDLIMIT capability in two formats πŸ’…

(a) APPENDLIMIT=<number>

This means the IMAP server has the same upload limit for all mailboxes. Here's an example of the APPENDLIMIT capability with one upload limit for everything:

C: t1 CAPABILITY
S: * CAPABILITY IMAP4rev1 ID APPENDLIMIT=257890
S: t1 OK foo

(b) APPENDLIMIT

Just APPENDLIMIT with no value means the IMAP server supports this extension, and the client will need to discover the upload limits for each mailbox, since they might differ from mailbox to mailbox. Here's an example of the value-less version:

C: t1 CAPABILITY
S: * CAPABILITY IMAP4rev1 ID APPENDLIMIT
S: t1 OK foo

In this case, the client can get an APPENDLIMIT value by issuing either a STATUS or a LIST command πŸ‘‘

An IMAP client implementing this extension should be able to parse both mailbox-specific and global APPENDLIMIT responses. By looking at the upload size the server advertises, a client can avoid trying to APPEND mail bigger than the advertised limit. Smart, right? 🧠


3. Mailbox-Specific APPENDLIMIT 🧚

An IMAP server can have mailbox-specific APPENDLIMIT values that won't be advertised as part of the CAPABILITY response. The server can publish a specific value for each mailbox, and it can publish "NIL" for a mailbox to convey that there's no APPENDLIMIT for that mailbox. The subsections below describe the changes to the STATUS and LIST commands that support this situation ✨

3.1. STATUS Response to the STATUS Command πŸ’…

There's a new attribute, APPENDLIMIT, that gets the limit the server has set for a mailbox as part of a STATUS command. An IMAP client should issue a STATUS command with an APPENDLIMIT item to get the mailbox-specific upload value. Here's how it looks:

C: t1 STATUS INBOX (APPENDLIMIT)
S: * STATUS INBOX (APPENDLIMIT 257890)
S: t1 OK STATUS completed

In the example above, APPENDLIMIT represents the maximum upload size for INBOX 🌸

3.2. STATUS Response to the LIST Command πŸ“

If the server advertises the LIST-STATUS capability [RFC5819], the client can issue a LIST command along with the STATUS return option to get the mailbox-specific upload value. Here's the example:

C: t1 LIST "" % RETURN (STATUS (APPENDLIMIT))
S: * LIST () "."  "INBOX"
S: * STATUS "INBOX" (APPENDLIMIT 257890)
S: t1 OK List completed.

The IMAP server MUST recognize the APPENDLIMIT attribute and include an appropriate STATUS response for each matching mailbox. Refer to Section 5 for the syntax.

If the server doesn't support the STATUS return option on the LIST command, then the client should use the STATUS command instead 🫢

3.3. APPENDLIMIT Behavior 🌈

Computing the APPENDLIMIT should be fast, and it should not take Access Control Lists (ACLs), quotas, or other stuff like that into account. The APPENDLIMIT is only one part of the policy, so an APPEND command can still fail because of ACL or quota issues, even if the message being appended is smaller than the APPENDLIMIT πŸ™ˆ


4. APPEND Response πŸ’–

If a client uploads a message that goes over the maximum upload size set for that mailbox, the server SHALL reject the APPEND command with a tagged TOOBIG response code. For the various APPEND response codes and how they're handled, refer to Section 4 of [RFC4469] πŸ”₯

A client SHOULD avoid using non-synchronizing literals [RFC7888] when the maximum upload size supported by the IMAP server is unknown. For how non-synchronizing literals work and the risk they pose to disconnected IMAP clients, see Section 4.2.2.3 of [RFC4549] πŸ‘€

8.2. Informative References πŸ“š

Okay, last stop on the reading list! πŸ“š These are the "good to know" references. The spec points at them, but you don't have to read them to follow along.

[RFC4549] Melnikov, A., Ed., "Synchronization Operations for Disconnected IMAP4 Clients", RFC 4549, DOI 10.17487/RFC4549, June 2006, <http://www.rfc-editor.org/info/rfc4549>.

Acknowledgements 🫢

Huge thank-you to Alexey Melnikov, Dave Cridland, Adrien de Croy, Michael M. Slusarz, Timo Sirainen, Chris Newman, Pete Maclean, Jamie Nicolson, Stu Brandt, Bron Gondwana, Arnt Gulbrandsen, Cyrus Daboo, Jan Kundrat, Brandon Long, and Barry Leiba for giving such valuable comments. The whole review squad was iconic and this spec is so much better because of them πŸ’–βœ¨


Authors' Addresses πŸŽ€

Jayantheesh SrimushnamBoovaraghamoorthy
Samsung Electronics America
685 US Highway 202/206
Bridgewater, NJ  08807
United States

Email: jayantheesh.sb@gmail.com


Narendra Singh Bisht
Samsung Electronics America
685 US Highway 202/206
Bridgewater, NJ  08807
United States

Email: narendrasingh.bisht@gmail.com

And that's the whole spec, bestie! πŸ’œπŸ¦‹

πŸ“¦ where this page comes from