1 9051:8024 ../imapserver/server.go:156
2
3
4
5
6
7Internet Engineering Task Force (IETF) S. Bosch
8Request for Comments: 8438 Dovecot Oy
9Category: Standards Track August 2018
10ISSN: 2070-1721
11
12
13 IMAP Extension for STATUS=SIZE
14
15Abstract
16
17 This document adds a new capability called "STATUS=SIZE" to the
18 Internet Message Access Protocol (IMAP). It allows retrieving the
19 total storage size of a mailbox with a single STATUS command rather
20 than retrieving and summing the sizes of all individual messages in
21 that mailbox.
22
23Status of This Memo
24
25 This is an Internet Standards Track document.
26
27 This document is a product of the Internet Engineering Task Force
28 (IETF). It represents the consensus of the IETF community. It has
29 received public review and has been approved for publication by the
30 Internet Engineering Steering Group (IESG). Further information on
31 Internet Standards is available in Section 2 of RFC 7841.
32
33 Information about the current status of this document, any errata,
34 and how to provide feedback on it may be obtained at
35 https://www.rfc-editor.org/info/rfc8438.
36
37Copyright Notice
38
39 Copyright (c) 2018 IETF Trust and the persons identified as the
40 document authors. All rights reserved.
41
42 This document is subject to BCP 78 and the IETF Trust's Legal
43 Provisions Relating to IETF Documents
44 (https://trustee.ietf.org/license-info) in effect on the date of
45 publication of this document. Please review these documents
46 carefully, as they describe your rights and restrictions with respect
47 to this document. Code Components extracted from this document must
48 include Simplified BSD License text as described in Section 4.e of
49 the Trust Legal Provisions and are provided without warranty as
50 described in the Simplified BSD License.
51
52
53
54
55
56
57
58Bosch Standards Track [Page 1]
59
60RFC 8438 IMAP STATUS=SIZE Extension August 2018
61
62
63Table of Contents
64
65 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
66 2. Conventions Used in This Document . . . . . . . . . . . . . . 3
67 3. STATUS Command and Response Extensions . . . . . . . . . . . 3
68 4. Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . . 5
69 5. Security Considerations . . . . . . . . . . . . . . . . . . . 5
70 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5
71 7. Normative References . . . . . . . . . . . . . . . . . . . . 5
72 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 6
73 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 6
74
751. Introduction
76
77 This document extends the Internet Message Access Protocol (IMAP)
78 [IMAP4rev1] with a new capability called "STATUS=SIZE". To determine
79 the total storage size of a mailbox, an IMAP client currently needs
80 to retrieve all message sizes individually using the FETCH command
81 with the RFC822.SIZE data item. The STATUS=SIZE capability provides
82 a more efficient means of achieving this. It extends the STATUS
83 command with a new "SIZE" data item, which indicates the total size
84 of all messages in the target mailbox. This way, this information
85 can be queried with just one STATUS command. When the LIST-STATUS
86 IMAP capability [LIST-STATUS] is also available, the SIZE data item
87 can be queried for many mailboxes at once using just one LIST
88 command.
89
90 This capability is particularly useful for IMAP clients that do not
91 cache the state of the message store, such as most webmail clients.
92 Without the "STATUS=SIZE" capability, such clients need to fetch all
93 message sizes from the server when the size of an individual mailbox
94 needs to be determined. For example, a user may request detailed
95 quota usage information for each mailbox to find out which specific
96 mailboxes consume most of the available storage resources. Using
97 this information, the user can get an overview of which mailboxes
98 need to be cleaned up to reduce quota usage. The QUOTA capability
99 [QUOTA] is no help in that scenario, since the provided QUOTAROOT
100 command can only yield the STORAGE resource usage of a whole quota
101 root, not each individual mailbox within that root.
102
103
104
105
106
107
108
109
110
111
112
113
114Bosch Standards Track [Page 2]
115
116RFC 8438 IMAP STATUS=SIZE Extension August 2018
117
118
1192. Conventions Used in This Document
120
121 In examples, "C:" indicates lines sent by a client that is connected
122 to a server. "S:" indicates lines sent by the server to the client.
123
124 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
125 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
126 "OPTIONAL" in this document are to be interpreted as described in
127 BCP 14 [KEYWORDS] [KEYWORDS2] when, and only when, they appear in all
128 capitals, as shown here.
129
1303. STATUS Command and Response Extensions
131
132 This extension defines one new status data item for the STATUS
133 command and response:
134
135 SIZE
136 The total size of the mailbox in octets. This is not strictly
137 required to be an exact value, but it MUST be equal to or greater
138 than the sum of the values of the RFC822.SIZE FETCH message data
139 item [IMAP4rev1] of all messages in the mailbox. When the QUOTA
140 capability [QUOTA] is also supported, this value SHOULD be equal
141 to the storage usage value used to enforce the STORAGE resource
142 limit for this mailbox. This way, the client can directly infer
143 the quota usage.
144
145 Since the total storage size of a mailbox can easily exceed 4 GB,
146 clients MUST be capable of receiving 63-bit SIZE data item values.
147 The message size is chosen to be at most 63 bits wide rather than 64
148 bits to make implementations on various platforms (such as Java)
149 easier.
150
151 Example:
152
153 C: A01 STATUS frop (MESSAGES SIZE UIDNEXT)
154 S: * STATUS frop (MESSAGES 8 SIZE 44421 UIDNEXT 242344)
155 S: A01 OK STATUS completed
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170Bosch Standards Track [Page 3]
171
172RFC 8438 IMAP STATUS=SIZE Extension August 2018
173
174
175 The same information can be obtained by using the following commands,
176 albeit less efficiently:
177
178 C: A02 SELECT "frop"
179 S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
180 S: * 8 EXISTS
181 S: * 1 RECENT
182 S: * OK [UNSEEN 7] First unseen.
183 S: * OK [UIDVALIDITY 1364851417] UIDs valid
184 S: * OK [UIDNEXT 242344] Predicted next UID
185 S: * OK [HIGHESTMODSEQ 3914] Highest
186 S: A02 OK [READ-WRITE] Select completed.
187 C: A03 FETCH 1:* (RFC822.SIZE)
188 S: * 1 FETCH (RFC822.SIZE 3224)
189 S: * 2 FETCH (RFC822.SIZE 1222)
190 S: * 3 FETCH (RFC822.SIZE 444)
191 S: * 4 FETCH (RFC822.SIZE 4516)
192 S: * 5 FETCH (RFC822.SIZE 544)
193 S: * 6 FETCH (RFC822.SIZE 922)
194 S: * 7 FETCH (RFC822.SIZE 31126)
195 S: * 8 FETCH (RFC822.SIZE 2423)
196 S: A03 OK Fetch completed.
197
198 When the LIST-STATUS IMAP capability [LIST-STATUS] is also available,
199 the STATUS command can be combined with the LIST command to further
200 improve efficiency. This way, the sizes of many mailboxes can be
201 queried with just one LIST command.
202
203 Example:
204
205 C: A04 LIST "" % RETURN (STATUS (MESSAGES SIZE))
206 S: * LIST () "." "INBOX"
207 S: * STATUS "INBOX" (MESSAGES 17 SIZE 16234)
208 S: * LIST () "." "frop"
209 S: * STATUS "frop" (MESSAGES 8 SIZE 44421)
210 S: A04 OK List completed.
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226Bosch Standards Track [Page 4]
227
228RFC 8438 IMAP STATUS=SIZE Extension August 2018
229
230
2314. Formal Syntax
232
233 The following syntax specification augments the grammar specified in
234 [IMAP4rev1] and [IMAP4-ABNF]. It uses the Augmented Backus-Naur Form
235 (ABNF) notation as specified in [ABNF]. Elements not defined here
236 are taken from [IMAP4rev1] and [IMAP4-ABNF].
237
238 capability =/ "STATUS=SIZE"
239
240 status-att =/ "SIZE"
241
242 status-att-val =/ "SIZE" SP number64
243
244 number64 = 1*DIGIT
245 ; Unsigned 63-bit integer
246 ; (0 <= n <= 9,223,372,036,854,775,807)
247
2485. Security Considerations
249
250 There are no known additional security issues with this extension
251 beyond those described for the base protocol [IMAP4rev1] and the
252 LIST-STATUS extension [LIST-STATUS].
253
2546. IANA Considerations
255
256 IANA has added "STATUS=SIZE" to the "IMAP Capabilities" registry
257 located at <http://www.iana.org/assignments/imap-capabilities>.
258
2597. Normative References
260
261 [ABNF] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax
262 Specifications: ABNF", STD 68, RFC 5234,
263 DOI 10.17487/RFC5234, January 2008,
264 <https://www.rfc-editor.org/info/rfc5234>.
265
266 [IMAP4-ABNF]
267 Melnikov, A. and C. Daboo, "Collected Extensions to IMAP4
268 ABNF", RFC 4466, DOI 10.17487/RFC4466, April 2006,
269 <https://www.rfc-editor.org/info/rfc4466>.
270
271 [IMAP4rev1]
272 Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION
273 4rev1", RFC 3501, DOI 10.17487/RFC3501, March 2003,
274 <https://www.rfc-editor.org/info/rfc3501>.
275
276
277
278
279
280
281
282Bosch Standards Track [Page 5]
283
284RFC 8438 IMAP STATUS=SIZE Extension August 2018
285
286
287 [KEYWORDS] Bradner, S., "Key words for use in RFCs to Indicate
288 Requirement Levels", BCP 14, RFC 2119,
289 DOI 10.17487/RFC2119, March 1997,
290 <https://www.rfc-editor.org/info/rfc2119>.
291
292 [KEYWORDS2]
293 Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
294 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
295 May 2017, <https://www.rfc-editor.org/info/rfc8174>.
296
297 [LIST-STATUS]
298 Melnikov, A. and T. Sirainen, "IMAP4 Extension for
299 Returning STATUS Information in Extended LIST", RFC 5819,
300 DOI 10.17487/RFC5819, March 2010,
301 <https://www.rfc-editor.org/info/rfc5819>.
302
303 [QUOTA] Myers, J., "IMAP4 QUOTA extension", RFC 2087,
304 DOI 10.17487/RFC2087, January 1997,
305 <https://www.rfc-editor.org/info/rfc2087>.
306
307Acknowledgements
308
309 Thanks to Bron Gondwana, Alexey Melnikov, Stan Kalisch, and Michael
310 Slusarz for reviews and suggestions.
311
312Author's Address
313
314 Stephan Bosch
315 Dovecot Oy
316 Lars Sonckin Kaari 12
317 Espoo 02600
318 Finland
319
320 Email: stephan.bosch@dovecot.fi
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338Bosch Standards Track [Page 6]
339
340