1
2
3
4
5
6
7Internet Engineering Task Force (IETF) J. SrimushnamBoovaraghamoorthy
8Request for Comments: 7889 N. Bisht
9Category: Standards Track Samsung Electronics America
10ISSN: 2070-1721 May 2016
11
12
13 The IMAP APPENDLIMIT Extension
14
15Abstract
16
17 This document defines an extension to the IMAP service whereby a
18 server can inform the client about maximum message upload sizes,
19 allowing the client to avoid sending APPEND commands that will fail
20 because the messages are too large.
21
22Status of This Memo
23
24 This is an Internet Standards Track document.
25
26 This document is a product of the Internet Engineering Task Force
27 (IETF). It represents the consensus of the IETF community. It has
28 received public review and has been approved for publication by the
29 Internet Engineering Steering Group (IESG). Further information on
30 Internet Standards is available in Section 2 of RFC 5741.
31
32 Information about the current status of this document, any errata,
33 and how to provide feedback on it may be obtained at
34 http://www.rfc-editor.org/info/rfc7889.
35
36Copyright Notice
37
38 Copyright (c) 2016 IETF Trust and the persons identified as the
39 document authors. All rights reserved.
40
41 This document is subject to BCP 78 and the IETF Trust's Legal
42 Provisions Relating to IETF Documents
43 (http://trustee.ietf.org/license-info) in effect on the date of
44 publication of this document. Please review these documents
45 carefully, as they describe your rights and restrictions with respect
46 to this document. Code Components extracted from this document must
47 include Simplified BSD License text as described in Section 4.e of
48 the Trust Legal Provisions and are provided without warranty as
49 described in the Simplified BSD License.
50
51
52
53
54
55
56
57
58SrimushnamB. & Bisht Standards Track [Page 1]
59
60RFC 7889 The IMAP APPENDLIMIT Extension May 2016
61
62
63Table of Contents
64
65 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
66 1.1. Conventions . . . . . . . . . . . . . . . . . . . . . . . 2
67 2. APPENDLIMIT Extension . . . . . . . . . . . . . . . . . . . . 3
68 3. Mailbox-Specific APPENDLIMIT . . . . . . . . . . . . . . . . 3
69 3.1. STATUS Response to the STATUS Command . . . . . . . . . . 4
70 3.2. STATUS Response to the LIST Command . . . . . . . . . . . 4
71 3.3. APPENDLIMIT Behavior . . . . . . . . . . . . . . . . . . 4
72 4. APPEND Response . . . . . . . . . . . . . . . . . . . . . . . 4
73 5. Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . . 5
74 6. Security Considerations . . . . . . . . . . . . . . . . . . . 5
75 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5
76 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 6
77 8.1. Normative References . . . . . . . . . . . . . . . . . . 6
78 8.2. Informative References . . . . . . . . . . . . . . . . . 6
79 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 7
80 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 7
81
821. Introduction
83
84 Some IMAP servers have limits for message upload size, and those
85 limits are not published to the email client. When the email client
86 APPENDs a message with huge attachments, using non-synchronizing
87 literals, the APPEND fails because of the upload limit, but the
88 client has already sent the message data anyway. This results in
89 unnecessary resource usage. Especially in the mobile device
90 environment, appending a message with huge attachments consumes
91 device resources like device battery power and mobile data.
92
93 The IMAP APPENDLIMIT extension provides the ability to advertise a
94 maximum upload size allowed by the IMAP server, so that the email
95 client knows the size limitation beforehand. By implementing this
96 extension, IMAP server-side processing of huge attachments above the
97 maximum upload size can be avoided.
98
991.1. Conventions
100
101 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
102 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
103 document are to be interpreted as described in [RFC2119].
104
105 In examples, "C:" and "S:" indicate lines sent by the client and
106 server, respectively. If a single "C:" or "S:" label applies to
107 multiple lines, then the line breaks between those lines are for
108 editorial clarity only and are not part of the actual protocol
109 exchange.
110
111
112
113
114SrimushnamB. & Bisht Standards Track [Page 2]
115
116RFC 7889 The IMAP APPENDLIMIT Extension May 2016
117
118
1192. APPENDLIMIT Extension
120
121 An IMAP server that supports the APPENDLIMIT extension advertises
122 this by including the name APPENDLIMIT in its capability list in the
123 authenticated state. The server may also advertise this extension
124 before the user has logged in. If this capability is omitted, no
125 information is conveyed about the server's fixed maximum size for
126 mail uploads. An IMAP server can publish the APPENDLIMIT capability
127 in two formats.
128
129 (a) APPENDLIMIT=<number> ../imapserver/server.go:153
130
131 This indicates that the IMAP server has the same upload limit for all
132 mailboxes. The following example demonstrates the APPENDLIMIT
133 capability with the same upload limit for all mailboxes.
134
135 C: t1 CAPABILITY
136 S: * CAPABILITY IMAP4rev1 ID APPENDLIMIT=257890
137 S: t1 OK foo
138
139 (b) APPENDLIMIT
140
141 The APPENDLIMIT capability without any value indicates that the IMAP
142 server supports this extension, and that the client will need to
143 discover upload limits for each mailbox, as they might differ from
144 mailbox to mailbox. The following example demonstrates the
145 APPENDLIMIT capability without any value.
146
147 C: t1 CAPABILITY
148 S: * CAPABILITY IMAP4rev1 ID APPENDLIMIT
149 S: t1 OK foo
150
151 In this case, the client can get an APPENDLIMIT value by either
152 issuing a STATUS or a LIST command.
153
154 An IMAP client implementing this extension should be able to parse
155 both mailbox-specific and global APPENDLIMIT responses. By looking
156 at the upload size advertised by the IMAP server, a client can avoid
157 trying to APPEND mail more than the advertised limit.
158
1593. Mailbox-Specific APPENDLIMIT
160
161 An IMAP server can have mailbox-specific APPENDLIMIT values that will
162 not be advertised as part of the CAPABILITY response. The IMAP
163 server can publish specific values for each mailbox, and it can
164 publish "NIL" for a mailbox to convey that there is no APPENDLIMIT
165 for that mailbox. The following subsections describe the changes to
166 the STATUS and LIST commands in support of this situation.
167
168
169
170SrimushnamB. & Bisht Standards Track [Page 3]
171
172RFC 7889 The IMAP APPENDLIMIT Extension May 2016
173
174
1753.1. STATUS Response to the STATUS Command
176
177 A new attribute APPENDLIMIT is added to get the limit set by the
178 server for a mailbox as part of a STATUS command. An IMAP client
179 should issue a STATUS command with an APPENDLIMIT item to get the
180 mailbox-specific upload value. The following example demonstrates
181 its usage.
182
183 C: t1 STATUS INBOX (APPENDLIMIT)
184 S: * STATUS INBOX (APPENDLIMIT 257890)
185 S: t1 OK STATUS completed
186
187 In the above example, APPENDLIMIT represents the maximum upload size
188 for INBOX.
189
1903.2. STATUS Response to the LIST Command
191
192 If the server advertises the LIST-STATUS capability [RFC5819], the
193 client can issue a LIST command in combination with the STATUS return
194 option to get the mailbox-specific upload value. The following
195 example demonstrates its usage.
196
197 C: t1 LIST "" % RETURN (STATUS (APPENDLIMIT))
198 S: * LIST () "." "INBOX"
199 S: * STATUS "INBOX" (APPENDLIMIT 257890)
200 S: t1 OK List completed.
201
202 The IMAP server MUST recognize the APPENDLIMIT attribute and include
203 an appropriate STATUS response for each matching mailbox. Refer to
204 Section 5 for the syntax.
205
206 If the server does not support the STATUS return option on the LIST
207 command, then the client should use the STATUS command instead.
208
2093.3. APPENDLIMIT Behavior
210
211 Computing the APPENDLIMIT should be fast and should not take Access
212 Control Lists (ACLs), quotas, or other such information into account.
213 The APPENDLIMIT specifies one part of the policy, but an APPEND
214 command can still fail due to issues related to ACLs and quotas, even
215 if the message being appended is smaller than the APPENDLIMIT.
216
2174. APPEND Response
218
219 If a client uploads a message that exceeds the maximum upload size
220 set for that mailbox, then the server SHALL reject the APPEND command
221 with a tagged TOOBIG response code. Refer to Section 4 of [RFC4469]
222 for various APPEND response codes and their handling.
223
224
225
226SrimushnamB. & Bisht Standards Track [Page 4]
227
228RFC 7889 The IMAP APPENDLIMIT Extension May 2016
229
230
231 A client SHOULD avoid use of non-synchronizing literals [RFC7888]
232 when the maximum upload size supported by the IMAP server is unknown.
233 Refer to Section 4.2.2.3 of [RFC4549] for usage of non-synchronizing
234 literals and its risk for disconnected IMAP clients.
235
2365. Formal Syntax
237
238 The following syntax specification uses the Augmented Backus-Naur
239 Form (ABNF) notation as specified in [RFC5234] including the core
240 rules in Appendix B.1 of that document. [RFC3501] defines the non-
241 terminals "capability" and "status-att", and [RFC4466] defines
242 "status-att-val".
243
244 All alphabetic characters are case insensitive. The use of uppercase
245 or lowercase characters to define token strings is for editorial
246 clarity only. Implementations MUST accept these strings in a case-
247 insensitive fashion.
248
249 capability =/ "APPENDLIMIT" ["=" number]
250 ;; capability is defined in RFC 3501
251
252 status-att =/ "APPENDLIMIT" 9051:7056 3501:5047 7162:2452 ../imapserver/parse.go:439
253 ;; status-att is defined in RFC 3501
254
255 status-att-val =/ "APPENDLIMIT" SP (number / nil) ../imapserver/server.go:2638
256 ;; status-att-val is defined in RFC 4466
257
258
259 The number indicates the fixed maximum message size in octets that
260 the server will accept. An APPENDLIMIT number of 0 indicates the
261 server will not accept any APPEND commands at all for the affected
262 mailboxes.
263
2646. Security Considerations
265
266 This extension provides additional information that cooperative
267 clients can use as an optimization and does not introduce new
268 security concerns. This extension does not address abusive clients
269 that intend to consume server resources, and servers will still have
270 to take action to disconnect and/or restrict access to clients that
271 exhibit abusive behavior.
272
2737. IANA Considerations
274
275 IANA has added "APPENDLIMIT" to the "IMAP Capabilities" registry,
276 using this document as its reference.
277
278
279
280
281
282SrimushnamB. & Bisht Standards Track [Page 5]
283
284RFC 7889 The IMAP APPENDLIMIT Extension May 2016
285
286
2878. References
288
2898.1. Normative References
290
291 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
292 Requirement Levels", BCP 14, RFC 2119,
293 DOI 10.17487/RFC2119, March 1997,
294 <http://www.rfc-editor.org/info/rfc2119>.
295
296 [RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION
297 4rev1", RFC 3501, DOI 10.17487/RFC3501, March 2003,
298 <http://www.rfc-editor.org/info/rfc3501>.
299
300 [RFC4466] Melnikov, A. and C. Daboo, "Collected Extensions to IMAP4
301 ABNF", RFC 4466, DOI 10.17487/RFC4466, April 2006,
302 <http://www.rfc-editor.org/info/rfc4466>.
303
304 [RFC4469] Resnick, P., "Internet Message Access Protocol (IMAP)
305 CATENATE Extension", RFC 4469, DOI 10.17487/RFC4469, April
306 2006, <http://www.rfc-editor.org/info/rfc4469>.
307
308 [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax
309 Specifications: ABNF", STD 68, RFC 5234,
310 DOI 10.17487/RFC5234, January 2008,
311 <http://www.rfc-editor.org/info/rfc5234>.
312
313 [RFC5819] Melnikov, A. and T. Sirainen, "IMAP4 Extension for
314 Returning STATUS Information in Extended LIST", RFC 5819,
315 DOI 10.17487/RFC5819, March 2010,
316 <http://www.rfc-editor.org/info/rfc5819>.
317
318 [RFC7888] Melnikov, A., Ed., "IMAP4 Non-synchronizing Literals",
319 RFC 7888, DOI 10.17487/RFC7888, May 2016,
320 <http://www.rfc-editor.org/info/rfc7888>.
321
3228.2. Informative References
323
324 [RFC4549] Melnikov, A., Ed., "Synchronization Operations for
325 Disconnected IMAP4 Clients", RFC 4549,
326 DOI 10.17487/RFC4549, June 2006,
327 <http://www.rfc-editor.org/info/rfc4549>.
328
329
330
331
332
333
334
335
336
337
338SrimushnamB. & Bisht Standards Track [Page 6]
339
340RFC 7889 The IMAP APPENDLIMIT Extension May 2016
341
342
343Acknowledgements
344
345 Thanks to Alexey Melnikov, Dave Cridland, Adrien de Croy, Michael
346 M. Slusarz, Timo Sirainen, Chris Newman, Pete Maclean, Jamie
347 Nicolson, Stu Brandt, Bron Gondwana, Arnt Gulbrandsen, Cyrus Daboo,
348 Jan Kundrat, Brandon Long, and Barry Leiba for providing valuable
349 comments.
350
351Authors' Addresses
352
353 Jayantheesh SrimushnamBoovaraghamoorthy
354 Samsung Electronics America
355 685 US Highway 202/206
356 Bridgewater, NJ 08807
357 United States
358
359 Email: jayantheesh.sb@gmail.com
360
361
362 Narendra Singh Bisht
363 Samsung Electronics America
364 685 US Highway 202/206
365 Bridgewater, NJ 08807
366 United States
367
368 Email: narendrasingh.bisht@gmail.com
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394SrimushnamB. & Bisht Standards Track [Page 7]
395
396