IMAP Extension for STATUS=SIZE
Extracted elements (12)
The SIZE value is defined as a 63-bit integer rather than a 64-bit integer to simplify implementations on platforms such as Java, which do not natively support unsigned 64-bit integers.
The STATUS=SIZE extension was introduced because determining mailbox storage size previously required fetching all individual message sizes via FETCH RFC822.SIZE, which is expensive for clients that do not cache server state, such as webmail clients.
When both STATUS=SIZE and QUOTA are supported, the SIZE value SHOULD match the QUOTA STORAGE resource usage value to allow clients to infer quota consumption without issuing a separate QUOTAROOT command.
When the LIST-STATUS capability (RFC 5819) is also available, SIZE can be queried for many mailboxes at once using a single LIST command with RETURN (STATUS (SIZE)), greatly improving efficiency.
Clients MUST be capable of receiving 63-bit SIZE data item values, since the total storage size of a mailbox can easily exceed 4 GB.
The SIZE data item value MUST be equal to or greater than the sum of the RFC822.SIZE FETCH message data item values of all messages in the mailbox. It is not required to be an exact value.
When the QUOTA capability is also supported, the SIZE value SHOULD be equal to the storage usage value used to enforce the STORAGE resource limit for the mailbox, so clients can directly infer quota usage.
The STATUS=SIZE capability adds a new 'SIZE' status data item to the IMAP STATUS command and response. SIZE indicates the total storage size of all messages in the target mailbox in octets, enabling retrieval with a single STATUS command.
IANA has added 'STATUS=SIZE' to the 'IMAP Capabilities' registry at http://www.iana.org/assignments/imap-capabilities.
There are no known additional security issues with the STATUS=SIZE extension beyond those described for the base IMAP protocol (RFC 3501) and the LIST-STATUS extension (RFC 5819).
The capability string is 'STATUS=SIZE', added to the IMAP capability grammar as: capability =/ "STATUS=SIZE". The status attribute is added as: status-att =/ "SIZE".
The SIZE status attribute value is encoded as 'number64', defined as 1*DIGIT representing an unsigned 63-bit integer in the range 0 to 9,223,372,036,854,775,807. The grammar rule is: status-att-val =/ "SIZE" SP number64.