RFC 8438
IMAP Extension for STATUS=SIZE
Internet Engineering Task Force (IETF) ๐ RFC 8438: IMAP Extension for STATUS=SIZE โจ
Okay bestie, so this is an IETF Standards Track doc ๐ from August 2018, written by Stephan Bosch of Dovecot Oy ๐ฆ. It's an official IETF Proposed Standard-level product, approved by the IESG, and it doesn't obsolete or update any other RFCs ๐ธ. Sweet and simple!
Abstract โจ
Okay so this doc adds a new capability called "STATUS=SIZE" to IMAP ๐. The whole point is that you can get a mailbox's total storage size with ONE STATUS command, instead of fetching and adding up the size of every single message in it ๐ง. Main character efficiency. ๐
Status of This Memo ๐
This is an Internet Standards Track doc ๐. It's a product of the IETF, it reflects the consensus of the IETF community, got public review, and was approved by the IESG ๐. If you want more on Internet Standards, check Section 2 of RFC 7841 ๐ฆ.
Info about the current status, errata, and feedback is at https://www.rfc-editor.org/info/rfc8438 ๐ธ.
Copyright Notice ๐
Copyright (c) 2018 IETF Trust and the document authors. All rights reserved ๐ . This doc is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) as they were on the publication date, so read those carefully bestie, they explain your rights ๐. Any code pulled out of this doc has to include Simplified BSD License text (Section 4.e of the Trust Legal Provisions) and comes with no warranty ๐ซถ.
Table of Contents ๐ง
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
2. Conventions Used in This Document . . . . . . . . . . . . . . 3
3. STATUS Command and Response Extensions . . . . . . . . . . . 3
4. Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . . 5
5. Security Considerations . . . . . . . . . . . . . . . . . . . 5
6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5
7. Normative References . . . . . . . . . . . . . . . . . . . . 5
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 6
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 6
1. Introduction ๐ฆ
Okay so this doc extends IMAP [IMAP4rev1] with the new "STATUS=SIZE" capability ๐. Right now, if a client wants a mailbox's total size, it has to grab every message size one at a time using FETCH with the RFC822.SIZE data item ๐ญ. Ew. STATUS=SIZE is the upgrade: it adds a new "SIZE" data item to STATUS, which gives the total size of all messages in the target mailbox, so you only need ONE STATUS command ๐งโจ. When LIST-STATUS [LIST-STATUS] is also around, you can grab SIZE for a bunch of mailboxes at once with just one LIST command ๐ฅ.
This is super useful for clients that don't cache the state of the message store, like most webmail clients ๐ป. Without this capability, those clients have to fetch every message size from the server whenever they need one mailbox's size ๐ฅฒ. Picture a user who wants detailed quota usage for each mailbox to see which ones are hogging storage ๐. With that info they can see which mailboxes need a cleanup to lower their quota usage ๐งน. The QUOTA capability [QUOTA] doesn't help here, because QUOTAROOT only reports STORAGE usage for a whole quota root, not for each mailbox inside it ๐.
2. Conventions Used in This Document ๐ธ
In the examples, "C:" marks lines sent by a client connected to a server, and "S:" marks lines sent by the server to the client ๐ .
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this doc are read as BCP 14 [KEYWORDS] [KEYWORDS2] ONLY when they're in all capitals like shown here ๐. Lowercase is just normal English, bestie ๐ซถ.
3. STATUS Command and Response Extensions ๐
This extension defines ONE new status data item for the STATUS command and response ๐:
SIZE ๐
The total size of the mailbox in octets ๐ฆ. It doesn't have to be an exact value, but it MUST be equal to or greater than the sum of the RFC822.SIZE FETCH message data item [IMAP4rev1] of all messages in the mailbox ๐งฎ. If QUOTA [QUOTA] is also supported, this value SHOULD be equal to the storage usage value used to enforce the STORAGE resource limit for this mailbox ๐ . That way, the client can directly infer the quota usage ๐ง.
Since a mailbox's total storage size can easily go over 4 GB ๐ณ, clients MUST be able to receive 63-bit SIZE data item values ๐ช. The message size is capped at 63 bits instead of 64 to make implementations on various platforms (like Java) easier ๐.
Example:
C: A01 STATUS frop (MESSAGES SIZE UIDNEXT)
S: * STATUS frop (MESSAGES 8 SIZE 44421 UIDNEXT 242344)
S: A01 OK STATUS completed
The same info can be gotten using the following commands, albeit less efficiently ๐:
C: A02 SELECT "frop"
S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
S: * 8 EXISTS
S: * 1 RECENT
S: * OK [UNSEEN 7] First unseen.
S: * OK [UIDVALIDITY 1364851417] UIDs valid
S: * OK [UIDNEXT 242344] Predicted next UID
S: * OK [HIGHESTMODSEQ 3914] Highest
S: A02 OK [READ-WRITE] Select completed.
C: A03 FETCH 1:* (RFC822.SIZE)
S: * 1 FETCH (RFC822.SIZE 3224)
S: * 2 FETCH (RFC822.SIZE 1222)
S: * 3 FETCH (RFC822.SIZE 444)
S: * 4 FETCH (RFC822.SIZE 4516)
S: * 5 FETCH (RFC822.SIZE 544)
S: * 6 FETCH (RFC822.SIZE 922)
S: * 7 FETCH (RFC822.SIZE 31126)
S: * 8 FETCH (RFC822.SIZE 2423)
S: A03 OK Fetch completed.
When LIST-STATUS [LIST-STATUS] is also available, STATUS can be combined with LIST to be even more efficient ๐ฅ. That means you can get the sizes of many mailboxes with just one LIST command ๐ง.
Example:
C: A04 LIST "" % RETURN (STATUS (MESSAGES SIZE))
S: * LIST () "." "INBOX"
S: * STATUS "INBOX" (MESSAGES 17 SIZE 16234)
S: * LIST () "." "frop"
S: * STATUS "frop" (MESSAGES 8 SIZE 44421)
S: A04 OK List completed.
4. Formal Syntax ๐
This syntax spec augments the grammar in [IMAP4rev1] and [IMAP4-ABNF] ๐. It uses ABNF [ABNF] notation. Anything not defined here comes from [IMAP4rev1] and [IMAP4-ABNF] ๐ซถ.
capability =/ "STATUS=SIZE"
status-att =/ "SIZE"
status-att-val =/ "SIZE" SP number64
number64 = 1*DIGIT
; Unsigned 63-bit integer
; (0 <= n <= 9,223,372,036,854,775,807)
5. Security Considerations ๐
Okay, security time, and I'm being serious ๐ซข. There are no known additional security issues with this extension beyond the ones already described for the base protocol [IMAP4rev1] and the LIST-STATUS extension [LIST-STATUS] ๐ก๏ธ. Nothing new to panic about, but don't skip the base protocol's own security notes either ๐.
6. IANA Considerations ๐
IANA has added "STATUS=SIZE" to the "IMAP Capabilities" registry at <http://www.iana.org/assignments/imap-capabilities> ๐ฆ.
7. Normative References ๐
[ABNF] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax
Specifications: ABNF", STD 68, RFC 5234,
DOI 10.17487/RFC5234, January 2008,
<https://www.rfc-editor.org/info/rfc5234>.
[IMAP4-ABNF]
Melnikov, A. and C. Daboo, "Collected Extensions to IMAP4
ABNF", RFC 4466, DOI 10.17487/RFC4466, April 2006,
<https://www.rfc-editor.org/info/rfc4466>.
[IMAP4rev1]
Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION
4rev1", RFC 3501, DOI 10.17487/RFC3501, March 2003,
<https://www.rfc-editor.org/info/rfc3501>.
[KEYWORDS] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>.
[KEYWORDS2]
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>.
[LIST-STATUS]
Melnikov, A. and T. Sirainen, "IMAP4 Extension for
Returning STATUS Information in Extended LIST", RFC 5819,
DOI 10.17487/RFC5819, March 2010,
<https://www.rfc-editor.org/info/rfc5819>.
[QUOTA] Myers, J., "IMAP4 QUOTA extension", RFC 2087,
DOI 10.17487/RFC2087, January 1997,
<https://www.rfc-editor.org/info/rfc2087>.
Acknowledgements ๐ซถ
Huge thanks to Bron Gondwana, Alexey Melnikov, Stan Kalisch, and Michael Slusarz for reviews and suggestions ๐.
Author's Address ๐ฆ
Stephan Bosch Dovecot Oy Lars Sonckin Kaari 12 Espoo 02600 Finland
Email: stephan.bosch@dovecot.fi ๐
๐ฆ where this page comes from
- ietf: rfc8438 2018-08
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms