IMAP4 Extension for Returning STATUS Information in Extended LIST
Extracted elements (12)
RFC 3501 explicitly disallows mailbox patterns in the STATUS command to discourage frequent use, but this prohibition had the opposite effect: clients began issuing a STATUS command for each mailbox returned by LIST, wasting bandwidth and incurring extra round trips especially without pipelining. This extension remedies the situation by combining both into a single LIST command with a STATUS return option.
A mailbox that appears in a LIST response solely because it has matching children (e.g., via RECURSIVEMATCH) but does not itself match the selection criteria does not receive a STATUS reply, as illustrated in the second example where "foo" gets a LIST response with CHILDINFO but no STATUS response.
RFC 3501 explicitly disallows mailbox patterns in the STATUS command. Clients that do not advertise or recognize the LIST-STATUS capability must continue using the legacy LIST-then-STATUS-per-mailbox pattern; this extension is opt-in via capability advertisement.
For each selectable mailbox matching the list pattern and selection options, the server MUST return an untagged LIST response followed by an untagged STATUS response containing the information requested in the STATUS return option.
If an attempted STATUS for a listed mailbox fails because the mailbox cannot be selected (e.g., due to ACL rights or a race condition), the STATUS response MUST NOT be returned and the LIST response MUST include the \NoSelect attribute.
If the server runs into unexpected problems while trying to look up the STATUS information, it MAY drop the corresponding STATUS reply; in such a situation, the LIST command would still return a tagged OK reply.
The server may have to buffer the LIST reply until it has successfully looked up the necessary STATUS information, to ensure the \NoSelect attribute can be included when STATUS retrieval fails.
The STATUS return option extends the IMAP LIST command (as defined by the LIST-EXTENDED framework in RFC 5258) to request STATUS data items alongside normal LIST responses. The option takes one or more status-att items as parameters.
This document registers the LIST-EXTENDED return option named STATUS in the IANA LIST-EXTENDED options registry (established by RFC 5258). The option type is RETURN, intended usage is COMMON, and it causes LIST to return STATUS responses alongside LIST responses.
This document registers the LIST-STATUS capability in the IANA 'IMAP 4 Capabilities' registry, indicating server support for the STATUS return option on the LIST command.
The extension makes it easier for clients to overload the server by requesting STATUS information for a large number of mailboxes in a single command. Server implementations must ensure they can still serve other IMAP connections and yield execution to other connections when necessary during large STATUS retrievals.
The ABNF production 'status-option' is defined as: "STATUS" SP "(" status-att *(SP status-att) ")", and is added to 'return-option' via the extension production 'return-option =/ status-option'. This complies with the option-extension syntax from RFC 5258.