1 ../imapserver/server.go:148
2
3
4
5
6
7Internet Engineering Task Force (IETF) A. Melnikov
8Request for Comments: 5819 Isode Limited
9Category: Standards Track T. Sirainen
10ISSN: 2070-1721 Unaffiliated
11 March 2010
12
13
14 IMAP4 Extension for Returning STATUS Information in Extended LIST
15
16Abstract
17
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
25 LIST command.
26
27Status of This Memo
28
29 This is an Internet Standards Track document.
30
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.
36
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.
40
41Copyright Notice
42
43 Copyright (c) 2010 IETF Trust and the persons identified as the
44 document authors. All rights reserved.
45
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.
55
56
57
58Melnikov & Sirainen Standards Track [Page 1]
59
60RFC 5819 TITLE* March 2010
61
62
63Table of Contents
64
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
74
751. Introduction
76
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
84 LIST command.
85
861.1. Conventions Used in This Document
87
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.
90
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].
94
952. STATUS Return Option to LIST Command 9051:6613 9051:6915 9051:7072 9051:6821 ../imapserver/list.go:65
96
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
111
112
113
114Melnikov & Sirainen Standards Track [Page 2]
115
116RFC 5819 TITLE* March 2010
117
118
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
122 option.
123
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.
132
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
136 reply.
137
1383. Examples
139
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.
147
148 The "bar" mailbox isn't selectable, so it has no STATUS reply.
149
150 C: A02 LIST (SUBSCRIBED RECURSIVEMATCH)"" % RETURN (STATUS
151 (MESSAGES))
152 S: * LIST (\Subscribed) "." "INBOX"
153 S: * STATUS "INBOX" (MESSAGES 17)
154 S: * LIST () "." "foo" (CHILDINFO ("SUBSCRIBED"))
155 S: A02 OK List completed.
156
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.
160
161
162
163
164
165
166
167
168
169
170Melnikov & Sirainen Standards Track [Page 3]
171
172RFC 5819 TITLE* March 2010
173
174
1754. Formal Syntax
176
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].
180
181 return-option =/ status-option 9051:7072 ../imapserver/list.go:85
182
183 status-option = "STATUS" SP "(" status-att *(SP status-att) ")"
184 ;; This ABNF production complies with
185 ;; <option-extension> syntax.
186
1875. Security Considerations
188
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
197 necessary.
198
1996. IANA Considerations
200
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:
204
205 http://www.iana.org
206
207 This document defines the LIST-STATUS IMAP capability. IANA has
208 added it to the registry.
209
210 IANA has also added the following new LIST-EXTENDED option to the
211 IANA registry established by [LISTEXT]:
212
213 To: iana@iana.org
214 Subject: Registration of LIST-EXTENDED option STATUS
215
216 LIST-EXTENDED option name: STATUS
217
218 LIST-EXTENDED option type: RETURN
219
220 LIST-EXTENDED option description: Causes the LIST command to return
221 STATUS responses in addition to LIST responses.
222
223
224
225
226Melnikov & Sirainen Standards Track [Page 4]
227
228RFC 5819 TITLE* March 2010
229
230
231 Published specification: RFC 5819
232
233 Security considerations: RFC 5819
234
235 Intended usage: COMMON
236
237 Person and email address to contact for further information:
238 Alexey Melnikov <Alexey.Melnikov@isode.com>
239
240 Owner/Change controller: iesg@ietf.org
241
2427. Acknowledgements
243
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
246 of round trips.
247
2488. Normative References
249
250 [ABNF] Crocker, D., Ed., and P. Overell, "Augmented BNF for
251 Syntax Specifications: ABNF", STD 68, RFC 5234, January
252 2008.
253
254 [ACL] Melnikov, A., "IMAP4 Access Control List (ACL) Extension",
255 RFC 4314, December 2005.
256
257 [Kwds] Bradner, S., "Key words for use in RFCs to Indicate
258 Requirement Levels", BCP 14, RFC 2119, March 1997.
259
260 [LISTEXT] Leiba, B. and A. Melnikov, "Internet Message Access
261 Protocol version 4 - LIST Command Extensions", RFC 5258,
262 June 2008.
263
264 [RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION
265 4rev1", RFC 3501, March 2003.
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282Melnikov & Sirainen Standards Track [Page 5]
283
284RFC 5819 TITLE* March 2010
285
286
287Authors' Addresses
288
289 Alexey Melnikov
290 Isode Limited
291 5 Castle Business Village
292 36 Station Road
293 Hampton, Middlesex TW12 2BX
294 UK
295
296 EMail: Alexey.Melnikov@isode.com
297 URI: http://www.melnikov.ca/
298
299
300 Timo Sirainen
301
302 EMail: tss@iki.fi
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338Melnikov & Sirainen Standards Track [Page 6]
339
340