7Internet Engineering Task Force (IETF) A. Melnikov
8Request for Comments: 5819 Isode Limited
9Category: Standards Track T. Sirainen
10ISSN: 2070-1721 Unaffiliated
14 IMAP4 Extension for Returning STATUS Information in Extended LIST
18 Many IMAP clients display information about total number of
19 messages / total number of unseen messages in IMAP mailboxes. In
20 order to do that, they are forced to issue a LIST or LSUB command and
21 to list all available mailboxes, followed by a STATUS command for
22 each mailbox found. This document provides an extension to LIST
23 command that allows the client to request STATUS information for
24 mailboxes together with other information typically returned by the
29 This is an Internet Standards Track document.
31 This document is a product of the Internet Engineering Task Force
32 (IETF). It represents the consensus of the IETF community. It has
33 received public review and has been approved for publication by the
34 Internet Engineering Steering Group (IESG). Further information on
35 Internet Standards is available in Section 2 of RFC 5741.
37 Information about the current status of this document, any errata,
38 and how to provide feedback on it may be obtained at
39 http://www.rfc-editor.org/info/rfc5819.
43 Copyright (c) 2010 IETF Trust and the persons identified as the
44 document authors. All rights reserved.
46 This document is subject to BCP 78 and the IETF Trust's Legal
47 Provisions Relating to IETF Documents
48 (http://trustee.ietf.org/license-info) in effect on the date of
49 publication of this document. Please review these documents
50 carefully, as they describe your rights and restrictions with respect
51 to this document. Code Components extracted from this document must
52 include Simplified BSD License text as described in Section 4.e of
53 the Trust Legal Provisions and are provided without warranty as
54 described in the Simplified BSD License.
58Melnikov & Sirainen Standards Track [Page 1]
60RFC 5819 TITLE* March 2010
65 1. Introduction ....................................................2
66 1.1. Conventions Used in This Document ..........................2
67 2. STATUS Return Option to LIST Command ............................2
68 3. Examples ........................................................3
69 4. Formal Syntax ...................................................4
70 5. Security Considerations .........................................4
71 6. IANA Considerations .............................................4
72 7. Acknowledgements ................................................5
73 8. Normative References ............................................5
77 Many IMAP clients display information about the total number of
78 messages / total number of unseen messages in IMAP mailboxes. In
79 order to do that, they are forced to issue a LIST or LSUB command and
80 to list all available mailboxes, followed by a STATUS command for
81 each mailbox found. This document provides an extension to LIST
82 command that allows the client to request STATUS information for
83 mailboxes together with other information typically returned by the
861.1. Conventions Used in This Document
88 In examples, "C:" indicates lines sent by a client that is connected
89 to a server. "S:" indicates lines sent by the server to the client.
91 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
92 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
93 document are to be interpreted as described in RFC 2119 [Kwds].
97 [RFC3501] explicitly disallows mailbox patterns in the STATUS
98 command. The main reason was to discourage frequent use of the
99 STATUS command by clients, as it might be quite expensive for an IMAP
100 server to perform. However, this prohibition had resulted in an
101 opposite effect: a new generation of IMAP clients appeared, that
102 issues a STATUS command for each mailbox returned by the LIST
103 command. This behavior is suboptimal to say at least. It wastes
104 extra bandwidth and, in the case of a client that doesn't support
105 IMAP pipelining, also degrades performance by using too many round
106 trips. This document tries to remedy the situation by specifying a
107 single command that can be used by the client to request all the
108 necessary information. In order to achieve this goal, this document
109 is extending the LIST command with a new return option, STATUS. This
110 option takes STATUS data items as parameters. For each selectable
114Melnikov & Sirainen Standards Track [Page 2]
116RFC 5819 TITLE* March 2010
119 mailbox matching the list pattern and selection options, the server
120 MUST return an untagged LIST response followed by an untagged STATUS
121 response containing the information requested in the STATUS return
124 If an attempted STATUS for a listed mailbox fails because the mailbox
125 can't be selected (e.g., if the "l" ACL right [ACL] is granted to the
126 mailbox and the "r" right is not granted, or due to a race condition
127 between LIST and STATUS changing the mailbox to \NoSelect), the
128 STATUS response MUST NOT be returned and the LIST response MUST
129 include the \NoSelect attribute. This means the server may have to
130 buffer the LIST reply until it has successfully looked up the
131 necessary STATUS information.
133 If the server runs into unexpected problems while trying to look up
134 the STATUS information, it MAY drop the corresponding STATUS reply.
135 In such a situation, the LIST command would still return a tagged OK
140 C: A01 LIST "" % RETURN (STATUS (MESSAGES UNSEEN))
141 S: * LIST () "." "INBOX"
142 S: * STATUS "INBOX" (MESSAGES 17 UNSEEN 16)
143 S: * LIST () "." "foo"
144 S: * STATUS "foo" (MESSAGES 30 UNSEEN 29)
145 S: * LIST (\NoSelect) "." "bar"
146 S: A01 OK List completed.
148 The "bar" mailbox isn't selectable, so it has no STATUS reply.
150 C: A02 LIST (SUBSCRIBED RECURSIVEMATCH)"" % RETURN (STATUS
152 S: * LIST (\Subscribed) "." "INBOX"
153 S: * STATUS "INBOX" (MESSAGES 17)
154 S: * LIST () "." "foo" (CHILDINFO ("SUBSCRIBED"))
155 S: A02 OK List completed.
157 The LIST reply for "foo" is returned because it has matching
158 children, but no STATUS reply is returned because "foo" itself
159 doesn't match the selection criteria.
170Melnikov & Sirainen Standards Track [Page 3]
172RFC 5819 TITLE* March 2010
177 The following syntax specification uses the augmented Backus-Naur
178 Form (BNF) as described in [ABNF]. Terms not defined here are taken
179 from [RFC3501] and [LISTEXT].
183 status-option = "STATUS" SP "(" status-att *(SP status-att) ")"
184 ;; This ABNF production complies with
185 ;; <option-extension> syntax.
1875. Security Considerations
189 This extension makes it a bit easier for clients to overload the
190 server by requesting STATUS information for a large number of
191 mailboxes. However, as already noted in the introduction, existing
192 clients already try to do that by generating a large number of STATUS
193 commands for each mailbox in which they are interested. While
194 performing STATUS information retrieval for big lists of mailboxes, a
195 server implementation needs to make sure that it can still serve
196 other IMAP connections and yield execution to other connections, when
1996. IANA Considerations
201 IMAP4 capabilities are registered by publishing a Standards Track or
202 IESG-approved Experimental RFC. The "IMAP 4 Capabilities" registry
203 is available from the IANA webiste:
207 This document defines the LIST-STATUS IMAP capability. IANA has
208 added it to the registry.
210 IANA has also added the following new LIST-EXTENDED option to the
211 IANA registry established by [LISTEXT]:
214 Subject: Registration of LIST-EXTENDED option STATUS
216 LIST-EXTENDED option name: STATUS
218 LIST-EXTENDED option type: RETURN
220 LIST-EXTENDED option description: Causes the LIST command to return
221 STATUS responses in addition to LIST responses.
226Melnikov & Sirainen Standards Track [Page 4]
228RFC 5819 TITLE* March 2010
231 Published specification: RFC 5819
233 Security considerations: RFC 5819
235 Intended usage: COMMON
237 Person and email address to contact for further information:
238 Alexey Melnikov <Alexey.Melnikov@isode.com>
240 Owner/Change controller: iesg@ietf.org
244 Thanks to Philip Van Hoof who pointed out that STATUS and LIST
245 commands should be combined in order to optimize traffic and number
2488. Normative References
250 [ABNF] Crocker, D., Ed., and P. Overell, "Augmented BNF for
251 Syntax Specifications: ABNF", STD 68, RFC 5234, January
254 [ACL] Melnikov, A., "IMAP4 Access Control List (ACL) Extension",
255 RFC 4314, December 2005.
257 [Kwds] Bradner, S., "Key words for use in RFCs to Indicate
258 Requirement Levels", BCP 14, RFC 2119, March 1997.
260 [LISTEXT] Leiba, B. and A. Melnikov, "Internet Message Access
261 Protocol version 4 - LIST Command Extensions", RFC 5258,
264 [RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION
265 4rev1", RFC 3501, March 2003.
282Melnikov & Sirainen Standards Track [Page 5]
284RFC 5819 TITLE* March 2010
291 5 Castle Business Village
293 Hampton, Middlesex TW12 2BX
296 EMail: Alexey.Melnikov@isode.com
297 URI: http://www.melnikov.ca/
338Melnikov & Sirainen Standards Track [Page 6]