7Network Working Group C. Daboo
8Request for Comments: 5257 Apple Inc.
9Category: Experimental R. Gellens
14 Internet Message Access Protocol - ANNOTATE Extension
18 This memo defines an Experimental Protocol for the Internet
19 community. It does not specify an Internet standard of any kind.
20 Discussion and suggestions for improvement are requested.
21 Distribution of this memo is unlimited.
25 The ANNOTATE extension to the Internet Message Access Protocol
26 permits clients and servers to maintain "meta data" for messages, or
27 individual message parts, stored in a mailbox on the server. For
28 example, this can be used to attach comments and other useful
29 information to a message. It is also possible to attach annotations
30 to specific parts of a message, so that, for example, they could be
31 marked as seen, or important, or a comment added.
33 Note that this document was the product of a WG that had good
34 consensus on how to approach the problem. Nevertheless, the WG felt
35 it did not have enough information on implementation and deployment
36 hurdles to meet all of the requirements of a Proposed Standard. The
37 IETF solicits implementations and implementation reports in order to
38 make further progress.
40 Implementers should be aware that this specification may change in an
41 incompatible manner when going to Proposed Standard status. However,
42 any incompatible changes will result in a new capability name being
43 used to prevent problems with any deployments of the experimental
58Daboo & Gellens Experimental [Page 1]
60RFC 5257 IMAP ANNOTATE Extension June 2008
65 1. Introduction and Overview .......................................3
66 2. Conventions Used in This Document ...............................4
67 3. Data Model ......................................................4
68 3.1. Overview ...................................................4
69 3.2. Namespace of Entries and Attributes ........................4
70 3.2.1. Entry Names .........................................5
71 3.2.2. Attribute Names .....................................7
72 3.3. Private Versus Shared ......................................7
73 3.4. Access Control .............................................8
74 3.5. Access to Standard IMAP Flags and Keywords ................11
75 4. IMAP Protocol Changes ..........................................11
76 4.1. General Considerations ....................................11
77 4.2. ANNOTATE Parameter with the SELECT/EXAMINE Commands .......12
78 4.3. ANNOTATION Message Data Item in FETCH Command .............12
79 4.4. ANNOTATION Message Data Item in FETCH Response ............14
80 4.5. ANNOTATION Message Data Item in STORE .....................16
81 4.6. ANNOTATION Interaction with COPY ..........................18
82 4.7. ANNOTATION Message Data Item in APPEND ....................18
83 4.8. ANNOTATION Criterion in SEARCH ............................19
84 4.9. ANNOTATION Key in SORT ....................................20
85 4.10. New ACL Rights ...........................................21
86 5. Formal Syntax ..................................................21
87 6. IANA Considerations ............................................23
88 6.1. Entry and Attribute Registration Template .................23
89 6.2. Entry Registrations .......................................24
90 6.2.1. /comment ...........................................24
91 6.2.2. /flags .............................................24
92 6.2.3. /altsubject ........................................25
93 6.2.4. /<section-part>/comment ............................25
94 6.2.5. /<section-part>/flags/seen .........................26
95 6.2.6. /<section-part>/flags/answered .....................26
96 6.2.7. /<section-part>/flags/flagged ......................27
97 6.2.8. /<section-part>/flags/forwarded ....................27
98 6.3. Attribute Registrations ...................................28
99 6.3.1. value ..............................................28
100 6.3.2. size ...............................................28
101 6.4. Capability Registration ...................................28
102 7. Internationalization Considerations ............................29
103 8. Security Considerations ........................................29
104 9. References .....................................................29
105 9.1. Normative References ......................................29
106 9.2. Informative References ....................................30
107 10. Acknowledgments ...............................................30
114Daboo & Gellens Experimental [Page 2]
116RFC 5257 IMAP ANNOTATE Extension June 2008
1191. Introduction and Overview
121 The ANNOTATE extension is present in any IMAP [RFC3501]
122 implementation that returns "ANNOTATE-EXPERIMENT-1" as one of the
123 supported capabilities in the CAPABILITY response.
125 This extension makes the following changes to the IMAP protocol:
127 a. adds a new ANNOTATION message data item for use in FETCH.
129 b. adds a new ANNOTATION message data item for use in STORE.
131 c. adds a new ANNOTATION search criterion for use in SEARCH.
133 d. adds a new ANNOTATION sort key for use in the SORT extension.
135 e. adds a new ANNOTATION data item for use in APPEND.
137 f. adds a new requirement on the COPY command.
139 g. adds a new ANNOTATE parameter for use with the SELECT/EXAMINE
142 h. adds two new response codes to indicate store failures of
145 i. adds a new untagged response code for the SELECT or EXAMINE
146 commands to indicate the maximum sized annotation that can be
149 j. adds a new Access Control List (ACL) "bit" for use with the ACL
150 extensions [RFC2086] and [RFC4314].
152 The data model used for the storage of annotations is based on the
153 Application Configuration Access Protocol [RFC2244]. Note that there
154 is no inheritance in annotations.
156 If a server supports annotations, then it MUST store all annotation
157 data permanently, i.e., there is no concept of "session only"
158 annotations that would correspond to the behavior of "session" flags
159 as defined in the IMAP base specification.
161 In order to provide optimum support for a disconnected client (one
162 that needs to synchronize annotations for use when offline), servers
163 SHOULD also support the Conditional STORE [RFC4551] extension.
165 The rest of this document describes the data model and protocol
166 changes more rigorously.
170Daboo & Gellens Experimental [Page 3]
172RFC 5257 IMAP ANNOTATE Extension June 2008
1752. Conventions Used in This Document
177 The examples in this document use "C:" and "S:" to indicate lines
178 sent by the client and server, respectively.
180 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
181 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
182 document are to be interpreted as described in [RFC2119].
188 The data model for annotations in ANNOTATE uses a uniquely named
189 entry that contains a set of standard attributes. Thus, a single
190 coherent unit of "meta data" for a message is stored as a single
191 entry, made up of several attributes.
193 For example, a comment annotation added to a message has an entry
194 name of "/comment". This entry is composed of several attributes
195 such as "value", "size", etc., that contain the properties and data
198 The protocol changes to IMAP, described below, allow a client to
199 access or change the values of any attribute in any entry in a
200 message annotation, assuming it has sufficient access rights to do so
201 (see Section 3.4 for specifics).
2033.2. Namespace of Entries and Attributes
205 A message may contain zero or more annotations, each of which is a
206 single uniquely named entry. Each entry has a hierarchical name,
207 with each component of the name separated by a slash ("/"). An entry
208 name MUST NOT contain two consecutive "/" characters and MUST NOT end
209 with a "/" character.
211 Each entry is made up of a set of attributes. Each attribute has a
212 hierarchical name, with each component of the name separated by a
213 period ("."). An attribute name MUST NOT contain two consecutive "."
214 characters and MUST NOT end with a "." character.
216 The value of an attribute is "NIL" (has no value), or is a string of
219 Entry and attribute names MUST NOT contain asterisk ("*") or percent
220 ("%") characters, and MUST NOT contain non-ASCII characters or the
221 NULL octet. Invalid entry or attribute names result in a BAD
222 response in any IMAP commands where they are used.
226Daboo & Gellens Experimental [Page 4]
228RFC 5257 IMAP ANNOTATE Extension June 2008
231 Attribute names MUST NOT contain any hierarchical components with the
232 names "priv" or "shared", as those have special meaning (see Section
235 Entry and attribute names are case-sensitive.
237 Use of control or punctuation characters in entry and attribute names
238 is strongly discouraged.
240 This specification defines an initial set of entry and attribute
241 names available for use in message annotations. In addition, an
242 extension mechanism is described to allow additional names to be
247 Entry names MUST be specified in a standards track or IESG approved
248 experimental RFC, or fall under the vendor namespace. See Section
249 6.1 for the registration template.
252 Defines the top-level of entries associated with an entire
253 message. This entry itself does not contain any attributes. All
254 entries that start with a numeric character ("0" - "9") refer to
255 an annotation on a specific body part. All other entries are for
256 annotations on the entire message.
259 Defines a comment or note associated with an entire message.
262 This entry hierarchy is reserved for future use.
265 Contains text supplied by the message recipient to be used by the
266 client, instead of the original message Subject.
268 /vendor/<vendor-token>
269 Defines the top-level of entries associated with an entire message
270 as created by a particular product of some vendor. These sub-
271 entries can be used by vendors to provide client-specific
272 annotations. The vendor-token MUST be registered with IANA, using
273 the [RFC2244] vendor subtree registry.
276 Defines the top-level of entries associated with a specific body
277 part of a message. This entry itself does not contain any
278 attributes. The section-part is a numeric part specifier. Its
282Daboo & Gellens Experimental [Page 5]
284RFC 5257 IMAP ANNOTATE Extension June 2008
287 syntax is the same as the section-part ABNF element defined in
288 [RFC3501]. The server MUST return a BAD response if the client
289 uses an incorrect part specifier (either incorrect syntax or a
290 specifier referring to a non-existent part). The server MUST
291 return a BAD response if the client uses an empty part specifier
292 (which is used in IMAP to represent the entire message).
294 /<section-part>/comment
295 Defines a comment or note associated with a specific body part of
298 /<section-part>/flags
299 Defines the top-level of entries associated with the flag state
300 for a specific body part of a message. All sub-entries are
301 maintained entirely by the client. There is no implicit change to
302 any flag by the server.
304 /<section-part>/flags/seen
305 This is similar to the IMAP \Seen flag, except it applies
306 to only the body part referenced by the entry.
308 /<section-part>/flags/answered
309 This is similar to the IMAP \Answered flag, except it
310 applies to only the body part referenced by the entry.
312 /<section-part>/flags/flagged
313 This is similar to the IMAP \Flagged flag, except it
314 applies to only the body part referenced by the entry.
316 /<section-part>/flags/forwarded
317 This is similar to the IMAP $Forwarded keyword, except it
318 applies to only the body part referenced by the entry.
320 Defines flags for a specific body part of a message. The "value"
321 attribute of each of the entries described above must be either
322 "1", "0", or "NIL". "1" corresponds to the flag being set.
324 /<section-part>/vendor/<vendor-token>
325 Defines the top-level of entries associated with a specific body
326 part of a message as created by a particular product of some
327 vendor. This entry can be used by vendors to provide client
328 specific annotations. The vendor-token MUST be registered with
338Daboo & Gellens Experimental [Page 6]
340RFC 5257 IMAP ANNOTATE Extension June 2008
3433.2.2. Attribute Names
345 Attribute names MUST be specified in a standards track or IESG
346 approved experimental RFC. See Section 6.1 for the registration
349 All attribute names implicitly have a ".priv" and a ".shared" suffix
350 that maps to private and shared versions of the entry. Searching or
351 fetching without using either suffix will include both. The client
352 MUST specify either a ".priv" or ".shared" suffix when storing an
353 annotation or sorting on annotations.
356 A string or binary data representing the value of the annotation.
357 To delete an annotation, the client can store "NIL" into the
358 value. If the client requests the value attribute for a non-
359 existent entry, then the server MUST return "NIL" for the value.
360 The content represented by the string is determined by the
361 content-type used to register the entry (see Section 6.1 for entry
362 registration templates). Where applicable, the registered
363 content-type MUST include a charset parameter. Text values SHOULD
364 use the utf-8 [RFC3629] character set. Note that binary data
365 (data which may contain the NULL octet) is allowed (e.g., for
366 storing images), and this extension uses the "literal8" syntax
367 element [RFC4466] to allow such data to be written to or read from
371 The size of the value, in octets. Set automatically by the
372 server, read-only to clients. If the client requests the size
373 attribute for a non-existent entry, then the server MUST return
374 "0" (zero) for the size.
3763.3. Private Versus Shared
378 Some IMAP mailboxes are private, accessible only to the owning user.
379 Other mailboxes are not, either because the owner has set an ACL
380 [RFC4314] that permits access by other users, or because it is a
383 This raises the issue of shared versus private annotations.
385 If all annotations are private, it is then impossible to have
386 annotations in a shared or otherwise non-private mailbox be visible
387 to other users. This eliminates what could be a useful aspect of
388 annotations in a shared environment. An example of such use is a
389 shared IMAP folder containing bug reports. Engineers may want to use
394Daboo & Gellens Experimental [Page 7]
396RFC 5257 IMAP ANNOTATE Extension June 2008
399 annotations to add information to existing messages, indicate
400 assignments, status, etc. This use requires shared annotations.
402 If all annotations are shared, it is impossible to use annotations
403 for private notes on messages in shared mailboxes. Also, modifying
404 an ACL to permit access to a mailbox by other users may
405 unintentionally expose private information.
407 There are also situations in which both shared and private
408 annotations are useful. For example, an administrator may want to
409 set shared annotations on messages in a shared folder, which
410 individual users may wish to supplement with additional notes.
412 If shared and private annotations are to coexist, we need a clear way
413 to differentiate them. Also, it should be as easy as possible for a
414 client to access both and not overlook either. There is also a
415 danger in allowing a client to store an annotation without knowing if
416 it is shared or private.
418 This document proposes two standard suffixes for all attributes:
419 ".shared" and ".priv". A SEARCH or FETCH command that specifies
420 neither, uses both. STORE, APPEND, and SORT commands MUST explicitly
421 use ".priv" or ".shared" suffixes.
423 If the ANNOTATE extension is present, support for shared annotations
424 in servers is REQUIRED, while support for private annotations in
425 servers is OPTIONAL. This recognizes the fact that support for
426 private annotations may introduce a significant increase in
427 complexity to a server in terms of tracking ownership of the
428 annotations, how quota is determined for users based on their own
429 annotations, etc. Clients that support the ANNOTATE extension MUST
430 handle both shared and private annotations.
434 A user needs to have appropriate rights in order to read or write
435 ".priv" or ".shared" annotation values. How those rights are
436 calculated depends on whether or not the ACL [RFC2086] extension or
437 its update [RFC4314] is present. If a client attempts to store or
438 fetch an annotation to which they do not have the appropriate rights,
439 the server MUST respond with a NO response.
441 When the ACL extension is not present, access to annotation values is
442 governed by the nature of the selected state, in particular whether
443 the mailbox was SELECTED or EXAMINED in READ-ONLY or READ-WRITE mode.
450Daboo & Gellens Experimental [Page 8]
452RFC 5257 IMAP ANNOTATE Extension June 2008
455 When the ACL extension is present, the server MUST recognize the new
456 ACL "n" right, in addition to the ones defined by the ACL extension
459 For ".priv" annotation values, the "r" right controls both read and
460 write access. When it is on, access to ".priv" annotations is
461 allowed; when it is off, access to ".priv" annotations is disallowed.
463 For ".shared" annotation values, the "r" right controls read access.
464 When it is on, ".shared" annotations can be read; when it is off,
465 ".shared" annotations cannot be read.
467 For ".shared" annotation values, the "n" right controls write access.
468 When it is on, ".shared" annotations can be changed or created
469 through either a STORE or APPEND command; when it is off, ".shared"
470 annotations cannot be changed or created. The "n" right constitutes
471 a "shared flag right" as defined in Section 6.2 of [RFC4314].
506Daboo & Gellens Experimental [Page 9]
508RFC 5257 IMAP ANNOTATE Extension June 2008
511 A summary of all the access control restrictions is tabulated below
513 +---------------+---------------+-----------------------------------+
514 | Server Type | Action on | Type of mailbox |
516 +===============+===============+===================================+
518 | | read .priv | Any mailbox that can be SELECTED |
519 | | values | or EXAMINED. |
521 | +---------------+-----------------------------------+
523 | | write .priv | Any SELECTED [READ-WRITE] mailbox.|
524 | | values | SELECTED [READ-ONLY] mailboxes MAY|
525 | Server | | also permit writes. |
527 | ACL Extension +---------------+-----------------------------------+
529 | | read .shared | Any mailbox that can be SELECTED |
530 | | values | or EXAMINED. |
532 | +---------------+-----------------------------------+
534 | | write .shared | Any mailbox that can be SELECTED |
535 | | values | or EXAMINED and is [READ-WRITE]. |
537 +---------------+---------------+-----------------------------------+
539 | | read .priv | Any mailbox with the "r" |
540 | | values | ACL right. |
542 | +---------------+-----------------------------------+
544 | | write .priv | Any mailbox with the "r" |
545 | Server | values | ACL right. |
547 | ACL Extension +---------------+-----------------------------------+
549 | | read .shared | Any mailbox with the "r" |
550 | | values | ACL right. |
552 | +---------------+-----------------------------------+
554 | | write .shared | Any mailbox with the "n" |
555 | | values | ACL right. |
557 +---------------+---------------+-----------------------------------+
562Daboo & Gellens Experimental [Page 10]
564RFC 5257 IMAP ANNOTATE Extension June 2008
5673.5. Access to Standard IMAP Flags and Keywords
569 Due to the ambiguity of how private and shared values would map to
570 the base IMAP flag and keyword values, the ANNOTATE extension does
571 not expose IMAP flags or keywords as entries. However, the /flags
572 annotation entry is reserved for future use and MUST NOT be used by
573 clients or servers supporting this extension.
575 Clients that need to implement shared and private "flags" can create
576 their own annotation entries for those, completely bypassing the base
577 IMAP flag/keyword behavior.
5794. IMAP Protocol Changes
5814.1. General Considerations
583 Servers may be able to offer only a limited level of support for
584 annotations in mailboxes, and it is useful for clients to be able to
585 know what level of support is available. Servers MUST return an
586 ANNOTATIONS response code during the SELECT or EXAMINE command for a
587 mailbox to indicate the level of support. Possible data items used
588 with the ANNOTATIONS response code are:
590 "NONE" - this indicates that the mailbox being selected does not
591 support annotations at all. Clients MUST NOT attempt to use
592 annotation extensions in commands for this mailbox.
594 "READ-ONLY" - this indicates that the annotations supported by the
595 mailbox cannot be changed by the client. Clients MUST NOT attempt
596 to store annotations on any messages in a mailbox with this
599 "NOPRIVATE" - this indicates that the server does not support
600 private annotations on the mailbox. Only shared annotations are
601 supported. Clients SHOULD only attempt to read or store
602 annotations attributes with the ".shared" suffix. If a client
603 uses an attribute with the ".priv" suffix in a FETCH command, then
604 servers should return the attribute value in the FETCH response as
605 "NIL". If a client uses an attribute with the ".priv" suffix in a
606 STORE command (or an APPEND command targeted at the mailbox), then
607 the server MUST return a NO response.
609 numeric values - if servers support writable annotations, then the
610 server MUST indicate the maximum size in octets for an annotation
611 value by providing the maximum size value in the response code.
612 Clients MUST NOT store annotation values of a size greater than
613 the amount indicated by the server. Servers MUST accept a minimum
618Daboo & Gellens Experimental [Page 11]
620RFC 5257 IMAP ANNOTATE Extension June 2008
623 annotation data size of at least 1024 octets if annotations can be
626 In addition, the server MAY limit the total number of annotations for
627 a single message. However, the server MUST provide a minimum
628 annotation count per message of at least 10.
6304.2. ANNOTATE Parameter with the SELECT/EXAMINE Commands
632 The ANNOTATE extension defines a single optional SELECT parameter
633 [RFC4466] "ANNOTATE", which is used to turn on unsolicited responses
634 for annotations as described in Section 4.4. This optional parameter
635 results in a per-mailbox state change, i.e., it must be used in each
636 SELECT/EXAMINE command in order to be effective, irrespective of
637 whether it was used in a previous SELECT/EXAMINE during the same
642 C: a SELECT INBOX (ANNOTATE)
643 S: * FLAGS (\Answered \Flagged \Draft \Deleted \Seen)
644 S: * OK [PERMANENTFLAGS (\Answered \Flagged \Draft
648 S: * OK [UNSEEN 10268]
649 S: * OK [UIDVALIDITY 890061587]
650 S: * OK [UIDNEXT 34643]
651 S: * OK [ANNOTATIONS 20480 NOPRIVATE]
652 S: a OK [READ-WRITE] Completed
654 In the above example, a SELECT command with the ANNOTATE parameter
655 is issued. The response from the server includes the required
656 ANNOTATIONS response that indicates that the server supports
657 annotations up to a maximum size of 20480 octets, and does not
658 support private annotations (only shared).
6604.3. ANNOTATION Message Data Item in FETCH Command
662 This extension adds an ANNOTATION message data item to the FETCH
663 command. This allows clients to retrieve annotations for a range of
664 messages in the currently selected mailbox.
666 ANNOTATION <entry-specifier> <attribute-specifier>
668 The ANNOTATION message data item, when used by the client in the
669 FETCH command, takes an entry specifier and an attribute
674Daboo & Gellens Experimental [Page 12]
676RFC 5257 IMAP ANNOTATE Extension June 2008
681 C: a FETCH 1 (ANNOTATION (/comment value))
682 S: * 1 FETCH (ANNOTATION (/comment
683 (value.priv "My comment"
684 value.shared "Group note")))
685 S: a OK Fetch complete
687 In the above example, the content of the "value" attribute for the
688 "/comment" entry is requested by the client and returned by the
689 server. Since neither ".shared" nor ".priv" was specified, both
692 "*" and "%" wild card characters can be used in entry specifiers to
693 match one or more characters at that position, with the exception
694 that "%" does not match the "/" hierarchy delimiter. Thus, an entry
695 specifier of "/%" matches entries such as "/comment" and
696 "/altsubject", but not "/1/comment".
700 C: a UID FETCH 1123 (UID ANNOTATION
701 (/* (value.priv size.priv)))
702 S: * 12 FETCH (UID 1123 ANNOTATION
703 (/comment (value.priv "My comment"
705 /altsubject (value.priv "Rhinoceroses!"
707 /vendor/foobar/label.priv
708 (value.priv "label43"
710 /vendor/foobar/personality
711 (value.priv "Tallulah Bankhead"
713 S: a OK Fetch complete
715 In the above example, the contents of the private "value" and
716 "size" attributes for any entries in the "/" hierarchy are
717 requested by the client and returned by the server.
730Daboo & Gellens Experimental [Page 13]
732RFC 5257 IMAP ANNOTATE Extension June 2008
737 C: a FETCH 1 (ANNOTATION (/% value.shared))
738 S: * 1 FETCH (ANNOTATION
739 (/comment (value.shared "Patch Mangler")
740 /altsubject (value.shared "Patches? We don't
741 need no steenkin patches!")))
742 S: a OK Fetch complete
744 In the above example, the contents of the shared "value"
745 attributes for entries at the top level only of the "/" hierarchy
746 are requested by the client and returned by the server.
748 Entry and attribute specifiers can be lists of atomic specifiers, so
749 that multiple items of each type may be returned in a single FETCH
754 C: a FETCH 1 (ANNOTATION
755 ((/comment /altsubject) value.priv))
756 S: * 1 FETCH (ANNOTATION
757 (/comment (value.priv "What a chowder-head")
758 /altsubject (value.priv "How to crush beer cans")))
759 S: a OK Fetch complete
761 In the above example, the contents of the private "value"
762 attributes for the two entries "/comment" and "/altsubject" are
763 requested by the client and returned by the server.
7654.4. ANNOTATION Message Data Item in FETCH Response
767 The ANNOTATION message data item in the FETCH response displays
768 information about annotations in a message.
770 ANNOTATION parenthesized list
772 The response consists of a list of entries, each of which have a
773 list of attribute-value pairs.
786Daboo & Gellens Experimental [Page 14]
788RFC 5257 IMAP ANNOTATE Extension June 2008
793 C: a FETCH 1 (ANNOTATION (/comment value))
794 S: * 1 FETCH (ANNOTATION (/comment
795 (value.priv "My comment"
797 S: a OK Fetch complete
799 In the above example, a single entry with a single attribute-value
800 pair is returned by the server. Since the client did not specify
801 a ".shared" or ".priv" suffix, both are returned. Only the
802 private attribute has a value (the shared value is "NIL").
806 C: a FETCH 1 (ANNOTATION
807 ((/comment /altsubject) value))
808 S: * 1 FETCH (ANNOTATION
809 (/comment (value.priv "My comment"
811 /altsubject (value.priv "My subject"
813 S: a OK Fetch complete
815 In the above example, two entries, each with a single attribute-
816 value pair, are returned by the server. Since the client did not
817 specify a ".shared" or ".priv" suffix, both are returned. Only
818 the private attributes have values; the shared attributes are
823 C: a FETCH 1 (ANNOTATION
824 (/comment (value size)))
825 S: * 1 FETCH (ANNOTATION
827 (value.priv "My comment"
831 S: a OK Fetch complete
833 In the above example, a single entry with two attribute-value
834 pairs is returned by the server. Since the client did not specify
835 a ".shared" or ".priv" suffix, both are returned. Only the
836 private attributes have values; the shared attributes are "NIL".
842Daboo & Gellens Experimental [Page 15]
844RFC 5257 IMAP ANNOTATE Extension June 2008
847 Servers SHOULD send ANNOTATION message data items in unsolicited
848 FETCH responses if an annotation entry is changed by a third-party,
849 and the ANNOTATE select parameter was used. This allows servers to
850 keep clients updated with changes to annotations by other clients.
852 Unsolicited ANNOTATION responses MUST NOT include ANNOTATION data
853 values -- only the entry name of the ANNOTATION that has changed.
854 This restriction avoids sending ANNOTATION data values (which may be
855 large) to a client unless the client explicitly asks for the value.
859 C: a STORE 1 +FLAGS (\Seen)
860 S: * 1 FETCH (FLAGS (\Seen))
861 ANNOTATION (/comment))
862 S: a OK STORE complete
864 In the above example, an unsolicited ANNOTATION response is
865 returned during a STORE command. The unsolicited response
866 contains only the entry name of the annotation that changed, and
8694.5. ANNOTATION Message Data Item in STORE
871 ANNOTATION <parenthesized entry-attribute-value list>
873 Sets the specified list of entries by adding or replacing the
874 specified attributes with the values provided. Clients can use
875 "NIL" for values of attributes it wants to remove from entries.
877 The ANNOTATION message data item used with the STORE command has an
878 implicit ".SILENT" behavior. This means the server does not generate
879 an untagged FETCH in response to the STORE command and assumes that
880 the client updates its own cache if the command succeeds. Though
881 note, that if the Conditional STORE extension [RFC4551] is present,
882 then an untagged FETCH response with a MODSEQ data item will be
883 returned by the server as required by [RFC4551].
885 If the server is unable to store an annotation because the size of
886 its value is too large, the server MUST return a tagged NO response
887 with a "[ANNOTATE TOOBIG]" response code.
889 If the server is unable to store a new annotation because the maximum
890 number of allowed annotations has already been reached, the server
891 MUST return a tagged NO response with a "[ANNOTATE TOOMANY]" response
898Daboo & Gellens Experimental [Page 16]
900RFC 5257 IMAP ANNOTATE Extension June 2008
905 C: a STORE 1 ANNOTATION (/comment
906 (value.priv "My new comment"))
907 S: a OK Store complete
909 In the above example, the entry "/comment" is created (if not
910 already present). Its private attribute "value" is created if not
911 already present, or replaced if it exists. "value.priv" is set to
916 C: a STORE 1 ANNOTATION (/comment
918 S: a OK Store complete
920 In the above example, the shared "value" attribute of the entry
921 "/comment" is removed by storing "NIL" into the attribute.
923 Multiple entries can be set in a single STORE command by listing
924 entry-attribute-value pairs in the list.
928 C: a STORE 1 ANNOTATION (/comment
929 (value.priv "Get tix Tuesday")
931 (value.priv "Wots On"))
932 S: a OK Store complete
934 In the above example, the entries "/comment" and "/altsubject" are
935 created (if not already present) and the private attribute "value"
936 is created or replaced for each entry.
938 Multiple attributes can be set in a single STORE command by listing
939 multiple attribute-value pairs in the entry list.
954Daboo & Gellens Experimental [Page 17]
956RFC 5257 IMAP ANNOTATE Extension June 2008
961 C: a STORE 1 ANNOTATION (/comment
962 (value.priv "My new comment"
963 value.shared "foo's bar"))
964 S: a OK Store complete
966 In the above example, the entry "/comment" is created (if not
967 already present) and the private and shared "value" attributes are
968 created if not already present, or replaced if they exist.
9704.6. ANNOTATION Interaction with COPY
972 The COPY command can be used to move messages from one mailbox to
973 another on the same server. Servers that support the ANNOTATION
974 extension MUST, for each message being copied, copy all ".priv"
975 annotation data for the current user only, and all ".shared"
976 annotation data along with the message to the new mailbox. The only
977 exceptions to this are if the destination mailbox permissions are
978 such that either the ".priv" or ".shared" annotations are not
979 allowed, or if the destination mailbox is of a type that does not
980 support annotations or does not support storing of annotations (a
981 mailbox that returns a "NONE" or "READ-ONLY" response code in its
982 ANNOTATIONS response), or if the destination mailbox cannot support
983 the size of an annotation because it exceeds the ANNOTATIONS value.
984 Servers MUST NOT copy ".priv" annotation data for users other than
9874.7. ANNOTATION Message Data Item in APPEND
989 ANNOTATION <parenthesized entry-attribute-value list>
991 Sets the specified list of entries and attributes in the resulting
994 The APPEND command can include annotations for the message being
995 appended via the addition of a new append data item [RFC4466]. The
996 new data item can also be used with the multi-append [RFC3502]
997 extension that allows multiple messages to be appended via a single
1010Daboo & Gellens Experimental [Page 18]
1012RFC 5257 IMAP ANNOTATE Extension June 2008
1017 C: a APPEND drafts ANNOTATION (/comment
1018 (value.priv "Don't send until I say so")) {310}
1019 S: + Ready for literal data
1020 C: MIME-Version: 1.0
1023 S: a OK APPEND completed
1025 In the above example, a comment with a private value is added to a
1026 new message appended to the mailbox. The ellipsis represents the
1027 bulk of the message.
10294.8. ANNOTATION Criterion in SEARCH
1031 ANNOTATION <entry-name> <attribute-name> <value>
1033 The ANNOTATION criterion for the SEARCH command allows a client to
1034 search for a specified string in the value of an annotation entry of
1037 Messages that have annotations with entries matching <entry-name>,
1038 attributes matching <attribute-name>, and the specified string
1039 <value> in their values are returned in the SEARCH results. The "*"
1040 character can be used in the entry name field to match any content in
1041 those items. The "%" character can be used in the entry name field
1042 to match a single level of hierarchy only.
1044 Only the "value", "value.priv", and "value.shared" attributes can be
1045 searched. Clients MUST NOT specify an attribute other than either
1046 "value", "value.priv", or "value.shared". Servers MUST return a BAD
1047 response if the client tries to search any other attribute.
1051 C: a SEARCH ANNOTATION /comment value "IMAP4"
1052 S: * SEARCH 2 3 5 7 11 13 17 19 23
1053 S: a OK Search complete
1055 In the above example, the message numbers of any messages
1056 containing the string "IMAP4" in the shared or private "value"
1057 attribute of the "/comment" entry are returned in the search
1066Daboo & Gellens Experimental [Page 19]
1068RFC 5257 IMAP ANNOTATE Extension June 2008
1073 C: a SEARCH ANNOTATION * value.priv "IMAP4"
1074 S: * SEARCH 1 2 3 5 8 13 21 34
1075 S: a OK Search complete
1077 In the above example, the message numbers of any messages
1078 containing the string "IMAP4" in the private "value" attribute of
1079 any entry are returned in the search results.
10814.9. ANNOTATION Key in SORT
1083 ANNOTATION <entry-name> <attribute-name>
1085 The ANNOTATION criterion for the SORT command [RFC5256] instructs the
1086 server to return the sequence numbers or Unique Identifiers (UIDs) of
1087 messages in a mailbox, sorted using the values of the specified
1088 annotations. The ANNOTATION criterion is available if the server
1089 returns both ANNOTATE-EXPERIMENT-1 and SORT as supported capabilities
1090 in the CAPABILITY command response.
1092 Messages are sorted using the values of the <attribute-name>
1093 attributes in the <entry-name> entries.
1095 Clients MUST provide either the ".priv" or ".shared" suffix to the
1096 attribute name to ensure that the server knows which specific value
1099 Only the "value.priv" and "value.shared" attributes can be used for
1100 sorting. Clients MUST NOT specify an attribute other than either
1101 "value.priv" or "value.shared". Servers MUST return a BAD response
1102 if the client tries to sort on any other attribute.
1104 When either "value.priv" or "value.shared" is being sorted, the
1105 server MUST use the character set value specified in the SORT command
1106 to determine the appropriate sort order.
1110 C: a SORT (ANNOTATION /altsubject value.shared) UTF-8 ALL
1111 S: * SORT 2 3 4 5 1 11 10 6 7 9 8
1112 S: a OK Sort complete
1114 In the above example, the message numbers of all messages are
1115 returned, sorted according to the shared "value" attribute of the
1116 "/altsubject" entry.
1122Daboo & Gellens Experimental [Page 20]
1124RFC 5257 IMAP ANNOTATE Extension June 2008
1127 Note that the ANNOTATION sort key must include a fully specified
1128 entry -- wild cards are not allowed.
1132 As discussed in Section 3.4, this extension adds a new "n" right to
1133 the list of rights provided by the ACL extensions [RFC2086] and
1138 The following syntax specification uses the Augmented Backus-Naur
1139 Form (ABNF) notation as specified in [RFC5234].
1141 Non-terminals referenced but not defined below are as defined by
1142 [RFC3501] with the new definitions in [RFC4466] superseding those in
1145 Except as noted otherwise, all alphabetic characters are case-
1146 insensitive. The use of upper or lower case characters to define
1147 token strings is for editorial clarity only. Implementations MUST
1148 accept these strings in a case-insensitive fashion.
1151 (("READ-ONLY" / nz-number)
1153 ; response codes indicating the level of
1154 ; support for annotations in a mailbox
1156 append-ext =/ att-annotate
1157 ; modifies [RFC3501] extension behaviour
1159 att-annotate = "ANNOTATION" SP
1160 "(" entry-att *(SP entry-att) ")"
1162 att-search = "value" / "value.priv" / "value.shared"
1163 ; the only attributes that can be searched
1165 att-sort = "value.priv" / "value.shared"
1166 ; the only attributes that can be sorted
1168 att-value = attrib SP value
1171 ; dot-separated attribute name
1172 ; MUST NOT contain "*" or "%"
1178Daboo & Gellens Experimental [Page 21]
1180RFC 5257 IMAP ANNOTATE Extension June 2008
1183 attribs = attrib / "(" attrib *(SP attrib) ")"
1184 ; one or more attribute specifiers
1186 capability =/ "ANNOTATE-EXPERIMENT-1"
1187 ; defines the capability for this extension
1189 entries = entry-match /
1190 "(" entry-match *(SP entry-match) ")"
1193 ; slash-separated path to entry
1194 ; MUST NOT contain "*" or "%"
1196 entry-att = entry SP "(" att-value *(SP att-value) ")"
1198 entry-match = list-mailbox
1199 ; slash-separated path to entry
1200 ; MAY contain "*" or "%" for use as wild cards
1202 fetch-att =/ "ANNOTATION" SP "(" entries SP attribs ")"
1203 ; modifies original IMAP fetch-att
1205 msg-att-dynamic =/ "ANNOTATION" SP
1206 ( "(" entry-att *(SP entry-att) ")" /
1207 "(" entry *(SP entry) ")" )
1208 ; extends FETCH response with annotation data
1210 resp-text-code =/ "ANNOTATE" SP "TOOBIG" /
1211 "ANNOTATE" SP "TOOMANY" /
1212 "ANNOTATIONS" SP ann-size
1213 ; new response codes
1215 search-key =/ "ANNOTATION" SP entry-match SP att-search
1217 ; modifies original IMAP search-key
1219 select-param =/ "ANNOTATE"
1220 ; defines the select parameter used with
1221 ; ANNOTATE extension
1223 sort-key =/ "ANNOTATION" SP entry SP att-sort
1224 ; modifies original sort-key
1226 store-att-flags =/ att-annotate
1227 ; modifies original IMAP STORE command
1229 value = nstring / literal8
1234Daboo & Gellens Experimental [Page 22]
1236RFC 5257 IMAP ANNOTATE Extension June 2008
12396. IANA Considerations
1241 Entry names MUST be specified in a standards track or IESG approved
1242 experimental RFC, or fall under the vendor namespace. Vendor names
1245 Attribute names MUST be specified in a standards track or IESG
1246 approved experimental RFC.
1248 Each entry registration MUST include a content-type that is used to
1249 indicate the nature of the annotation value. Where applicable, a
1250 charset parameter MUST be included with the content-type.
12526.1. Entry and Attribute Registration Template
1255 Subject: IMAP Annotate Registration
1257 Please register the following IMAP Annotate item:
1259 [] Entry [] Attribute
1261 Name: ______________________________
1263 Description: _______________________
1265 ____________________________________
1267 ____________________________________
1269 Content-Type:_______________________
1271 Contact person: ____________________
1273 email: ____________________
1290Daboo & Gellens Experimental [Page 23]
1292RFC 5257 IMAP ANNOTATE Extension June 2008
12956.2. Entry Registrations
1297 The following templates specify the IANA registrations of annotation
1298 entries specified in this document.
1303 Subject: IMAP Annotate Registration
1305 Please register the following IMAP Annotate item:
1307 [X] Entry [] Attribute
1311 Description: Defined in IMAP ANNOTATE extension document.
1313 Content-Type: text/plain; charset=utf-8
1315 Contact person: Cyrus Daboo
1317 email: cyrus@daboo.name
1322 Subject: IMAP Annotate Registration
1324 Please register the following IMAP Annotate item:
1326 [X] Entry [] Attribute
1330 Description: Reserved entry hierarchy.
1334 Contact person: Cyrus Daboo
1336 email: cyrus@daboo.name
1346Daboo & Gellens Experimental [Page 24]
1348RFC 5257 IMAP ANNOTATE Extension June 2008
1354 Subject: IMAP Annotate Registration
1356 Please register the following IMAP Annotate item:
1358 [X] Entry [] Attribute
1362 Description: Defined in IMAP ANNOTATE extension document.
1364 Content-Type: text/plain; charset=utf-8
1366 Contact person: Cyrus Daboo
1368 email: cyrus@daboo.name
13706.2.4. /<section-part>/comment
1373 Subject: IMAP Annotate Registration
1375 Please register the following IMAP Annotate item:
1377 [X] Entry [] Attribute
1379 Name: /<section-part>/comment
1381 Description: Defined in IMAP ANNOTATE extension document.
1383 Content-Type: text/plain; charset=utf-8
1385 Contact person: Cyrus Daboo
1387 email: cyrus@daboo.name
1402Daboo & Gellens Experimental [Page 25]
1404RFC 5257 IMAP ANNOTATE Extension June 2008
14076.2.5. /<section-part>/flags/seen
1410 Subject: IMAP Annotate Registration
1412 Please register the following IMAP Annotate item:
1414 [X] Entry [] Attribute
1416 Name: /<section-part>/flags/seen
1418 Description: Defined in IMAP ANNOTATE extension document.
1420 Content-Type: text/plain; charset=utf-8
1422 Contact person: Cyrus Daboo
1424 email: cyrus@daboo.name
14266.2.6. /<section-part>/flags/answered
1429 Subject: IMAP Annotate Registration
1431 Please register the following IMAP Annotate item:
1433 [X] Entry [] Attribute
1435 Name: /<section-part>/flags/answered
1437 Description: Defined in IMAP ANNOTATE extension document.
1439 Content-Type: text/plain; charset=utf-8
1441 Contact person: Cyrus Daboo
1443 email: cyrus@daboo.name
1458Daboo & Gellens Experimental [Page 26]
1460RFC 5257 IMAP ANNOTATE Extension June 2008
14636.2.7. /<section-part>/flags/flagged
1466 Subject: IMAP Annotate Registration
1468 Please register the following IMAP Annotate item:
1470 [X] Entry [] Attribute
1472 Name: /<section-part>/flags/flagged
1474 Description: Defined in IMAP ANNOTATE extension document.
1476 Content-Type: text/plain; charset=utf-8
1478 Contact person: Cyrus Daboo
1480 email: cyrus@daboo.name
14826.2.8. /<section-part>/flags/forwarded
1485 Subject: IMAP Annotate Registration
1487 Please register the following IMAP Annotate item:
1489 [X] Entry [] Attribute
1491 Name: /<section-part>/flags/forwarded
1493 Description: Defined in IMAP ANNOTATE extension document.
1495 Content-Type: text/plain; charset=utf-8
1497 Contact person: Cyrus Daboo
1499 email: cyrus@daboo.name
1514Daboo & Gellens Experimental [Page 27]
1516RFC 5257 IMAP ANNOTATE Extension June 2008
15196.3. Attribute Registrations
1521 The following templates specify the IANA registrations of annotation
1522 attributes specified in this document.
1527 Subject: IMAP Annotate Registration
1529 Please register the following IMAP Annotate item:
1531 [] Entry [X] Attribute
1535 Description: Defined in IMAP ANNOTATE extension document.
1537 Contact person: Cyrus Daboo
1539 email: cyrus@daboo.name
1544 Subject: IMAP Annotate Registration
1546 Please register the following IMAP Annotate item:
1548 [] Entry [X] Attribute
1552 Description: Defined in IMAP ANNOTATE extension document.
1554 Contact person: Cyrus Daboo
1556 email: cyrus@daboo.name
15586.4. Capability Registration
1560 This document registers "ANNOTATE-EXPERIMENT-1" as an IMAPEXT
1570Daboo & Gellens Experimental [Page 28]
1572RFC 5257 IMAP ANNOTATE Extension June 2008
15757. Internationalization Considerations
1577 Annotations may contain values that include text strings, and both
1578 searching and sorting are possible with annotations. Servers MUST
1579 follow standard IMAP text normalization, character set conversion,
1580 and collation rules when such operations are carried out, as would be
1581 done for other textual fields being searched or sorted on.
15838. Security Considerations
1585 Annotations whose values are intended to remain private MUST be
1586 stored in ".priv" values instead of ".shared" values, which may be
1587 accessible to other users.
1589 Excluding the above issues, the ANNOTATE extension does not raise any
1590 security considerations that are not present in the base IMAP
1591 protocol; these issues are discussed in [RFC3501].
15959.1. Normative References
1597 [RFC2086] Myers, J., "IMAP4 ACL extension", RFC 2086, January 1997.
1599 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
1600 Requirement Levels", BCP 14, RFC 2119, March 1997.
1602 [RFC2244] Newman, C. and J. Myers, "ACAP -- Application
1603 Configuration Access Protocol", RFC 2244, November 1997.
1605 [RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION
1606 4rev1", RFC 3501, March 2003.
1608 [RFC3502] Crispin, M., "Internet Message Access Protocol (IMAP) -
1609 MULTIAPPEND Extension", RFC 3502, March 2003.
1611 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO
1612 10646", STD 63, RFC 3629, November 2003.
1614 [RFC4314] Melnikov, A., "IMAP4 Access Control List (ACL) Extension",
1615 RFC 4314, December 2005.
1617 [RFC4466] Melnikov, A. and C. Daboo, "Collected Extensions to IMAP4
1618 ABNF", RFC 4466, April 2006.
1620 [RFC5234] Crocker, D., Ed., and P. Overell, "Augmented BNF for
1621 Syntax Specifications: ABNF", STD 68, RFC 5234, January
1626Daboo & Gellens Experimental [Page 29]
1628RFC 5257 IMAP ANNOTATE Extension June 2008
1631 [RFC5256] Crispin, M. and K. Murchison, "Internet Message Access
1632 Protocol - SORT and THREAD Extensions", RFC 5256, June
16359.2. Informative References
1637 [RFC4551] Melnikov, A. and S. Hole, "IMAP Extension for Conditional
1638 STORE Operation or Quick Flag Changes Resynchronization",
1639 RFC 4551, June 2006.
1643 Many thanks to Chris Newman for his detailed comments on the first
1644 draft of this document, and to the participants at the ACAP working
1645 dinner in Pittsburgh. The participants of the IMAPext working group
1646 made significant contributions to this work.
1656 EMail: cyrus@daboo.name
1657 URI: http://www.apple.com/
1661 QUALCOMM Incorporated
1663 San Diego, CA 92121-2779
1666 EMail: randy@qualcomm.com
1682Daboo & Gellens Experimental [Page 30]
1684RFC 5257 IMAP ANNOTATE Extension June 2008
1687Full Copyright Statement
1689 Copyright (C) The IETF Trust (2008).
1691 This document is subject to the rights, licenses and restrictions
1692 contained in BCP 78, and except as set forth therein, the authors
1693 retain all their rights.
1695 This document and the information contained herein are provided on an
1696 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
1697 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND
1698 THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS
1699 OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF
1700 THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
1701 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
1703Intellectual Property
1705 The IETF takes no position regarding the validity or scope of any
1706 Intellectual Property Rights or other rights that might be claimed to
1707 pertain to the implementation or use of the technology described in
1708 this document or the extent to which any license under such rights
1709 might or might not be available; nor does it represent that it has
1710 made any independent effort to identify any such rights. Information
1711 on the procedures with respect to rights in RFC documents can be
1712 found in BCP 78 and BCP 79.
1714 Copies of IPR disclosures made to the IETF Secretariat and any
1715 assurances of licenses to be made available, or the result of an
1716 attempt made to obtain a general license or permission for the use of
1717 such proprietary rights by implementers or users of this
1718 specification can be obtained from the IETF on-line IPR repository at
1719 http://www.ietf.org/ipr.
1721 The IETF invites any interested party to bring to its attention any
1722 copyrights, patents or patent applications, or other proprietary
1723 rights that may cover technology that may be required to implement
1724 this standard. Please address the information to the IETF at
1738Daboo & Gellens Experimental [Page 31]