1
2
3
4
5
6
7Network Working Group P. Resnick
8Request for Comments: 4469 QUALCOMM Incorporated
9Updates: 3501, 3502 April 2006
10Category: Standards Track
11
12
13 Internet Message Access Protocol (IMAP) CATENATE Extension
14
15Status of This Memo
16
17 This document specifies an Internet standards track protocol for the
18 Internet community, and requests discussion and suggestions for
19 improvements. Please refer to the current edition of the "Internet
20 Official Protocol Standards" (STD 1) for the standardization state
21 and status of this protocol. Distribution of this memo is unlimited.
22
23Copyright Notice
24
25 Copyright (C) The Internet Society (2006).
26
27Abstract
28
29 The CATENATE extension to the Internet Message Access Protocol (IMAP)
30 extends the APPEND command to allow clients to create messages on the
31 IMAP server that may contain a combination of new data along with
32 parts of (or entire) messages already on the server. Using this
33 extension, the client can catenate parts of an already existing
34 message onto a new message without having to first download the data
35 and then upload it back to the server.
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58Resnick Standards Track [Page 1]
59
60RFC 4469 IMAP CATENATE Extension April 2006
61
62
631. Introduction
64
65 The CATENATE extension to the Internet Message Access Protocol (IMAP)
66 [1] allows the client to create a message on the server that can
67 include the text of messages (or parts of messages) that already
68 exist on the server without having to FETCH them and APPEND them back
69 to the server. The CATENATE extension extends the APPEND command so
70 that, instead of a single message literal, the command can take as
71 arguments any combination of message literals (as described in IMAP
72 [1]) and message URLs (as described in the IMAP URL Scheme [2]
73 specification). The server takes all the pieces and catenates them
74 into the output message. The CATENATE extension can also coexist
75 with the MULTIAPPEND extension [3] to APPEND multiple messages in a
76 single command.
77
78 There are some obvious uses for the CATENATE extension. The
79 motivating use case was to provide a way for a resource-constrained
80 client to compose a message for subsequent submission that contains
81 data that already exists in that client's IMAP store. Because the
82 client does not have to download and re-upload potentially large
83 message parts, bandwidth and processing limitations do not have as
84 much impact. In addition, since the client can create a message in
85 its own IMAP store, the command also addresses the desire of the
86 client to archive a copy of a sent message without having to upload
87 the message twice. (Mechanisms for sending the message are outside
88 the scope of this document.)
89
90 The extended APPEND command can also be used to copy parts of a
91 message to another mailbox for archival purposes while getting rid of
92 undesired parts. In environments where server storage is limited, a
93 client could get rid of large message parts by copying over only the
94 necessary parts and then deleting the original message. The
95 mechanism could also be used to add data to a message (such as
96 prepending message header fields) or to include other data by making
97 a copy of the original and catenating the new data.
98
992. The CATENATE Capability
100
101 A server that supports this extension returns "CATENATE" as one of
102 the responses to the CAPABILITY command.
103
104
105
106
107
108
109
110
111
112
113
114Resnick Standards Track [Page 2]
115
116RFC 4469 IMAP CATENATE Extension April 2006
117
118
1193. The APPEND Command
120
121 Arguments: mailbox name
122 (The following can be repeated in the presence of the
123 MULTIAPPEND extension [3])
124 OPTIONAL flag parenthesized list
125 OPTIONAL date/time string
126 a single message literal or one or more message parts to
127 catenate, specified as:
128 message literal
129 or
130 message (or message part) URL
131
132 Responses: OPTIONAL NO responses: BADURL, TOOBIG
133
134 Result: OK - append completed
135 NO - append error: can't append to that mailbox, error
136 in flags or date/time or message text, or can't
137 fetch that data
138 BAD - command unknown or arguments invalid
139
140 The APPEND command concatenates all the message parts and appends
141 them as a new message to the end of the specified mailbox. The
142 parenthesized flag list and date/time string set the flags and the
143 internal date, respectively, as described in IMAP [1]. The
144 subsequent command parameters specify the message parts that are
145 appended sequentially to the output message.
146
147 If the original form of APPEND is used, a message literal follows the
148 optional flag list and date/time string, which is appended as
149 described in IMAP [1]. If the extended form is used, "CATENATE" and
150 a parenthesized list of message literals and message URLs follows,
151 each of which is appended to the new message. If a message literal
152 is specified (indicated by "TEXT"), the octets following the count
153 are appended. If a message URL is specified (indicated by "URL"),
154 the octets of the body part pointed to by that URL are appended, as
155 if the literal returned in a FETCH BODY response were put in place of
156 the message part specifier. The APPEND command does not cause the
157 \Seen flag to be set for any catenated body part. The APPEND command
158 does not change the selected mailbox.
159
160 In the extended APPEND command, the string following "URL" is an IMAP
161 URL [2] and is interpreted according to the rules of [2]. The
162 present document only describes the behavior of the command using
163 IMAP URLs that refer to specific messages or message parts on the
164 current IMAP server from the current authenticated IMAP session.
165 Because of that, only relative IMAP message or message part URLs
166 (i.e., those having no scheme or <iserver>) are used. The base URL
167
168
169
170Resnick Standards Track [Page 3]
171
172RFC 4469 IMAP CATENATE Extension April 2006
173
174
175 for evaluating the relative URL is considered "imap://user@server/",
176 where "user" is the user name of the currently authenticated user and
177 "server" is the domain name of the current server. When in the
178 selected state, the base URL is considered
179 "imap://user@server/mailbox", where "mailbox" is the encoded name of
180 the currently selected mailbox. Additionally, since the APPEND
181 command is valid in the authenticated state of an IMAP session, no
182 further LOGIN or AUTHENTICATE command is performed for URLs specified
183 in the extended APPEND command.
184
185 Note: Use of an absolute IMAP URL or any URL that refers to
186 anything other than a message or message part from the current
187 authenticated IMAP session is outside the scope of this document
188 and would require an extension to this specification, and a server
189 implementing only this specification would return NO to such a
190 request.
191
192 The client is responsible for making sure that the catenated message
193 is in the format of an Internet Message Format (RFC 2822) [4] or
194 Multipurpose Internet Mail Extension (MIME) [5] message. In
195 particular, when a URL is catenated, the server copies octets,
196 unchanged, from the indicated message or message part to the
197 catenated message. It does no data conversion (e.g., MIME transfer
198 encodings) nor any verification that the data is appropriate for the
199 MIME part of the message into which it is inserted. The client is
200 also responsible for inserting appropriate MIME boundaries between
201 body parts, and writing MIME Content-Type and Content-Transfer-
202 Encoding lines as needed in the appropriate places.
203
204 Responses behave just as the original APPEND command described in
205 IMAP [1]. If the server implements the IMAP UIDPLUS extension [6],
206 it will also return an APPENDUID response code in the tagged OK
207 response. Two response codes are provided in Section 4 that can be
208 used in the tagged NO response if the APPEND command fails.
209
2104. Response Codes
211
212 When a APPEND command fails, it may return a response code that
213 describes a reason for the failure.
214
2154.1. BADURL Response
216
217 The BADURL response code is returned if the APPEND fails to process
218 one of the specified URLs. Possible reasons for this are bad URL
219 syntax, unrecognized URL schema, invalid message UID, or invalid body
220 part. The BADURL response code contains the first URL specified as a
221 parameter to the APPEND command that has caused the operation to
222 fail.
223
224
225
226Resnick Standards Track [Page 4]
227
228RFC 4469 IMAP CATENATE Extension April 2006
229
230
2314.2. TOOBIG Response
232
233 The TOOBIG response code is returned if the resulting message will
234 exceed the 4-GB IMAP message limit. This might happen, for example,
235 if the client specifies 3 URLs for 2-GB messages. Note that even if
236 the server doesn't return TOOBIG, it still has to be defensive
237 against misbehaving or malicious clients that try to construct a
238 message over the 4-GB limit. The server may also wish to return the
239 TOOBIG response code if the resulting message exceeds a server-
240 specific message size limit.
241
2425. Formal Syntax
243
244 The following syntax specification uses the Augmented Backus-Naur
245 Form (ABNF) [7] notation. Elements not defined here can be found in
246 the formal syntax of the ABNF [7], IMAP [1], and IMAP ABNF extensions
247 [8] specifications. Note that capability and resp-text-code are
248 extended from the IMAP [1] specification and append-data is extended
249 from the IMAP ABNF extensions [8] specification.
250
251 append-data =/ "CATENATE" SP "(" cat-part *(SP cat-part) ")"
252
253 cat-part = text-literal / url
254
255 text-literal = "TEXT" SP literal
256
257 url = "URL" SP astring
258
259 resp-text-code =/ toobig-response-code / badurl-response-code
260
261 toobig-response-code = "TOOBIG"
262
263 badurl-response-code = "BADURL" SP url-resp-text
264
265 url-resp-text = 1*(%x01-09 /
266 %x0B-0C /
267 %x0E-5B /
268 %x5D-FE) ; Any TEXT-CHAR except "]"
269
270 capability =/ "CATENATE"
271
272 The astring in the definition of url and the url-resp-text in the
273 definition of badurl-response-code each contain an imapurl as defined
274 by [2].
275
276
277
278
279
280
281
282Resnick Standards Track [Page 5]
283
284RFC 4469 IMAP CATENATE Extension April 2006
285
286
2876. Acknowledgements
288
289 Thanks to the members of the LEMONADE working group for their input.
290 Special thanks to Alexey Melnikov for the examples.
291
2927. Security Considerations
293
294 The CATENATE extension does not raise any security considerations
295 that are not present for the base protocol or in the use of IMAP
296 URLs, and these issues are discussed in the IMAP [1] and IMAP URL [2]
297 documents.
298
2998. IANA Considerations
300
301 IMAP4 capabilities are registered by publishing a standards track or
302 IESG approved experimental RFC. The registry is currently located at
303 <http://www.iana.org/assignments/imap4-capabilities>. This document
304 defines the CATENATE IMAP capability. The IANA has added this
305 capability to the registry.
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
338Resnick Standards Track [Page 6]
339
340RFC 4469 IMAP CATENATE Extension April 2006
341
342
343Appendix A. Examples
344
345 Lines not starting with "C: " or "S: " are continuations of the
346 previous lines.
347
348 The original message in examples 1 and 2 below (UID = 20) has the
349 following structure:
350
351
352 multipart/mixed MIME message with two body parts:
353
354 1. text/plain
355
356 2. application/x-zip-compressed
357
358 Example 1: The following example demonstrates how a CATENATE client
359 can replace an attachment in a draft message, without the need to
360 download it to the client and upload it back.
361
362 C: A003 APPEND Drafts (\Seen \Draft $MDNSent) CATENATE
363 (URL "/Drafts;UIDVALIDITY=385759045/;UID=20/;section=HEADER"
364 TEXT {42}
365 S: + Ready for literal data
366 C:
367 C: --------------030308070208000400050907
368 C: URL "/Drafts;UIDVALIDITY=385759045/;UID=20/;section=1.MIME"
369 URL "/Drafts;UIDVALIDITY=385759045/;UID=20/;section=1" TEXT {42}
370 S: + Ready for literal data
371 C:
372 C: --------------030308070208000400050907
373 C: URL "/Drafts;UIDVALIDITY=385759045/;UID=30" TEXT {44}
374 S: + Ready for literal data
375 C:
376 C: --------------030308070208000400050907--
377 C: )
378 S: A003 OK catenate append completed
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394Resnick Standards Track [Page 7]
395
396RFC 4469 IMAP CATENATE Extension April 2006
397
398
399 Example 2: The following example demonstrates how the CATENATE
400 extension can be used to replace edited text in a draft message, as
401 well as header fields for the top level message part (e.g., Subject
402 has changed). The previous version of the draft is marked as
403 \Deleted. Note that the server also supports the UIDPLUS extension,
404 so the APPENDUID response code is returned in the successful OK
405 response to the APPEND command.
406
407 C: A003 APPEND Drafts (\Seen \Draft $MDNSent) CATENATE (TEXT {738}
408 S: + Ready for literal data
409 C: Return-Path: <bar@example.org>
410 C: Received: from [127.0.0.2]
411 C: by rufus.example.org via TCP (internal) with ESMTPA;
412 C: Thu, 11 Nov 2004 16:57:07 +0000
413 C: Message-ID: <419399E1.6000505@example.org>
414 C: Date: Thu, 12 Nov 2004 16:57:05 +0000
415 C: From: Bob Ar <bar@example.org>
416 C: X-Accept-Language: en-us, en
417 C: MIME-Version: 1.0
418 C: To: foo@example.net
419 C: Subject: About our holiday trip
420 C: Content-Type: multipart/mixed;
421 C: boundary="------------030308070208000400050907"
422 C:
423 C: --------------030308070208000400050907
424 C: Content-Type: text/plain; charset=us-ascii; format=flowed
425 C: Content-Transfer-Encoding: 7bit
426 C:
427 C: Our travel agent has sent the updated schedule.
428 C:
429 C: Cheers,
430 C: Bob
431 C: --------------030308070208000400050907
432 C: URL "/Drafts;UIDVALIDITY=385759045/;UID=20/;Section=2.MIME"
433 URL "/Drafts;UIDVALIDITY=385759045/;UID=20/;Section=2" TEXT {44}
434 S: + Ready for literal data
435 C:
436 C: --------------030308070208000400050907--
437 C: )
438 S: A003 OK [APPENDUID 385759045 45] append Completed
439 C: A004 UID STORE 20 +FLAGS.SILENT (\Deleted)
440 S: A004 OK STORE completed
441
442
443
444
445
446
447
448
449
450Resnick Standards Track [Page 8]
451
452RFC 4469 IMAP CATENATE Extension April 2006
453
454
455 Example 3: The following example demonstrates how the CATENATE
456 extension can be used to strip attachments. Below, a PowerPoint
457 attachment was replaced by a small text part explaining that the
458 attachment was stripped.
459
460 C: A003 APPEND Drafts (\Seen \Draft $MDNSent) CATENATE
461 (URL "/Drafts;UIDVALIDITY=385759045/;UID=21/;section=HEADER"
462 TEXT {42}
463 S: + Ready for literal data
464 C:
465 C: --------------030308070208000400050903
466 C: URL "/Drafts;UIDVALIDITY=385759045/;UID=21/;section=1.MIME"
467 URL "/Drafts;UIDVALIDITY=385759045/;UID=21/;section=1" TEXT {255}
468 S: + Ready for literal data
469 C:
470 C: --------------030308070208000400050903
471 C: Content-type: text/plain; charset="us-ascii"
472 C: Content-transfer-encoding: 7bit
473 C:
474 C: This body part contained a Power Point presentation that was
475 C: deleted upon your request.
476 C: --------------030308070208000400050903--
477 C: )
478 S: A003 OK append Completed
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506Resnick Standards Track [Page 9]
507
508RFC 4469 IMAP CATENATE Extension April 2006
509
510
511 Example 4: The following example demonstrates a failed APPEND
512 command. The server returns the BADURL response code to indicate
513 that one of the provided URLs is invalid. This example also
514 demonstrates how the CATENATE extension can be used to construct a
515 digest of several messages.
516
517 C: A003 APPEND Sent (\Seen $MDNSent) CATENATE (TEXT {541}
518 S: + Ready for literal data
519 C: Return-Path: <foo@example.org>
520 C: Received: from [127.0.0.2]
521 C: by rufus.example.org via TCP (internal) with ESMTPA;
522 C: Thu, 11 Nov 2004 16:57:07 +0000
523 C: Message-ID: <419399E1.6000505@example.org>
524 C: Date: Thu, 21 Nov 2004 16:57:05 +0000
525 C: From: Farren Oo <foo@example.org>
526 C: X-Accept-Language: en-us, en
527 C: MIME-Version: 1.0
528 C: To: bar@example.org
529 C: Subject: Digest of the mailing list for today
530 C: Content-Type: multipart/digest;
531 C: boundary="------------030308070208000400050904"
532 C:
533 C: --------------030308070208000400050904
534 C: URL "/INBOX;UIDVALIDITY=785799047/;UID=11467" TEXT {42}
535 S: + Ready for literal data
536 C:
537 C: --------------030308070208000400050904
538 C: URL "/INBOX;UIDVALIDITY=785799047/;UID=113330/;section=1.5.9"
539 TEXT {42}
540 S: + Ready for literal data
541 C:
542 C: --------------030308070208000400050904
543 C: URL "/INBOX;UIDVALIDITY=785799047/;UID=11916" TEXT {44}
544 S: + Ready for literal data
545 C:
546 C: --------------030308070208000400050904--
547 C: )
548 S: A003 NO [BADURL "/INBOX;UIDVALIDITY=785799047/;UID=113330;
549 section=1.5.9"] CATENATE append has failed, one message expunged
550
551 Note that the server could have validated the URLs as they were
552 received and therefore could have returned the tagged NO response
553 with BADURL response-code in place of any continuation request after
554 the URL was received.
555
556
557
558
559
560
561
562Resnick Standards Track [Page 10]
563
564RFC 4469 IMAP CATENATE Extension April 2006
565
566
5679. Normative References
568
569 [1] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1",
570 RFC 3501, March 2003.
571
572 [2] Newman, C., "IMAP URL Scheme", RFC 2192, September 1997.
573
574 [3] Crispin, M., "Internet Message Access Protocol (IMAP) -
575 MULTIAPPEND Extension", RFC 3502, March 2003.
576
577 [4] Resnick, P., "Internet Message Format", RFC 2822, April 2001.
578
579 [5] Freed, N. and N. Borenstein, "Multipurpose Internet Mail
580 Extensions (MIME) Part One: Format of Internet Message Bodies",
581 RFC 2045, November 1996.
582
583 [6] Crispin, M., "Internet Message Access Protocol (IMAP) - UIDPLUS
584 extension", RFC 4315, December 2005.
585
586 [7] Crocker, D. and P. Overell, "Augmented BNF for Syntax
587 Specifications: ABNF", RFC 4234, October 2005.
588
589 [8] Melnikov, A. and C. Daboo, "Collected Extensions to IMAP4 ABNF",
590 RFC 4466, April 2006.
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618Resnick Standards Track [Page 11]
619
620RFC 4469 IMAP CATENATE Extension April 2006
621
622
623Author's Address
624
625 Peter W. Resnick
626 QUALCOMM Incorporated
627 5775 Morehouse Drive
628 San Diego, CA 92121-1714
629 US
630
631 Phone: +1 858 651 4478
632 EMail: presnick@qualcomm.com
633 URI: http://www.qualcomm.com/~presnick/
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674Resnick Standards Track [Page 12]
675
676RFC 4469 IMAP CATENATE Extension April 2006
677
678
679Full Copyright Statement
680
681 Copyright (C) The Internet Society (2006).
682
683 This document is subject to the rights, licenses and restrictions
684 contained in BCP 78, and except as set forth therein, the authors
685 retain all their rights.
686
687 This document and the information contained herein are provided on an
688 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
689 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
690 ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
691 INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
692 INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
693 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
694
695Intellectual Property
696
697 The IETF takes no position regarding the validity or scope of any
698 Intellectual Property Rights or other rights that might be claimed to
699 pertain to the implementation or use of the technology described in
700 this document or the extent to which any license under such rights
701 might or might not be available; nor does it represent that it has
702 made any independent effort to identify any such rights. Information
703 on the procedures with respect to rights in RFC documents can be
704 found in BCP 78 and BCP 79.
705
706 Copies of IPR disclosures made to the IETF Secretariat and any
707 assurances of licenses to be made available, or the result of an
708 attempt made to obtain a general license or permission for the use of
709 such proprietary rights by implementers or users of this
710 specification can be obtained from the IETF on-line IPR repository at
711 http://www.ietf.org/ipr.
712
713 The IETF invites any interested party to bring to its attention any
714 copyrights, patents or patent applications, or other proprietary
715 rights that may cover technology that may be required to implement
716 this standard. Please address the information to the IETF at
717 ietf-ipr@ietf.org.
718
719Acknowledgement
720
721 Funding for the RFC Editor function is provided by the IETF
722 Administrative Support Activity (IASA).
723
724
725
726
727
728
729
730Resnick Standards Track [Page 13]
731
732