The IMAP APPENDLIMIT Extension
Extracted elements (15)
Computing the APPENDLIMIT should be fast and must not take ACLs, quotas, or other dynamic policy into account. The APPENDLIMIT is a static policy hint; APPEND may still fail for ACL or quota reasons even when the message is within the limit.
The extension was motivated by mobile device resource consumption: non-synchronizing literals caused IMAP clients to transmit large attachments before receiving a rejection, wasting battery and mobile data when the server's upload limit was not known in advance.
An IMAP client implementing this extension should be able to parse both mailbox-specific (per-mailbox STATUS/LIST responses) and global (CAPABILITY response) APPENDLIMIT forms, as servers may use either.
If the server does not support the STATUS return option on the LIST command, the client should fall back to issuing individual STATUS commands per mailbox to obtain APPENDLIMIT values.
A client SHOULD avoid use of non-synchronizing literals (RFC 7888) when the maximum upload size supported by the IMAP server is unknown, to prevent wasting bandwidth and device resources on a doomed APPEND.
If a client uploads a message that exceeds the maximum upload size for a mailbox, the server SHALL reject the APPEND command with a tagged TOOBIG response code as defined in RFC 4469.
The IMAP server MUST recognize the APPENDLIMIT attribute in a LIST command with a STATUS return option and include an appropriate STATUS response for each matching mailbox.
A new APPENDLIMIT attribute is added to the STATUS command, allowing clients to retrieve the maximum upload size for a specific mailbox. The server returns 'APPENDLIMIT <number>' or 'APPENDLIMIT NIL' (no limit) in the STATUS response.
APPENDLIMIT=<number> in the capability list indicates a single upload limit in octets applied uniformly to all mailboxes. A value of 0 means the server will not accept any APPEND commands at all for affected mailboxes.
APPENDLIMIT without a value in the capability list signals that per-mailbox limits apply; the client must query each mailbox individually via STATUS or LIST to determine its specific limit.
The APPENDLIMIT extension is advertised in the CAPABILITY response as either 'APPENDLIMIT=<number>' (global limit for all mailboxes) or 'APPENDLIMIT' without a value (per-mailbox limits discoverable via STATUS or LIST).
When the server supports LIST-STATUS (RFC 5819), the client may issue a LIST command with 'RETURN (STATUS (APPENDLIMIT))' to retrieve per-mailbox APPENDLIMIT values in a single round trip.
IANA has added 'APPENDLIMIT' to the 'IMAP Capabilities' registry, referencing RFC 7889 as the defining document.
The APPENDLIMIT extension provides only an optimization hint for cooperative clients and does not introduce new security concerns. It does not protect against abusive clients intentionally consuming server resources; servers must still disconnect or restrict such clients independently.
The ABNF extends 'capability' to include 'APPENDLIMIT' optionally followed by '=' and a number. 'status-att' gains 'APPENDLIMIT', and 'status-att-val' gains 'APPENDLIMIT SP (number / nil)' where number is the maximum size in octets.