idnits 2.17.1 draft-ietf-imapext-annotate-09.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Looks like you're using RFC 2026 boilerplate. This must be updated to follow RFC 3978/3979, as updated by RFC 4748. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- == No 'Intended status' indicated for this document; assuming Proposed Standard Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** There are 8 instances of too long lines in the document, the longest one being 6 characters in excess of 72. ** The abstract seems to contain references ([ANNOTATETOOBIG], [IMAP4], [ANNOTATETOOMANY]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the RFC 3978 Section 5.4 Copyright Line does not match the current year == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (April 19, 2004) is 7311 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'IMAP4' is mentioned on line 1017, but not defined == Missing Reference: 'ANNOTATE TOOBIG' is mentioned on line 66, but not defined == Missing Reference: 'ANNOTATE TOOMANY' is mentioned on line 66, but not defined == Missing Reference: 'ACAP' is mentioned on line 426, but not defined == Missing Reference: 'MDNSENT' is mentioned on line 339, but not defined == Missing Reference: 'MIME' is mentioned on line 418, but not defined == Missing Reference: 'ACL' is mentioned on line 432, but not defined == Missing Reference: 'MULTIAPPEND' is mentioned on line 921, but not defined == Missing Reference: 'ABNF' is mentioned on line 901, but not defined == Unused Reference: 'RFC1891' is defined on line 1027, but no explicit reference was found in the text == Unused Reference: 'RFC2119' is defined on line 1030, but no explicit reference was found in the text == Unused Reference: 'RFC2234' is defined on line 1033, but no explicit reference was found in the text == Unused Reference: 'RFC2244' is defined on line 1036, but no explicit reference was found in the text == Unused Reference: 'RFC3501' is defined on line 1039, but no explicit reference was found in the text == Unused Reference: 'RFC3502' is defined on line 1042, but no explicit reference was found in the text == Unused Reference: 'RFC3503' is defined on line 1045, but no explicit reference was found in the text == Unused Reference: 'RFC2086' is defined on line 1060, but no explicit reference was found in the text ** Obsolete normative reference: RFC 1891 (Obsoleted by RFC 3461) ** Obsolete normative reference: RFC 2234 (Obsoleted by RFC 4234) ** Obsolete normative reference: RFC 3501 (Obsoleted by RFC 9051) == Outdated reference: A later version (-20) exists of draft-ietf-imapext-sort-15 == Outdated reference: A later version (-09) exists of draft-ietf-imapext-condstore-05 -- Obsolete informational reference (is this intentional?): RFC 2086 (Obsoleted by RFC 4314) Summary: 6 errors (**), 0 flaws (~~), 22 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 IMAP Extensions Working Group R. Gellens 3 Internet-Draft QUALCOMM Incorporated 4 Expires: October 18, 2004 C. Daboo 5 Cyrusoft International, Inc. 6 April 19, 2004 8 IMAP ANNOTATE Extension 9 draft-ietf-imapext-annotate-09 11 Status of this Memo 13 This document is an Internet-Draft and is in full conformance with 14 all provisions of Section 10 of RFC2026. 16 Internet-Drafts are working documents of the Internet Engineering 17 Task Force (IETF), its areas, and its working groups. Note that other 18 groups may also distribute working documents as Internet-Drafts. 20 Internet-Drafts are draft documents valid for a maximum of six months 21 and may be updated, replaced, or obsoleted by other documents at any 22 time. It is inappropriate to use Internet-Drafts as reference 23 material or to cite them other than as "work in progress." 25 The list of current Internet-Drafts can be accessed at http:// 26 www.ietf.org/ietf/1id-abstracts.txt. 28 The list of Internet-Draft Shadow Directories can be accessed at 29 http://www.ietf.org/shadow.html. 31 This Internet-Draft will expire on October 18, 2004. 33 Copyright Notice 35 Copyright (C) The Internet Society (2004). All Rights Reserved. 37 Abstract 39 The ANNOTATE extension to the Internet Message Access Protocol 40 [IMAP4] permits clients and servers to maintain "metadata" for 41 messages stored in an IMAP4 mailbox. 43 Change History (to be removed prior to publication as an RFC) 45 Changes from -08 to -09: 46 1. Fix formatting, ID nits etc. 47 2. Fix subject -> altsubject in examples. 48 3. Added text to SELECT/EXAMINE optional parameter definition to 49 indicate that the option could trigger a global state change or a 50 mailbox specific change. 51 4. Changed entry/attribute names to be case-sensitive to avoid case 52 mapping issues with utf8 text. 53 5. Clarify COPY interaction to indicate that only the current user's 54 '.priv's are copied, not the '.priv's of other users. 56 Changes from -07 to -08: 57 1. ANNOTATESIZE response changed to use "NIL" for a mailbox that 58 does not support any type of annotations, and "0" for a mailbox 59 that only supports read-only annotations. 61 Changes from -06 to -07: 62 1. Added text to state entry and attribute names are always 63 case-insensitive. 64 2. Removed top-level entry namespace. 65 3. Added server accept minima for annotation size and count. 66 4. Added [ANNOTATE TOOBIG] & [ANNOTATE TOOMANY] response codes. 67 5. Added [ANNOTATESIZE <>] response code. 68 6. Added comment on suggested CONDSTORE support. 69 7. Modified append behaviour to account for MULTIAPPEND. 70 8. Tweaked ABNF. 72 Changes from -05 to -06: 73 1. Split references into Normative and Informative. 74 2. Reworked flags to allow IMAP4 flag prefix to appear in annotation 75 name. 76 3. Removed smtp-envelope annotation - a future extension can add 77 this. 78 4. Changed subject to altsubject. 79 5. Added $MDNSent flag and reference to document. 80 6. Cleaned up formal syntax to use IMAP string type for entry and 81 attributes, with requirements on how the string is formatted. 82 7. Use of ACAP vendor subtree registry for vendor tokens. 83 8. Fixed STORE syntax. 85 Changes from -04 to -05: 86 1. Fixed examples to match formal syntax for FETCH responses where 87 parenthesis do not appear around entry-att items. 89 Changes from -03 to -04: 90 1. Fixed attrib/attrib-match grammar to use "." instead of "/". 91 2. Add text for server to reject unknown . 92 3. Do not allow empty part-specifier. 93 4. Store NIL to value to delete. 94 5. Comment on COPY interaction with ANNOTATE. 95 6. Added comment that IMAP flags are mapped one-to-one with their 96 corresponding FLAGS items. 98 7. Added comment that the recent flag annotation is read-only. 100 Changes from -02 to -03: 101 1. Removed reference to status modtime item. 102 2. Added missing 'notify' and 'ret' dsn annotations for /message/ 103 smtp-envelope. 104 3. Added requirement to store data permanently - no 'session only' 105 annotations. 106 4. Removed Access Control section. Replaced with comments on 107 read-only/read-write mailboxes and storing private or shared 108 annotations. 109 5. Removed STORE to default .priv or .shared. 110 6. Added section on optional select parameters. 112 Changes from -01 to -02: 113 1. Now require .priv or .shared on store operations. 115 Changes from -00 to -01: 116 1. MODTIME moved to its own draft, which this draft now depends on. 117 Thus, Conditional Annotation STORE and related items deleted from 118 this draft. 119 2. Private versus Shared Annotations: both are possible (separately 120 addressable using ".priv" and ".shared" suffixes). There is a 121 per-mailbox setting for the default. It is an open issue how this 122 is viewed or changed by the client. 123 3. In ACLs, the "w" right is needed to updated shared state; the "s" 124 right is needed to update private state. 125 4. Various clarifications and text modifications. 126 5. Added 'forwarded' flag for message parts. 128 Changes from pre-imapext to -00: 129 1. Clarified text describing attributions, entries, and attributes. 130 2. Changed 'modifiedsince' to 'modtime'; referenced ACAP spec. 131 3. Deleted 'queued' flag. 132 4. Expanded and explained smtp-envelope entry. 133 5. Restricted including ANNOTATION data in unsolicited responses 134 until the client uses it first. (Open issue as to if needed). 135 6. Examples now only use valid entries and attributes. 136 7. Updated Security Considerations. 137 8. Content-Type now defaults to text/plain. 138 9. Open Issue: Shared vs. private annotations. 139 10. Open issue: Annotation Modtime untagged response or VALIDTIME 140 FETCH data. 141 11. Open issue: Conditional annotation STORE. 142 12. ANNOTATION criterion available if both "ANNOTATE" and "SORT" in 143 CAPABILITY command response. 144 13. Prohibition on annotations in lieu of base spec functionality. 146 14. Specified required ACL rights. 147 15. ANNOTATION message data item in APPEND. 148 16. ANNOTATION-MODTIME message data item in STATUS. 149 17. Replaced ATOM_CHAR with utf8-char. 150 18. Updated other ABNF entries. 152 Table of Contents 154 1. Introduction and Overview . . . . . . . . . . . . . . . . . 5 155 2. Data Model . . . . . . . . . . . . . . . . . . . . . . . . . 6 156 2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 6 157 2.2 Namespace of entries and attributes . . . . . . . . . . . . 6 158 2.2.1 Entry Names . . . . . . . . . . . . . . . . . . . . . . . . 7 159 2.2.2 Attribute Names . . . . . . . . . . . . . . . . . . . . . . 9 160 2.3 Private versus Shared and Access Control . . . . . . . . . . 10 161 3. IMAP Protocol Changes . . . . . . . . . . . . . . . . . . . 11 162 3.1 General Considerations . . . . . . . . . . . . . . . . . . . 11 163 3.2 Optional parameters with the SELECT/EXAMINE commands . . . . 11 164 3.3 ANNOTATION Message Data Item in FETCH Command . . . . . . . 13 165 3.4 ANNOTATION Message Data Item in FETCH Response . . . . . . . 15 166 3.5 ANNOTATION Message Data Item in STORE . . . . . . . . . . . 16 167 3.6 ANNOTATION interaction with COPY . . . . . . . . . . . . . . 18 168 3.7 ANNOTATION Message Data Item in APPEND . . . . . . . . . . . 18 169 3.8 ANNOTATION Criterion in SEARCH . . . . . . . . . . . . . . . 18 170 3.9 ANNOTATION Key in SORT . . . . . . . . . . . . . . . . . . . 19 171 4. Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . 20 172 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . 22 173 5.1 Entry and Attribute Registration Template . . . . . . . . . 22 174 6. Security Considerations . . . . . . . . . . . . . . . . . . 22 175 Normative References . . . . . . . . . . . . . . . . . . . . 22 176 Informative References . . . . . . . . . . . . . . . . . . . 23 177 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . 23 178 A. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . 24 179 Intellectual Property and Copyright Statements . . . . . . . 25 181 1. Introduction and Overview 183 The ANNOTATE extension is present in any IMAP4 implementation which 184 returns "ANNOTATE" as one of the supported capabilities in the 185 CAPABILITY response. 187 The ANNOTATE extension adds a new message data item to the FETCH and 188 STORE commands, as well as adding SEARCH and SORT keys and an APPEND 189 modifier. 191 This extension makes the following changes to the IMAP4 protocol: 193 a. adds a new ANNOTATION message data item for use in FETCH 194 b. adds a new ANNOTATION message data item for use in STORE 195 c. adds a new ANNOTATION search criterion for use in SEARCH 196 d. adds a new ANNOTATION sort key for use in SORT extension 197 e. adds a new ANNOTATION data item for use in APPEND 198 f. adds a new requirement on the COPY command 199 g. adds a extension mechanism for adding parameters to the SELECT/ 200 EXAMINE commands and defines the ANNOTATE parameter 201 h. adds two new response codes to indicate store failures of 202 annotations. 203 i. adds a new untagged response codes for the SELECT or EXAMINE 204 commands to indicate the maximum size. 206 The data model used for the storage of annotations is based on that 207 of the Application Configuration Access Protocol [ACAP]. Note that 208 there is no inheritance in annotations. 210 Clients MUST NOT use annotations in lieu of equivalent IMAP base 211 specification facilities. For example, use of a "seen" flag in the 212 vendor namespace together with ".PEEK" in fetches. Such behaviour 213 would significantly reduce IMAP interoperability. 215 If a server supports annotations, then it MUST store all annotation 216 data permanently, i.e. there is no concept of 'session only' 217 annotations that would correspond to the behaviour of 'session' flags 218 as defined in the IMAP base specification. The exception to this is 219 IMAP flags (which are accessible directly through annotations) which 220 may be 'session only' as determined by the FLAGS and PERMANENTFLAGS 221 responses to a SELECT or EXAMINE command. 223 This extension also introduces a generalised mechanism for adding 224 parameters to the SELECT or EXAMINE commands. It is anticipated that 225 other extensions may want to utilise this, so it is not strictly 226 dependent on the ANNOTATE extension being present. 228 In order to provide optimum support for a disconnected client (one 229 that needs to synchronise annotations for use when offline), servers 230 SHOULD also support the Conditional STORE [CONDSTORE] extension. 232 The rest of this document describes the data model and protocol 233 changes more rigorously. 235 2. Data Model 237 2.1 Overview 239 The data model used in ANNOTATE is that of a uniquely named entry 240 which contains a set of standard attributes. A single coherent unit 241 of "metadata" for a message is stored as a single entry, made up of 242 several attributes. 244 For example, a comment added to a message has an entry name of "/ 245 comment". This entry is composed of several attributes such as 246 "value", "size", etc. which contain the properties and data of the 247 entry. 249 The protocol changes to IMAP described below allow a client to access 250 or change the values of any attributes in any entries in a message 251 annotation, assuming it has sufficient access rights to do so (see 252 Section 2.3 for specifics). 254 2.2 Namespace of entries and attributes 256 Each message annotation is made up of a set of entries. Each entry 257 has a hierarchical name in UTF-8, with each component of the name 258 separated by a slash ("/"). 260 Each entry is made up of a set of attributes. Each attribute has a 261 hierarchical name in UTF-8, with each component of the name separated 262 by a period ("."). 264 The value of an attribute is NIL (has no value), or is a string of 265 zero or more octets. 267 Entry and attribute names MUST NOT contain asterisk ("*") or percent 268 ("%") characters and MUST be valid UTF-8 strings which do not contain 269 the NULL octet. Invalid entry or attribute names result in a BAD 270 response in any IMAP commands where they are used. 272 Entry and attribute names are case-sensitive. 274 Use of non-visible UTF-8 characters in entry and attribute names is 275 strongly discouraged. 277 This specification defines an initial set of entry and attribute 278 names available for use in message annotations. In addition, an 279 extension mechanism is described to allow additional names to be 280 added for extensibility. 282 2.2.1 Entry Names 284 Entry names MUST be specified in a standards track or IESG approved 285 experimental RFC, or fall under the vendor namespace. See Section 5.1 286 for the registration template. 288 / 289 Defines the top-level of entries associated with an entire 290 message. This entry itself does not contain any attributes. All 291 entries that start with a numeric character ("0" - "9") refer to 292 an annotation on a specific body part. All other entries are for 293 annotations on the entire message. 295 /comment 296 Defines a comment or note associated with an entire message. 298 /flags 299 Defines the top-level of entries for flags associated with an 300 entire message. The "value" attribute of each of the entries 301 described below must be either "1", "0" or NIL. "1" corresponds to 302 the flag being set. 304 Standard [IMAP4] flags always have a '\' prefix character. Other 305 standard flags have a '$' prefix. The annotation names used for 306 all flags uses the complete name for that flag, including the 307 prefix character. 309 The set of standard IMAP flags annotations are: 311 /flags/\answered 312 /flags/\flagged 313 /flags/\deleted 314 /flags/\seen 315 /flags/\draft 316 /flags/\recent 318 Changes to these annotations are reflected in the standard IMAP 319 flags. The \recent attribute is read only, clients MUST NOT 320 attempt to change it. 322 Note that entry names are sent as [IMAP4] string elements which 323 requires that '\' characters be escaped if sent as a quoted string 324 as opposed to a literal. 326 Note that flag and keyword names in [IMAP4] are case-insensitive, 327 however the entry names for the corresponding annotations are 328 case-sensitive. Thus the [IMAP4] flag and keyword names MUST be 329 mapped to lowercase characters before being used as entry names 330 for annotations. 332 Additional standard flags are: 334 /flags/$mdnsent 335 /flags/$redirected 336 /flags/$forwarded 338 The '$mdnsent' flag is used to indicate message disposition 339 notification processing state [MDNSENT]. 341 The '$redirected' flag indicates that a message has been handed 342 off to someone else, by resending the message with minimal 343 alterations, and in such a way that a reply by the new 344 recipient is addressed to the original author, not the user who 345 performed the redirection. 347 The '$forwarded' flag indicates the message was resent to 348 another user, embedded within or attached to a new message. 350 /altsubject 351 Contains text supplied by the message recipient, to be used by the 352 client instead of the original message Subject. 354 /vendor/ 355 Defines the top-level of entries associated with an entire message 356 as created by a particular product of some vendor. These 357 sub-entries can be used by vendors to provide client-specific 358 attributes. The vendor-token MUST be registered with IANA, using 359 the [ACAP] vendor subtree registry. 361 / 362 Defines the top-level of entries associated with a specific body 363 part of a message. This entry itself does not contain any 364 attributes. The section-part uses the same numeric part specifier 365 syntax as the BODY message data item in the FETCH command [IMAP4]. 366 The server MUST return a BAD response if the client uses an 367 incorrect part specifier (either incorrect syntax or a specifier 368 referring to a non-existent part). The server MUST return a BAD 369 response if the client uses an empty part specifier (which is used 370 in [IMAP4] to represent the entire message). 372 //comment 373 Defines a comment or note associated with a specific body part of 374 a message. 376 //flags 377 Defines the top-level of entries associated with flag state for a 378 specific body part of a message. All sub-entries are maintained 379 entirely by the client. There is no implicit change to any flag by 380 the server. 382 //flags/seen 383 //flags/answered 384 //flags/flagged 385 //flags/forwarded 387 Defines flags for a specific body part of a message. The "value" 388 attribute of these entries must be either "1", "0" or NIL. 390 //vendor/ 391 Defines the top-level of entries associated with a specific body 392 part of a message as created by a particular product of some 393 vendor. This entry can be used by vendors to provide client 394 specific attributes. The vendor-token MUST be registered with 395 IANA. 397 2.2.2 Attribute Names 399 Attribute names MUST be specified in a standards track or IESG 400 approved experimental RFC, or fall under the vendor namespace. See 401 Section 5.1 for the registration template. 403 All attribute names implicitly have a ".priv" and a ".shared" suffix 404 which maps to private and shared versions of the entry. Searching or 405 fetching without using either suffix includes both. The client MUST 406 specify either a ".priv" or ".shared" suffix when storing an 407 annotation. 409 value 410 A UTF8 string representing the data value of the attribute. To 411 delete an annotation, the client can store NIL into the value. 413 size 414 The size of the value, in octets. Set automatically by the server, 415 read-only to clients. 417 content-type 418 A MIME [MIME] content type and subtype that describes the nature 419 of the content of the "value" attribute. If not present, a value 420 of "text/plain; charset=utf8" is assumed. 422 vendor. 423 Defines an attribute associated with a particular product of some 424 vendor. This attribute can be used by vendors to provide client 425 specific attributes. The vendor-token MUST be registered with 426 IANA, using the [ACAP] vendor subtree registry. 428 2.3 Private versus Shared and Access Control 430 Some IMAP mailboxes are private, accessible only to the owning user. 431 Other mailboxes are not, either because the owner has set an ACL 432 [ACL] which permits access by other users, or because it is a shared 433 mailbox. 435 This raises the issue of shared versus private annotations. 437 If all annotations are private, it is impossible to set annotations 438 in a shared or otherwise non-private mailbox that are visible to 439 other users. This eliminates what could be a useful aspect of 440 annotations in a shared environment. An example of such use is a 441 shared IMAP folder containing bug reports. Engineers may want to use 442 annotations to add information to existing messages, indicate 443 assignments, status, etc. This use requires shared annotations. 445 If all annotations are shared, it is impossible to use annotations 446 for private notes on messages in shared mailboxes. Also, modifying an 447 ACL to permit access to a mailbox by other users may unintentionally 448 expose private information. 450 There are also situations in which both shared and private 451 annotations are useful. For example, an administrator may want to set 452 shared annotations on messages in a shared folder, which individual 453 users may wish to supplement with additional notes. 455 If shared and private annotations are to coexist, we need a clear way 456 to differentiate them. Also, it should be as easy as possible for a 457 client to access both and not overlook either. There is also a danger 458 in allowing a client to store an annotation without knowing if it is 459 shared or private. 461 This document proposes two standard suffixes for all attributes: 462 ".shared" and ".priv". A search, fetch, or sort which specifies 463 neither uses both. Store operations MUST explicitly use .priv or 464 .shared suffixes. 466 A user can only store and fetch private annotations on messages in 467 any mailbox which they can SELECT or EXAMINE, including ones which 468 only open READ-ONLY. A user can only store and fetch shared 469 annotations on messages in any mailbox that they can SELECT and which 470 opens READ-WRITE. If a client attempts to store or fetch a shared 471 annotation on a READ-ONLY mailbox, the server MUST respond with a NO 472 response. 474 3. IMAP Protocol Changes 476 3.1 General Considerations 478 The server is allowed to impose limitations on the size of any one 479 annotation or the total number of annotations for a single message. 480 However, the server MUST accept a minimum annotation data size of at 481 least 1024 bytes, and a minimum annotation count per message of at 482 least 10. 484 The server SHOULD indicate the maximum size for an annotation value 485 by sending an untagged "ANNOTATESIZE" response during a SELECT or 486 EXAMINE command. Clients MUST NOT store annotation values of a size 487 greater than the amount indicated by the server in the "ANNOTATESIZE" 488 response. 490 In some cases, servers may be able to offer annotations on some 491 mailboxes and not others, or may be able to provide only read-only 492 annotations on some mailboxes. For mailboxes that cannot have 493 annotations associated with them, the server MUST return an 494 "ANNOTATESIZE" response with a value of "NIL" during the SELECT or 495 EXAMINE command for that mailbox. Clients MUST NOT attempt to fetch 496 or store annotations on any messages in a mailbox for which the 497 "ANNOTATESIZE" response was "NIL". For mailboxes that can only have 498 read-only annotations associated with them, the server MUST return an 499 "ANNOTATESIZE" response with a value of "0" (zero) during the SELECT 500 or EXAMINE command for that mailbox. Clients MUST NOT attempt to 501 store annotations on any messages in a mailbox for which the 502 "ANNOTATESIZE" response was zero. 504 3.2 Optional parameters with the SELECT/EXAMINE commands 506 This extension adds the ability to include one or more parameters 507 with the IMAP SELECT or EXAMINE commands, to turn on or off certain 508 standard behaviour, or to add new optional behaviours required for a 509 particular extension. 511 There are two possible modes of operation: 513 o A global state change where a single use of the optional parameter 514 will effect the session state from that time on, irrespective of 515 subsequent SELECT/EXAMINE commands. 517 o A per-mailbox state change that will effect the session only for 518 the duration of the new selected state. A subsequent SELECT/ 519 EXAMINE without the optional parameter will cancel its effect for 520 the newly selected mailbox. 522 It is anticipated that other extensions may want to use this 523 facility, so a generalised approach is given here. This facility is 524 not dependent on the presence of the ANNOTATE extension - other 525 extensions can use it with a server that does not implement ANNOTATE. 527 Optional parameters to the SELECT or EXAMINE commands are added as a 528 parenthesised list of atoms or strings, and appear after the mailbox 529 name in the standard SELECT or EXAMINE command. The order of 530 individual parameters is arbitrary. Individual parameters may consist 531 of one or more atoms or strings in a specific order. If a parameter 532 consists of more than one atom or string, it MUST appear in its own 533 parenthesised list. Any parameter not defined by extensions that the 534 server supports MUST be rejected with a NO response. 536 Example: 538 C: a SELECT INBOX (ANNOTATE) 539 S: ... 540 S: a OK SELECT complete 542 In the above example, a single parameter is used with the SELECT 543 command. 545 Example: 547 C: a EXAMINE INBOX (ANNOTATE (RESPONSES "UID Responses") CONDSTORE) 548 S: ... 549 S: a OK EXAMINE complete 551 In the above example, three parameters are used with the EXAMINE 552 command. The second parameter consists of two items: an atom 553 followed by a quoted string. 555 Example: 557 C: a SELECT INBOX (BLURDYBLOOP) 558 S: a NO Unknown parameter in SELECT command 560 In the above example, a parameter not supported by the server is 561 incorrectly used. 563 The ANNOTATE extension defines a single optional select parameter 564 "ANNOTATE", which is used to turn on unsolicited responses for 565 annotations as described in Section 3.4. This option al parameter is 566 results in a per-mailbox state change, i.e. it must be used in each 567 SELECT/EXAMINE command in order to be effective, irrespective of 568 whether it was used in a previous SELECT/EXAMINE during the same 569 session. 571 3.3 ANNOTATION Message Data Item in FETCH Command 573 This extension adds an ANNOTATION message data item to the FETCH 574 command. This allows clients to retrieve annotations for a range of 575 messages in the currently selected mailbox. 577 ANNOTATION 579 The ANNOTATION message data item, when used by the client in the 580 FETCH command, takes an entry specifier and an attribute 581 specifier. 583 Example: 585 C: a FETCH 1 (ANNOTATION ("/comment" "value")) 586 S: * 1 FETCH (ANNOTATION ("/comment" 587 ("value.priv" "My comment" 588 "value.shared" "Group note"))) 589 S: a OK Fetch complete 591 In the above example, the content of the "value" attribute for the 592 "/comment" entry is requested by the client and returned by the 593 server. Since neither ".shared" nor ".priv" was specified, both 594 are returned. 596 "*" and "%" wildcard characters can be used in either specifier to 597 match one or more characters at that position, with the exception 598 that "%" does not match the hierarchy delimiter for the specifier it 599 appears in (that is, "/" for an entry specifier or "." for an 600 attribute specifier). Thus an entry specifier of "/%" matches entries 601 such as "/comment" and "/altsubject", but not "/flags/$redirected". 603 Example: 605 C: a FETCH 1 (ANNOTATION ("/*" ("value.priv" "size.priv"))) 606 S: * 1 FETCH (ANNOTATION 607 ("/comment" ("value.priv" "My comment" 608 "size.priv" "10") 609 "/altsubject" ("value.priv" "Rhinoceroses!" 610 "size.priv" "13") 611 "/vendor/foobar/label.priv" 612 ("value.priv" "label43" 613 "size.priv" "7") 614 "/vendor/foobar/personality" 615 ("value.priv" "Tallulah Bankhead" 616 "size.priv" "17"))) 617 S: a OK Fetch complete 619 In the above example, the contents of the private "value" and 620 "size" attributes for any entries in the "" hierarchy are 621 requested by the client and returned by the server. 623 Example: 625 C: a FETCH 1 (ANNOTATION ("/%" "value.shared")) 626 S: * 1 FETCH (ANNOTATION 627 ("/comment" ("value.shared" "Patch Mangler") 628 "/altsubject" ("value.shared" "Patches? We don't 629 need no steenkin patches!"))) 630 S: a OK Fetch complete 632 In the above example, the contents of the shared "value" 633 attributes for entries at the top level only of the "" hierarchy 634 are requested by the client and returned by the server. 636 Entry and attribute specifiers can be lists of atomic specifiers, so 637 that multiple items of each type may be returned in a single FETCH 638 command. 640 Example: 642 C: a FETCH 1 (ANNOTATION 643 (("/comment" "/altsubject") "value.priv")) 644 S: * 1 FETCH (ANNOTATION 645 ("/comment" ("value.priv" "What a chowder-head") 646 "/altsubject" ("value.priv" "How to crush beer cans"))) 647 S: a OK Fetch complete 649 In the above example, the contents of the private "value" 650 attributes for the two entries "/comment" and "/altsubject" are 651 requested by the client and returned by the server. 653 3.4 ANNOTATION Message Data Item in FETCH Response 655 The ANNOTATION message data item in the FETCH response displays 656 information about annotations in a message. 658 ANNOTATION parenthesised list 660 The response consists of a list of entries, each of which has a 661 list of attribute-value pairs. 663 Example: 665 C: a FETCH 1 (ANNOTATION ("/comment" "value")) 666 S: * 1 FETCH (ANNOTATION ("/comment" 667 ("value.priv" "My comment" 668 "value.shared" NIL))) 669 S: a OK Fetch complete 671 In the above example, a single entry with a single attribute-value 672 pair is returned by the server. Since the client did not specify a 673 ".shared" or ".priv" suffix, both are returned. Only the private 674 attribute has a value (the shared value is NIL). 676 Example: 678 C: a FETCH 1 (ANNOTATION 679 (("/comment" "/altsubject") "value")) 680 S: * 1 FETCH (ANNOTATION 681 ("/comment" ("value.priv" "My comment" 682 "value.shared" NIL) 683 "/altsubject" ("value.priv" "My subject" 684 "value.shared" NIL))) 685 S: a OK Fetch complete 687 In the above example, two entries each with a single 688 attribute-value pair are returned by the server. Since the client 689 did not specify a ".shared" or ".priv" suffix, both are returned. 690 Only the private attributes have values; the shared attributes are 691 NIL. 693 Example: 695 C: a FETCH 1 (ANNOTATION 696 ("/comment" ("value" "size"))) 697 S: * 1 FETCH (ANNOTATION 698 ("/comment" 699 ("value.priv" "My comment" 700 "value.shared" NIL 701 "size.priv" "10" 702 "size.shared" "0"))) 703 S: a OK Fetch complete 705 In the above example, a single entry with two attribute-value 706 pairs is returned by the server. Since the client did not specify 707 a ".shared" or ".priv" suffix, both are returned. Only the private 708 attributes have values; the shared attributes are NIL. 710 Servers MUST NOT include ANNOTATION data in unsolicited responses 711 unless the client used the ANNOTATE select parameter when it issued 712 the last SELECT or EXAMINE command. This restriction avoids sending 713 ANNOTATION data to a client unless the client explicitly asks for it. 715 Servers SHOULD send ANNOTATION message data items in unsolicited 716 FETCH responses if an annotation entry is changed by a third-party, 717 and the ANNOTATE select parameter was used. This allows servers to 718 keep clients updated with changes to annotations by other clients. 720 3.5 ANNOTATION Message Data Item in STORE 722 ANNOTATION 724 Sets the specified list of entries by adding or replacing the 725 specified attributes with the values provided. Clients can use NIL 726 for values of attributes it wants to remove from entries. 728 The ANNOTATION message data item used with the STORE command has an 729 implicit ".SILENT" behaviour. This means the server does not generate 730 an untagged FETCH in response to the STORE command and assumes that 731 the client updates its own cache if the command succeeds. 733 If the server is unable to store an annotation because the size of 734 its value is too large, the server MUST return a tagged NO response 735 with a "[ANNOTATE TOOBIG]" response code. 737 If the server is unable to store a new annotation because the maximum 738 number of allowed annotations has already been reached, the server 739 MUST return a tagged NO response with a "[ANNOTATE TOOMANY]" response 740 code. 742 Example: 744 C: a STORE 1 ANNOTATION ("/comment" 745 ("value.priv" "My new comment")) 746 S: a OK Store complete 748 In the above example, the entry "/comment" is created (if not 749 already present) and the private attribute "value" with data set 750 to "My new comment" is created if not already present, or replaced 751 if it exists. 753 Example: 755 C: a STORE 1 ANNOTATION ("/comment" 756 ("value.shared" NIL)) 757 S: a OK Store complete 759 In the above example, the shared "value" attribute of the entry "/ 760 comment" is removed by storing NIL into the attribute. 762 Multiple entries can be set in a single STORE command by listing 763 entry-attribute-value pairs in the list. 765 Example: 767 C: a STORE 1 ANNOTATION ("/comment" 768 ("value.priv" "Get tix Tuesday") 769 "/altsubject" 770 ("value.priv" "Wots On")) 771 S: a OK Store complete 773 In the above example, the entries "/comment" and "/altsubject" are 774 created (if not already present) and the private attribute "value" 775 is created for each entry if not already present, or replaced if 776 they exist. 778 Multiple attributes can be set in a single STORE command by listing 779 multiple attribute-value pairs in the entry list. 781 Example: 783 C: a STORE 1 ANNOTATION ("/comment" 784 ("value.priv" "My new comment" 785 "vendor.foobar.priv" "foo's bar")) 786 S: a OK Store complete 788 In the above example, the entry "/comment" is created (if not already 789 present) and the private attributes "value" and "vendor.foobar" are 790 created if not already present, or replaced if they exist. 792 3.6 ANNOTATION interaction with COPY 794 The COPY command can be used to move messages from one mailbox to 795 another on the same server. Servers that support the ANNOTATION 796 extension MUST, for each message being copied, copy all '.priv' 797 annotation data for the current user only, and all '.shared' 798 annotation data along with the message to the new mailbox. The only 799 exceptions to this are if the destination mailbox permissions are 800 such that either the '.priv' or '.shared' annotations are not 801 allowed, or if the destination mailbox is of a type that does not 802 support annotations or does not support storing of annotations (a 803 mailbox that returns a zero or "NIL" value for its ANNOTATESIZE 804 response code). Servers MUST NOT copy '.priv' annotation data for 805 users other than the current user. 807 3.7 ANNOTATION Message Data Item in APPEND 809 ANNOTATION 811 Sets the specified list of entries and attributes in the resulting 812 message. 814 The APPEND command can include annotations for the message being 815 appended via the addition of a new append data item. The new data 816 item can also be used with the multi-append [MULTIAPPEND] extension 817 that allows multiple messages to be appended via a single APPEND 818 command. 820 Example: 822 C: a APPEND drafts ANNOTATION ("/comment" 823 ("value.priv" "Don't send until we hear from Sally")) {310} 824 S: + Ready for literal data 825 C: MIME-Version: 1.0 826 ... 827 C: 828 S: a OK APPEND completed 830 In the above example, a comment with a private value is added to a 831 new message appended to the mailbox. The ellipsis represents the 832 bulk of the message. 834 3.8 ANNOTATION Criterion in SEARCH 836 ANNOTATION 838 The ANNOTATION criterion for the SEARCH command allows a client to 839 search for a specified string in the value of an annotation entry of 840 a message. 842 Messages that have annotations with entries matching and 843 attributes matching and the specified string 844 in their values are returned in the SEARCH results. The "*" character 845 can be used in the entry or attribute name fields to match any 846 content in those items. The "%" character can be used in the entry or 847 attribute name fields to match a single level of hierarchy only. 849 Example: 851 C: a SEARCH ANNOTATION "/comment" "value" "IMAP4" 852 S: * SEARCH 2 3 5 7 11 13 17 19 23 853 S: a OK Search complete 855 In the above example, the message numbers of any messages 856 containing the string "IMAP4" in the shared or private "value" 857 attribute of the "/comment" entry are returned in the search 858 results. 860 Example: 862 C: a SEARCH ANNOTATION "*" "*" "IMAP4" 863 S: * SEARCH 1 2 3 5 8 13 21 34 864 S: a OK Search complete 866 In the above example, the message numbers of any messages 867 containing the string "IMAP4" in any attribute (public or private) 868 of any entry are returned in the search results. 870 3.9 ANNOTATION Key in SORT 872 ANNOTATION 874 The ANNOTATION criterion for the SORT command [SORT] instructs the 875 server to return the message numbers or UIDs of a mailbox, sorted 876 using the values of the specified annotations. The ANNOTATION 877 criterion is available if the server returns both "ANNOTATE" and 878 "SORT" as supported capabilities in the CAPABILITY command response. 880 Messages are sorted using the values of the 881 attributes in the entries. (The charset argument 882 determines sort order, as specified in the SORT extension 883 description.) 885 Example: 887 C: a SORT (ANNOTATION "/altsubject" "value.shared") UTF-8 ALL 888 S: * SORT 2 3 4 5 1 11 10 6 7 9 8 889 S: a OK Sort complete 891 In the above example, the message numbers of all messages are 892 returned, sorted according to the shared "value" attribute of the 893 "/altsubject" entry. 895 Note that the ANNOTATION sort key must include a fully specified 896 entry and attribute -- wildcards are not allowed. 898 4. Formal Syntax 900 The following syntax specification uses the Augmented Backus-Naur 901 Form (ABNF) notation as specified in [ABNF]. 903 Non-terminals referenced but not defined below are as defined by 904 [IMAP4]. 906 Except as noted otherwise, all alphabetic characters are 907 case-insensitive. The use of upper or lower case characters to define 908 token strings is for editorial clarity only. Implementations MUST 909 accept these strings in a case-insensitive fashion. 911 annotate-param = "ANNOTATE" 912 ; defines the select parameter used with 913 ; ANNOTATE extension 915 append = "APPEND" SP mailbox [SP flag-list] [SP date-time] 916 [SP "ANNOTATION" SP att-annotate] SP literal 917 ; modifies original IMAP4 APPEND command 919 append-message = [SP flag-list] [SP date-time] 920 [SP "ANNOTATION" SP att-annotate] SP literal 921 ; modifies [MULTIAPPEND] extension behaviour 923 att-annotate = "ANNOTATION" SP "(" entry-att *(SP entry-att) ")" 925 att-match = string 926 ; dot-separated attribute name 927 ; MAY contain "*" or "%" for use as wildcards 929 att-value = attrib SP value 931 attrib = string 932 ; dot-separated attribute name 933 ; MUST NOT contain "*" or "%" 935 attribs = att-match / 936 "(" att-match *(SP att-match) ")" 938 entries = entry-match / 939 "(" entry-match *(SP entry-match) ")" 941 entry = string 942 ; slash-separated path to entry 943 ; MUST NOT contain "*" or "%" 945 entry-att = entry SP "(" att-value *(SP att-value) ")" 947 entry-match = string 948 ; slash-separated path to entry 949 ; MAY contain "*" or "%" for use as wildcards 951 examine =/ *(SP "(" select-param *(SP select-param) ")" 952 ; modifies the original IMAP4 examine command to 953 ; accept optional parameters 955 fetch-ann-resp = "ANNOTATION" SP "(" entry-att *(SP entry-att) ")" 957 fetch-att =/ "ANNOTATION" SP "(" entries SP attribs ")" 958 ; modifies original IMAP4 fetch-att 960 resp-text-code =/ "ANNOTATE" SP "TOOBIG" / 961 "ANNOTATE" SP "TOOMANY" / 962 "ANNOTATESIZE" SP (number / "NIL") 963 ; new response codes 965 search-key =/ "ANNOTATION" SP entry-match SP att-match 966 SP value 967 ; modifies original IMAP4 search-key 969 select =/ *(SP "(" select-param *(SP select-param) ")" 970 ; modifies the original IMAP4 select command to 971 ; accept optional parameters 973 select-param = astring / "(" astring SP astring *(SP astring) ")" 974 ; parameters to SELECT may contain one or 975 ; more atoms or strings - multiple items 976 ; are always parenthesised 978 sort-key =/ "ANNOTATION" SP entry SP attrib 979 ; modifies original sort-key [SORT] 981 store-att-flags =/ att-annotate 982 ; modifies original IMAP4 STORE command 984 value = nstring 986 5. IANA Considerations 988 Both entry names and attribute names MUST be specified in a standards 989 track or IESG approved experimental RFC, or fall under the vendor 990 namespace. Vendor names MUST be registered. 992 5.1 Entry and Attribute Registration Template 994 To: iana@iana.org 995 Subject: IMAP Annotate Registration 997 Please register the following IMAP Annotate item: 999 [] Entry [] Attribute 1001 Name: ______________________________ 1003 Description: _______________________ 1005 ____________________________________ 1007 ____________________________________ 1009 Contact person: ____________________ 1011 email: ____________________ 1013 6. Security Considerations 1015 The ANNOTATE extension does not raise any security considerations 1016 that are not present in the base [IMAP4] protocol, and these issues 1017 are discussed in [IMAP4]. 1019 Care must be taken to ensure that annotations whose values are 1020 intended to remain private are not stored in mailboxes which are 1021 accessible to other users. This includes mailboxes owned by the user 1022 by whose ACLs permit access by others as well as any shared 1023 mailboxes. 1025 Normative References 1027 [RFC1891] Moore, K., "SMTP Service Extension for Delivery Status 1028 Notifications", RFC 1891, January 1996. 1030 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1031 Requirement Levels", BCP 14, RFC 2119, March 1997. 1033 [RFC2234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 1034 Specifications: ABNF", RFC 2234, November 1997. 1036 [RFC2244] Newman, C. and J. Myers, "ACAP -- Application 1037 Configuration Access Protocol", RFC 2244, November 1997. 1039 [RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 1040 4rev1", RFC 3501, March 2003. 1042 [RFC3502] Crispin, M., "Internet Message Access Protocol (IMAP) - 1043 MULTIAPPEND Extension", RFC 3502, March 2003. 1045 [RFC3503] Melnikov, A., "Message Disposition Notification (MDN) 1046 profile for Internet Message Access Protocol (IMAP)", RFC 1047 3503, March 2003. 1049 [SORT] Crispin, M. and K. Murchison, "Internet Message Access 1050 Protocol - Sort and Thread Extension", 1051 draft-ietf-imapext-sort-15.txt, April 2004. 1053 Informative References 1055 [CONDSTORE] 1056 Melnikov, A. and S. Hole, "IMAP Extension for Conditional 1057 STORE operation", draft-ietf-imapext-condstore-05.txt, 1058 April 2004. 1060 [RFC2086] Myers, J., "IMAP4 ACL extension", RFC 2086, January 1997. 1062 Authors' Addresses 1064 Randall Gellens 1065 QUALCOMM Incorporated 1066 5775 Morehouse Dr. 1067 San Diego, CA 92121-2779 1068 US 1070 EMail: randy@qualcomm.com 1071 Cyrus Daboo 1072 Cyrusoft International, Inc. 1073 5001 Baum Blvd. 1074 Suite 650 1075 Pittsburgh, PA 15213 1076 US 1078 EMail: daboo@cyrusoft.com 1080 Appendix A. Acknowledgments 1082 Many thanks to Chris Newman for his detailed comments on the first 1083 draft of this document, and to the participants at the ACAP working 1084 dinner in Pittsburgh. 1086 Intellectual Property Statement 1088 The IETF takes no position regarding the validity or scope of any 1089 intellectual property or other rights that might be claimed to 1090 pertain to the implementation or use of the technology described in 1091 this document or the extent to which any license under such rights 1092 might or might not be available; neither does it represent that it 1093 has made any effort to identify any such rights. Information on the 1094 IETF's procedures with respect to rights in standards-track and 1095 standards-related documentation can be found in BCP-11. Copies of 1096 claims of rights made available for publication and any assurances of 1097 licenses to be made available, or the result of an attempt made to 1098 obtain a general license or permission for the use of such 1099 proprietary rights by implementors or users of this specification can 1100 be obtained from the IETF Secretariat. 1102 The IETF invites any interested party to bring to its attention any 1103 copyrights, patents or patent applications, or other proprietary 1104 rights which may cover technology that may be required to practice 1105 this standard. Please address the information to the IETF Executive 1106 Director. 1108 Full Copyright Statement 1110 Copyright (C) The Internet Society (2004). All Rights Reserved. 1112 This document and translations of it may be copied and furnished to 1113 others, and derivative works that comment on or otherwise explain it 1114 or assist in its implementation may be prepared, copied, published 1115 and distributed, in whole or in part, without restriction of any 1116 kind, provided that the above copyright notice and this paragraph are 1117 included on all such copies and derivative works. However, this 1118 document itself may not be modified in any way, such as by removing 1119 the copyright notice or references to the Internet Society or other 1120 Internet organizations, except as needed for the purpose of 1121 developing Internet standards in which case the procedures for 1122 copyrights defined in the Internet Standards process must be 1123 followed, or as required to translate it into languages other than 1124 English. 1126 The limited permissions granted above are perpetual and will not be 1127 revoked by the Internet Society or its successors or assignees. 1129 This document and the information contained herein is provided on an 1130 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING 1131 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING 1132 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION 1133 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF 1134 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 1136 Acknowledgment 1138 Funding for the RFC Editor function is currently provided by the 1139 Internet Society.