idnits 2.17.1 draft-ietf-imapext-annotate-07.txt: ** The Abstract section seems to be numbered 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: ---------------------------------------------------------------------------- ** The document seems to lack a 1id_guidelines paragraph about the list of Shadow Directories. == No 'Intended status' indicated for this document; assuming Proposed Standard Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an Introduction section. ** There are 6 instances of too long lines in the document, the longest one being 8 characters in excess of 72. ** The abstract seems to contain references ([IMAP4]), 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 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 (May 2003) is 7652 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: 'ANNOTATE TOOBIG' is mentioned on line 96, but not defined == Missing Reference: 'ANNOTATE TOOMANY' is mentioned on line 96, but not defined == Missing Reference: 'MIME' is mentioned on line 411, but not defined == Unused Reference: 'SMTP-DSN' is defined on line 989, but no explicit reference was found in the text ** Obsolete normative reference: RFC 2234 (ref. 'ABNF') (Obsoleted by RFC 4234) -- Possible downref: Non-RFC (?) normative reference: ref. 'CONDSTORE' ** Obsolete normative reference: RFC 3501 (ref. 'IMAP4') (Obsoleted by RFC 9051) ** Obsolete normative reference: RFC 1891 (ref. 'SMTP-DSN') (Obsoleted by RFC 3461) -- Possible downref: Non-RFC (?) normative reference: ref. 'SORT' ** Obsolete normative reference: RFC 2086 (ref. 'ACL') (Obsoleted by RFC 4314) Summary: 10 errors (**), 0 flaws (~~), 6 warnings (==), 5 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 IMAP Extensions Working Group R. Gellens 2 Internet Draft: IMAP ANNOTATE Extension C. Daboo 3 Document: draft-ietf-imapext-annotate-07.txt May 2003 5 IMAP ANNOTATE Extension 7 Status of this Memo 9 This document is an Internet-Draft and is in full conformance with 10 all provisions of Section 10 of RFC2026. 12 Internet-Drafts are working documents of the Internet Engineering 13 Task Force (IETF), its areas, and its working groups. Note that 14 other groups may also distribute working documents as 15 Internet-Drafts. 17 Internet-Drafts are draft documents valid for a maximum of six 18 months and may be updated, replaced, or obsoleted by other documents 19 at any time. It is inappropriate to use Internet-Drafts as 20 reference material or to cite them other than as "work in progress." 22 The list of current Internet-Drafts can be accessed at 23 http://www.ietf.org/ietf/1id-abstracts.txt. 25 The list of Internet- Draft Shadow Directories can be accessed at 26 http://www.ietf.org/shadow.html. 28 Copyright Notice 30 Copyright (C) The Internet Society 2003. All Rights Reserved. 32 Table of Contents 33 1 Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . 2 34 2 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . 2 35 3 Conventions Used in This Document . . . . . . . . . . . . . . 2 36 4 Change History . . . . . . . . . . . . . . . . . . . . . . . 3 37 5 Introduction and Overview . . . . . . . . . . . . . . . . . . 4 38 6 Data Model . . . . . . . . . . . . . . . . . . . . . . . . . 5 39 6.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . 5 40 6.2 Namespace of Entries and Attributes . . . . . . . . . . 6 41 6.2.1 Entry Names . . . . . . . . . . . . . . . . . . . . . 6 42 6.2.2 Attribute Names . . . . . . . . . . . . . . . . . . 8 43 7 Private versus Shared and Access Control . . . . . . . . . . 9 44 8 IMAP Protocol Changes . . . . . . . . . . . . . . . . . . . 10 45 8.1 General considerations . . . . . . . . . . . . . . . . . 10 46 8.2 Optional parameters with the SELECT/EXAMINE commands . . 10 47 8.3 ANNOTATION Message Data Item in FETCH Command . . . . . . 11 48 8.4 ANNOTATION Message Data Item in FETCH Response . . . . . 13 49 8.5 ANNOTATION Message Data Item in STORE . . . . . . . . . . 14 50 8.6 ANNOTATION interaction with COPY . . . . . . . . . . . . 15 51 8.7 ANNOTATION Message Data Item in APPEND . . . . . . . . . 16 52 8.8 ANNOTATION Criterion in SEARCH . . . . . . . . . . . . . 16 53 8.9 ANNOTATION Key in SORT . . . . . . . . . . . . . . . . . 17 54 9 Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . 17 55 10 IANA Considerations . . . . . . . . . . . . . . . . . . . . . 19 56 10.1 Entry and Attribute Registration Template . . . . . . . 19 57 11 Security Considerations . . . . . . . . . . . . . . . . . . . 20 58 12 Normative References . . . . . . . . . . . . . . . . . . . . 20 59 13 Informative References . . . . . . . . . . . . . . . . . . . 21 60 14 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . 21 61 15 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . 21 62 16 Full Copyright Statement . . . . . . . . . . . . . . . . . . 21 64 1 Abstract 66 The ANNOTATE extension to the Internet Message Access Protocol 67 [IMAP4] permits clients and servers to maintain "metadata" for 68 messages stored in an IMAP4 mailbox. 70 2 Discussion 72 Public comments can be sent to the IETF IMAP Extensions mailing 73 list, . To subscribe, send a message to 74 with the word SUBSCRIBE as the body. 75 Private comments should be sent to the authors. 77 3 Conventions Used in This Document 79 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 80 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 81 document are to be interpreted as described in RFC 2119 [KEYWORDS]. 83 Formal syntax is defined using ABNF [ABNF] as modified by [IMAP4]. 85 In examples, "C:" and "S:" indicate lines sent by the client and 86 server respectively. Line breaks not preceded by a "C:" or "S:" are 87 for editorial clarity only. 89 4 Change History 91 Changes from -06 to -07: 92 1. Added text to state entry and attribute names are always 93 case-insensitive. 94 2. Removed top-level entry namespace. 95 3. Added server accept minima for annotation size and count. 96 4. Added [ANNOTATE TOOBIG] & [ANNOTATE TOOMANY] response codes. 97 5. Added [ANNOTATESIZE <>] response code. 98 6. Added comment on suggested CONDSTORE support. 99 7. Modified append behaviour to account for MULTIAPPEND. 100 8. Tweaked ABNF. 102 Changes from -05 to -06: 103 1. Split references into Normative and Informative. 104 2. Reworked flags to allow IMAP4 flag prefix to appear in annotation name. 105 3. Removed smtp-envelope annotation - a future extension can add this. 106 4. Changed subject to altsubject. 107 5. Added $MDNSent flag and reference to document. 108 6. Cleaned up formal syntax to use IMAP string type for entry 109 and attributes, with requirements on how the string is formatted. 110 7. Use of ACAP vendor subtree registry for vendor tokens. 111 8. Fixed STORE syntax. 113 Changes from -04 to -05: 114 1. Fixed examples to match formal syntax for FETCH responses where 115 parenthesis do not appear around entry-att items. 117 Changes from -03 to -04: 118 1. Fixed attrib/attrib-match grammar to use "." instead of "/". 119 2. Add text for server to reject unknown . 120 3. Do not allow empty part-specifier. 121 4. Store NIL to value to delete. 122 5. Comment on COPY interaction with ANNOTATE. 123 6. Added comment that IMAP flags are mapped one-to-one with their 124 corresponding FLAGS items. 125 7. Added comment that the recent flag annotation is read-only. 127 Changes from -02 to -03: 128 1. Removed reference to status modtime item. 129 2. Added missing 'notify' and 'ret' dsn annotations for 130 /message/smtp-envelope. 131 3. Added requirement to store data permanently - no 132 'session only' annotations. 133 4. Removed Access Control section. Replaced with comments 134 on read-only/read-write mailboxes and storing private or 135 shared annotations. 136 5. Removed STORE to default .priv or .shared. 137 6. Added section on optional select parameters. 139 Changes from -01 to -02: 140 1. Now require .priv or .shared on store operations. 142 Changes from -00 to -01: 143 1. MODTIME moved to its own draft, which this draft now 144 depends on. Thus, Conditional Annotation STORE and 145 related items deleted from this draft. 146 2. Private versus Shared Annotations: both are possible 147 (separately addressable using ".priv" and ".shared" 148 suffixes). There is a per-mailbox setting for the 149 default. It is an open issue how this is viewed or 150 changed by the client. 151 3. In ACLs, the "w" right is needed to updated shared state; 152 the "s" right is needed to update private state. 153 4. Various clarifications and text modifications. 154 5. Added 'forwarded' flag for message parts. 156 Changes from pre-imapext to -00: 157 1. Clarified text describing attributions, entries, and 158 attributes. 159 2. Changed 'modifiedsince' to 'modtime'; referenced ACAP spec. 160 3. Deleted 'queued' flag. 161 4. Expanded and explained smtp-envelope entry. 162 5. Restricted including ANNOTATION data in unsolicited responses 163 until the client uses it first. (Open issue as to if needed). 164 6. Examples now only use valid entries and attributes. 165 7. Updated Security Considerations. 166 8. Content-Type now defaults to text/plain. 167 9. Open Issue: Shared vs. private annotations. 168 10. Open issue: Annotation Modtime untagged response or VALIDTIME 169 FETCH data. 170 11. Open issue: Conditional annotation STORE. 171 12. ANNOTATION criterion available if both "ANNOTATE" and "SORT" 172 in CAPABILITY command response. 173 13. Prohibition on annotations in lieu of base spec functionality. 174 14. Specified required ACL rights. 175 15. ANNOTATION message data item in APPEND. 176 16. ANNOTATION-MODTIME message data item in STATUS. 177 17. Replaced ATOM_CHAR with utf8-char. 178 18. Updated other ABNF entries. 180 5 Introduction and Overview 182 The ANNOTATE extension is present in any IMAP4 implementation which 183 returns "ANNOTATE" as one of the supported capabilities in the 184 CAPABILITY response. 186 The ANNOTATE extension adds a new message data item to the FETCH and 187 STORE commands, as well as adding SEARCH and SORT keys and an APPEND 188 modifier. 190 This extension makes the following changes to the IMAP4 protocol: 192 a) adds a new ANNOTATION message data item for use in FETCH 193 b) adds a new ANNOTATION message data item for use in STORE 194 c) adds a new ANNOTATION search criterion for use in SEARCH 195 d) adds a new ANNOTATION sort key for use in SORT extension 196 e) adds a new ANNOTATION data item for use in APPEND 197 f) adds a new requirement on the COPY command 198 g) adds a extension mechanism for adding parameters to the 199 SELECT/EXAMINE commands and defines the ANNOTATE parameter 200 h) adds two new response codes to indicate store failures of 201 annotations. 202 i) adds a new untagged response codes for the SELECT or EXAMINE 203 commands to indicate the maximum size. 205 The data model used for the storage of annotations is based on that 206 of the Application Configuration Access Protocol [ACAP]. Note that 207 there is no inheritance in annotations. 209 Clients MUST NOT use annotations in lieu of equivalent IMAP base 210 specification facilities. For example, use of a "seen" flag in the 211 vendor namespace together with ".PEEK" in fetches. Such behaviour 212 would significantly reduce IMAP interoperability. 214 If a server supports annotations, then it MUST store all annotation 215 data permanently, i.e. there is no concept of 'session only' 216 annotations that would correspond to the behaviour of 'session' 217 flags as defined in the IMAP base specification. The exception to 218 this is IMAP flags (which are accessible directly through 219 annotations) which may be 'session only' as determined by the FLAGS 220 and PERMANENTFLAGS responses to a SELECT or EXAMINE command. 222 This extension also introduces a generalised mechanism for adding 223 parameters to the SELECT or EXAMINE commands. It is anticipated 224 that other extensions may want to utilise this, so it is not 225 strictly dependent on the ANNOTATE extension being present. 227 In order to provide optimum support for a disconnected client (one 228 that needs to synchronise annotations for use when offline), servers 229 SHOULD also support the Conditional STORE [CONDSTORE] extension. 231 The rest of this document describes the data model and protocol 232 changes more rigorously. 234 6 Data Model 235 6.1 Overview 237 The data model used in ANNOTATE is that of a uniquely named entry 238 which contains a set of standard attributes. A single coherent unit 239 of "metadata" for a message is stored as a single entry, made up of 240 several attributes. 242 For example, a comment added to a message has an entry name of 243 "/comment". This entry is composed of several attributes such as 244 "value", "size", etc. which contain the properties and data of the 245 entry. 247 The protocol changes to IMAP described below allow a client to 248 access or change the values of any attributes in any entries in a 249 message annotation, assuming it has sufficient access rights to do 250 so (see Section 7 for specifics). 252 6.2 Namespace of Entries and Attributes 254 Each message annotation is made up of a set of entries. Each entry 255 has a hierarchical name in UTF-8, with each component of the name 256 separated by a slash ("/"). 258 Each entry is made up of a set of attributes. Each attribute has a 259 hierarchical name in UTF-8, with each component of the name 260 separated by a period ("."). 262 The value of an attribute is NIL (has no value), or is a string of 263 zero or more octets. 265 Entry and attribute names MUST NOT contain asterisk ("*") or percent 266 ("%") characters and MUST be valid UTF-8 strings which do not 267 contain the NULL octet. Invalid entry or attribute names result in 268 a BAD response in any IMAP commands where they are used. 270 Entry and attribute names are case-insensitive. 272 Use of non-visible UTF-8 characters in entry and attribute names is 273 strongly discouraged. 275 This specification defines an initial set of entry and attribute 276 names available for use in message annotations. In addition, an 277 extension mechanism is described to allow additional names to be 278 added for extensibility. 280 6.2.1 Entry Names 282 Entry names MUST be specified in a standards track or IESG approved 283 experimental RFC, or fall under the vendor namespace. See Section 284 10.1 for the registration template. 286 / 287 Defines the top-level of entries associated with an entire 288 message. This entry itself does not contain any attributes. 289 All entries that start with a numeric character ("0" - "9") 290 refer to an annotation on a specific body part. All other 291 entries are for annotations on the entire message. 293 /comment 294 Defines a comment or note associated with an entire message. 296 /flags 297 Defines the top-level of entries for flags associated with an 298 entire message. The "value" attribute of each of the entries 299 described below must be either "1", "0" or NIL. "1" corresponds 300 to the flag being set. 302 Standard [IMAP4] flags always have a '\' prefix character. 303 Other standard flags have a '$' prefix. The annotation names 304 used for all flags uses the complete name for that flag, 305 including the prefix character. 307 The set of standard IMAP flags annotations are: 309 /flags/\answered 310 /flags/\flagged 311 /flags/\deleted 312 /flags/\seen 313 /flags/\draft 314 /flags/\recent 316 Changes to these annotations are reflected in the standard IMAP 317 flags. The \recent attribute is read only, clients MUST NOT 318 attempt to change it. 320 Note that entry names are sent as [IMAP4] string elements which 321 requires that '\' characters be escaped if sent as a quoted 322 string as opposed to a literal. 324 Additional standard flags are: 326 /flags/$mdnsent 327 /flags/$redirected 328 /flags/$forwarded 330 The '$mdnsent' flag is used to indicate message disposition 331 notification processing state [MDNSENT]. 333 The '$redirected' flag indicates that a message has been handed 334 off to someone else, by resending the message with minimal 335 alterations, and in such a way that a reply by the new recipient 336 is addressed to the original author, not the user who performed 337 the redirection. 339 The '$forwarded' flag indicates the message was resent to 340 another user, embedded within or attached to a new message. 342 /altsubject 343 Contains text supplied by the message recipient, to be used by 344 the client instead of the original message Subject. 346 /vendor/ 347 Defines the top-level of entries associated with an entire 348 message as created by a particular product of some vendor. 349 These sub-entries can be used by vendors to provide 350 client-specific attributes. The vendor-token MUST be registered 351 with IANA, using the [ACAP] vendor subtree registry. 353 / 354 Defines the top-level of entries associated with a specific body 355 part of a message. This entry itself does not contain any 356 attributes. The section-part uses the same numeric part 357 specifier syntax as the BODY message data item in the FETCH 358 command [IMAP4]. The server MUST return a BAD response if the 359 client uses an incorrect part specifier (either incorrect syntax 360 or a specifier referring to a non-existent part). The server 361 MUST return a BAD response if the client uses an empty part 362 specifier (which is used in [IMAP4] to represent the entire 363 message). 365 //comment 366 Defines a comment or note associated with a specific body part 367 of a message. 369 //flags 370 Defines the top-level of entries associated with flag state for 371 a specific body part of a message. All sub-entries are 372 maintained entirely by the client. There is no implicit change 373 to any flag by the server. 375 //flags/seen 376 //flags/answered 377 //flags/flagged 378 //flags/forwarded 379 Defines flags for a specific body part of a message. The 380 "value" attribute of these entries must be either "1", "0" or 381 NIL. 383 //vendor/ 384 Defines the top-level of entries associated with a specific body 385 part of a message as created by a particular product of some 386 vendor. This entry can be used by vendors to provide client 387 specific attributes. The vendor-token MUST be registered with 388 IANA. 390 6.2.2 Attribute Names 392 Attribute names MUST be specified in a standards track or IESG 393 approved experimental RFC, or fall under the vendor namespace. See 394 Section 10.1 for the registration template. 396 All attribute names implicitly have a ".priv" and a ".shared" suffix 397 which maps to private and shared versions of the entry. Searching 398 or fetching without using either suffix includes both. The client 399 MUST specify either a ".priv" or ".shared" suffix when storing an 400 annotation. 402 value 403 A UTF8 string representing the data value of the attribute. To 404 delete an annotation, the client can store NIL into the value. 406 size 407 The size of the value, in octets. Set automatically by the 408 server, read-only to clients. 410 content-type 411 A MIME [MIME] content type and subtype that describes the nature 412 of the content of the "value" attribute. If not present, a 413 value of "text/plain; charset=utf8" is assumed. 415 vendor. 416 Defines an attribute associated with a particular product of 417 some vendor. This attribute can be used by vendors to provide 418 client specific attributes. The vendor-token MUST be registered 419 with IANA, using the [ACAP] vendor subtree registry. 421 7 Private versus Shared and Access Control 423 Some IMAP mailboxes are private, accessible only to the owning user. 424 Other mailboxes are not, either because the owner has set an ACL 425 [ACL] which permits access by other users, or because it is a shared 426 mailbox. 428 This raises the issue of shared versus private annotations. 430 If all annotations are private, it is impossible to set annotations 431 in a shared or otherwise non-private mailbox that are visible to 432 other users. This eliminates what could be a useful aspect of 433 annotations in a shared environment. An example of such use is a 434 shared IMAP folder containing bug reports. Engineers may want to 435 use annotations to add information to existing messages, indicate 436 assignments, status, etc. This use requires shared annotations. 438 If all annotations are shared, it is impossible to use annotations 439 for private notes on messages in shared mailboxes. Also, modifying 440 an ACL to permit access to a mailbox by other users may 441 unintentionally expose private information. 443 There are also situations in which both shared and private 444 annotations are useful. For example, an administrator may want to 445 set shared annotations on messages in a shared folder, which 446 individual users may wish to supplement with additional notes. 448 If shared and private annotations are to coexist, we need a clear 449 way to differentiate them. Also, it should be as easy as possible 450 for a client to access both and not overlook either. There is also 451 a danger in allowing a client to store an annotation without knowing 452 if it is shared or private. 454 This document proposes two standard suffixes for all attributes: 455 ".shared" and ".priv". A search, fetch, or sort which specifies 456 neither uses both. Store operations MUST explicitly use .priv or 457 .shared suffixes. 459 A user can only store and fetch private annotations on messages in 460 any mailbox which they can SELECT or EXAMINE, including ones which 461 only open READ-ONLY. A user can only store and fetch shared 462 annotations on messages in any mailbox that they can SELECT and 463 which opens READ-WRITE. If a client attempts to store or fetch a 464 shared annotation on a READ-ONLY mailbox, the server MUST respond 465 with a NO response. 467 8 IMAP Protocol Changes 469 8.1 General considerations 471 The server is allowed to impose limitations on the size of any one 472 annotation or the total number of annotations for a single message. 473 However, the server MUST accept a minimum annotation data size of at 474 least 1024 bytes, and a minimum annotation count per message of at 475 least 10. 477 The server SHOULD indicate the maximum size for an annotation value 478 by sending an untagged "ANNOTATESIZE" response during a SELECT or 479 EXAMINE command. Clients MUST NOT store annotation values of a size 480 greater than the amount indicated by the server in the 481 "ANNOTATESIZE" response. 483 In some cases, servers may be able to offer annotations on some 484 mailboxes and not others. For mailboxes that cannot have 485 annotations associated with them, the server MUST return an 486 "ANNOTATESIZE" response with a value of "0" (zero) during the SELECT 487 or EXAMINE command for that mailbox. Clients MUST NOT attempt to 488 fetch or store annotations on any messages in a mailbox for which 489 the "ANNOTATESIZE" response was zero. 491 8.2 Optional parameters with the SELECT/EXAMINE commands 493 This extension adds the ability to include one or more parameters 494 with the IMAP SELECT or EXAMINE commands, to turn on or off certain 495 standard behaviour, or to add new optional behaviours required for a 496 particular extension. It is anticipated that other extensions may 497 want to use this facility, so a generalised approach is given here. 498 This facility is not dependent on the presence of the ANNOTATE 499 extension - other extensions can use it with a server that does not 500 implement ANNOTATE. 502 Optional parameters to the SELECT or EXAMINE commands are added as a 503 parenthesised list of atoms or strings, and appear after the mailbox 504 name in the standard SELECT or EXAMINE command. The order of 505 individual parameters is arbitrary. Individual parameters may 506 consist of one or more atoms or strings in a specific order. If a 507 parameter consists of more than one atom or string, it MUST appear 508 in its own parenthesised list. Any parameter not defined by 509 extensions that the server supports MUST be rejected with a NO 510 response. 512 Example: 513 C: a SELECT INBOX (ANNOTATE) 514 S: ... 515 S: a OK SELECT complete 517 In the above example, a single parameter is used with the 518 SELECT command. 520 C: a EXAMINE INBOX (ANNOTATE (RESPONSES "UID Responses") MODTIME) 521 S: ... 522 S: a OK EXAMINE complete 524 In the above example, three parameters are used with the 525 EXAMINE command. The second parameter consists of two 526 items: an atom followed by a quoted string. 528 C: a SELECT INBOX (BLURDYBLOOP) 529 S: a NO Unknown parameter in SELECT command 531 In the above example, a parameter not supported by the 532 server is incorrectly used. 534 The ANNOTATE extension defines a single optional select parameter 535 "ANNOTATE", which is used to turn on unsolicited responses for 536 annotations as described in Section 8.4. 538 8.3 ANNOTATION Message Data Item in FETCH Command 540 This extension adds an ANNOTATION message data item to the FETCH 541 command. This allows clients to retrieve annotations for a range of 542 messages in the currently selected mailbox. 544 ANNOTATION 545 The ANNOTATION message data item, when used by the client in the 546 FETCH command, takes an entry specifier and an attribute 547 specifier. 549 Example: 550 C: a FETCH 1 (ANNOTATION ("/comment" "value")) 551 S: * 1 FETCH (ANNOTATION ("/comment" 552 ("value.priv" "My comment" 553 "value.shared" "Group note"))) 554 S: a OK Fetch complete 556 In the above example, the content of the "value" attribute 557 for the "/comment" entry is requested by the client and 558 returned by the server. Since neither ".shared" nor ".priv" 559 was specified, both are returned. 561 "*" and "%" wildcard characters can be used in either specifier to 562 match one or more characters at that position, with the exception 563 that "%" does not match the hierarchy delimiter for the specifier it 564 appears in (that is, "/" for an entry specifier or "." for an 565 attribute specifier). Thus an entry specifier of "/%" matches 566 entries such as "/comment" and "/subject", but not 567 "/flags/$redirected". 569 Examples: 570 C: a FETCH 1 (ANNOTATION ("/*" ("value.priv" "size.priv"))) 571 S: * 1 FETCH (ANNOTATION 572 ("/comment" ("value.priv" "My comment" 573 "size.priv" "10") 574 "/subject" ("value.priv" "Rhinoceroses!" 575 "size.priv" "13") 576 "/vendor/foobar/label.priv" 577 ("value.priv" "label43" 578 "size.priv" "7") 579 "/vendor/foobar/personality" 580 ("value.priv" "Tallulah Bankhead" 581 "size.priv" "17"))) 582 S: a OK Fetch complete 584 In the above example, the contents of the private "value" and "size" 585 attributes for any entries in the "" hierarchy are requested by the 586 client and returned by the server. 588 C: a FETCH 1 (ANNOTATION ("/%" "value.shared")) 589 S: * 1 FETCH (ANNOTATION 590 ("/comment" ("value.shared" "Patch Mangler") 591 "/subject" ("value.shared" "Patches? We don't 592 need no steenkin patches!"))) 593 S: a OK Fetch complete 594 In the above example, the contents of the shared "value" 595 attributes for entries at the top level only of the "" 596 hierarchy are requested by the client and returned by the 597 server. 599 Entry and attribute specifiers can be lists of atomic specifiers, so 600 that multiple items of each type may be returned in a single FETCH 601 command. 603 Examples: 604 C: a FETCH 1 (ANNOTATION 605 (("/comment" "/subject") "value.priv")) 606 S: * 1 FETCH (ANNOTATION 607 ("/comment" ("value.priv" "What a chowder-head") 608 "/subject" ("value.priv" "How to crush beer cans"))) 609 S: a OK Fetch complete 611 In the above example, the contents of the private "value" attributes 612 for the two entries "/comment" and "/subject" are requested by the 613 client and returned by the server. 615 8.4 ANNOTATION Message Data Item in FETCH Response 617 The ANNOTATION message data item in the FETCH response displays 618 information about annotations in a message. 620 ANNOTATION parenthesised list 622 The response consists of a list of entries, each of which has a 623 list of attribute-value pairs. 625 Examples: 626 C: a FETCH 1 (ANNOTATION ("/comment" "value")) 627 S: * 1 FETCH (ANNOTATION ("/comment" 628 ("value.priv" "My comment" 629 "value.shared" NIL))) 630 S: a OK Fetch complete 632 In the above example, a single entry with a single attribute-value 633 pair is returned by the server. Since the client did not specify a 634 ".shared" or ".priv" suffix, both are returned. Only the private 635 attribute has a value (the shared value is NIL). 637 C: a FETCH 1 (ANNOTATION 638 (("/comment" "/subject") "value")) 639 S: * 1 FETCH (ANNOTATION 640 ("/comment" ("value.priv" "My comment" 641 "value.shared" NIL) 642 "/subject" ("value.priv" "My subject" 643 "value.shared" NIL))) 644 S: a OK Fetch complete 645 In the above example, two entries each with a single attribute-value 646 pair are returned by the server. Since the client did not specify a 647 ".shared" or ".priv" suffix, both are returned. Only the private 648 attributes have values; the shared attributes are NIL. 650 C: a FETCH 1 (ANNOTATION 651 ("/comment" ("value" "size"))) 652 S: * 1 FETCH (ANNOTATION 653 ("/comment" 654 ("value.priv" "My comment" 655 "value.shared" NIL 656 "size.priv" "10" 657 "size.shared" "0"))) 658 S: a OK Fetch complete 660 In the above example, a single entry with two attribute-value pairs 661 is returned by the server. Since the client did not specify a 662 ".shared" or ".priv" suffix, both are returned. Only the private 663 attributes have values; the shared attributes are NIL. 665 Servers MUST NOT include ANNOTATION data in unsolicited responses 666 unless the client used the ANNOTATE select parameter when it issued 667 the last SELECT or EXAMINE command. This restriction avoids sending 668 ANNOTATION data to a client unless the client explicitly asks for 669 it. 671 Servers SHOULD send ANNOTATION message data items in unsolicited 672 FETCH responses if an annotation entry is changed by a third-party, 673 and the ANNOTATE select parameter was used. This allows servers to 674 keep clients updated with changes to annotations by other clients. 676 8.5 ANNOTATION Message Data Item in STORE 678 ANNOTATION 679 Sets the specified list of entries by adding or replacing the 680 specified attributes with the values provided. Clients can use 681 NIL for values of attributes it wants to remove from entries. 683 The ANNOTATION message data item used with the STORE command has an 684 implicit ".SILENT" behaviour. This means the server does not 685 generate an untagged FETCH in response to the STORE command and 686 assumes that the client updates its own cache if the command 687 succeeds. 689 If the server is unable to store an annotation because the size of 690 its value is too large, the server MUST return a tagged NO response 691 with a "[ANNOTATE TOOBIG]" response code. 693 If the server is unable to store a new annotation because the 694 maximum number of allowed annotations has already been reached, the 695 server MUST return a tagged NO response with a "[ANNOTATE TOOMANY]" 696 response code. 698 Examples: 699 C: a STORE 1 ANNOTATION ("/comment" 700 ("value.priv" "My new comment")) 701 S: a OK Store complete 703 In the above example, the entry "/comment" is created (if not 704 already present) and the private attribute "value" with data set to 705 "My new comment" is created if not already present, or replaced if 706 it exists. 708 C: a STORE 1 ANNOTATION ("/comment" 709 ("value.shared" NIL)) 710 S: a OK Store complete 712 In the above example, the shared "value" attribute of the entry 713 "/comment" is removed by storing NIL into the attribute. 715 Multiple entries can be set in a single STORE command by listing 716 entry-attribute-value pairs in the list. 718 Example: 719 C: a STORE 1 ANNOTATION ("/comment" 720 ("value.priv" "Get tix Tuesday") 721 "/subject" 722 ("value.priv" "Wots On")) 723 S: a OK Store complete 725 In the above example, the entries "/comment" and "/subject" are 726 created (if not already present) and the private attribute "value" 727 is created for each entry if not already present, or replaced if 728 they exist. 730 Multiple attributes can be set in a single STORE command by listing 731 multiple attribute-value pairs in the entry list. 733 Example: 734 C: a STORE 1 ANNOTATION ("/comment" 735 ("value.priv" "My new comment" 736 "vendor.foobar.priv" "foo's bar")) 737 S: a OK Store complete 739 In the above example, the entry "/comment" is created (if not 740 already present) and the private attributes "value" and 741 "vendor.foobar" are created if not already present, or replaced if 742 they exist. 744 8.6 ANNOTATION interaction with COPY 745 The COPY command can be used to move messages from one mailbox to 746 another on the same server. Servers that support the ANNOTATION 747 extension MUST copy all the annotation data associated with any 748 messages being copied via the COPY command. The only exceptions to 749 this are if the destination mailbox permissions are such that either 750 the '.priv' or '.shared' annotations are not allowed, or if the 751 destination mailbox is of a type that does not support annotations 752 (and returns a zero value for its ANNOTATESIZE response code). 754 8.7 ANNOTATION Message Data Item in APPEND 756 ANNOTATION 757 Sets the specified list of entries and attributes in the 758 resulting message. 760 The APPEND command can include annotations for the message being 761 appended via the addition of a new append data item. The new data 762 item can also be used with the multi-append [MULTIAPPEND] extension 763 that allows multiple messages to be appended via a single APPEND 764 command. 766 Examples: 767 C: a APPEND drafts ANNOTATION ("/comment" 768 ("value.priv" "Don't send until we hear from Sally")) {310} 769 S: + Ready for literal data 770 C: MIME-Version: 1.0 771 ... 772 C: 773 S: a OK APPEND completed 775 In the above example, a comment with a private value is added to a 776 new message appended to the mailbox. The ellipsis represents the 777 bulk of the message. 779 8.8 ANNOTATION Criterion in SEARCH 781 ANNOTATION 783 The ANNOTATION criterion for the SEARCH command allows a client to 784 search for a specified string in the value of an annotation entry of 785 a message. 787 Messages that have annotations with entries matching 788 and attributes matching and the specified string 789 in their values are returned in the SEARCH results. The "*" 790 character can be used in the entry or attribute name fields to match 791 any content in those items. The "%" character can be used in the 792 entry or attribute name fields to match a single level of hierarchy 793 only. 795 Examples: 796 C: a SEARCH ANNOTATION "/comment" "value" "IMAP4" 797 S: * SEARCH 2 3 5 7 11 13 17 19 23 798 S: a OK Search complete 800 In the above example, the message numbers of any messages containing 801 the string "IMAP4" in the shared or private "value" attribute of the 802 "/comment" entry are returned in the search results. 804 C: a SEARCH ANNOTATION "*" "*" "IMAP4" 805 S: * SEARCH 1 2 3 5 8 13 21 34 806 S: a OK Search complete 808 In the above example, the message numbers of any messages containing 809 the string "IMAP4" in any attribute (public or private) of any entry 810 are returned in the search results. 812 8.9 ANNOTATION Key in SORT 814 ANNOTATION 816 The ANNOTATION criterion for the SORT command [SORT] instructs the 817 server to return the message numbers or UIDs of a mailbox, sorted 818 using the values of the specified annotations. The ANNOTATION 819 criterion is available if the server returns both "ANNOTATE" and 820 "SORT" as supported capabilities in the CAPABILITY command response. 822 Messages are sorted using the values of the 823 attributes in the entries. (The charset argument 824 determines sort order, as specified in the SORT extension 825 description.) 827 Examples: 828 C: a SORT (ANNOTATION "/subject" "value.shared") UTF-8 ALL 829 S: * SORT 2 3 4 5 1 11 10 6 7 9 8 830 S: a OK Sort complete 832 In the above example, the message numbers of all messages are 833 returned, sorted according to the shared "value" attribute of the 834 "/subject" entry. 836 Note that the ANNOTATION sort key must include a fully specified 837 entry and attribute -- wildcards are not allowed. 839 9 Formal Syntax 841 The following syntax specification uses the Augmented Backus-Naur 842 Form (ABNF) notation as specified in [ABNF]. 844 Non-terminals referenced but not defined below are as defined by 845 [IMAP4]. 847 Except as noted otherwise, all alphabetic characters are case- 848 insensitive. The use of upper or lower case characters to define 849 token strings is for editorial clarity only. Implementations MUST 850 accept these strings in a case-insensitive fashion. 852 annotate-param = "ANNOTATE" 853 ; defines the select parameter used with 854 ; ANNOTATE extension 856 append = "APPEND" SP mailbox [SP flag-list] [SP date-time] 857 [SP "ANNOTATION" SP att-annotate] SP literal 858 ; modifies original IMAP4 APPEND command 860 append-message = [SP flag-list] [SP date-time] 861 [SP "ANNOTATION" SP att-annotate] SP literal 862 ; modifies [MULTIAPPEND] extension behaviour 864 att-annotate = "ANNOTATION" SP "(" entry-att *(SP entry-att) ")" 866 att-match = string 867 ; dot-separated attribute name 868 ; MAY contain "*" or "%" for use as wildcards 870 att-value = attrib SP value 872 attrib = string 873 ; dot-separated attribute name 874 ; MUST NOT contain "*" or "%" 876 attribs = att-match / 877 "(" att-match *(SP att-match) ")" 879 entries = entry-match / 880 "(" entry-match *(SP entry-match) ")" 882 entry = string 883 ; slash-separated path to entry 884 ; MUST NOT contain "*" or "%" 886 entry-att = entry SP "(" att-value *(SP att-value) ")" 888 entry-match = string 889 ; slash-separated path to entry 890 ; MAY contain "*" or "%" for use as wildcards 892 examine =/ *(SP "(" select-param *(SP select-param) ")" 893 ; modifies the original IMAP4 examine command to 894 ; accept optional parameters 895 fetch-ann-resp = "ANNOTATION" SP "(" entry-att *(SP entry-att) ")" 897 fetch-att =/ "ANNOTATION" SP "(" entries SP attribs ")" 898 ; modifies original IMAP4 fetch-att 900 resp-text-code =/ "ANNOTATE" SP "TOOBIG" / 901 "ANNOTATE" SP "TOOMANY" / 902 "ANNOTATESIZE" SP number 903 ; new response codes for STORE failures 905 search-key =/ "ANNOTATION" SP entry-match SP att-match 906 SP value 907 ; modifies original IMAP4 search-key 909 select =/ *(SP "(" select-param *(SP select-param) ")" 910 ; modifies the original IMAP4 select command to 911 ; accept optional parameters 913 select-param = astring / "(" astring SP astring *(SP astring) ")" 914 ; parameters to SELECT may contain one or 915 ; more atoms or strings - multiple items 916 ; are always parenthesised 918 sort-key =/ "ANNOTATION" SP entry SP attrib 919 ; modifies original sort-key [SORT] 921 store-att-flags =/ att-annotate 922 ; modifies original IMAP4 STORE command 924 value = nstring 926 10 IANA Considerations 928 Both entry names and attribute names MUST be specified in a 929 standards track or IESG approved experimental RFC, or fall under the 930 vendor namespace. Vendor names MUST be registered. 932 10.1 Entry and Attribute Registration Template 934 To: iana@iana.org 935 Subject: IMAP Annotate Registration 937 Please register the following IMAP Annotate item: 939 [] Entry [] Attribute 941 Name: ______________________________ 943 Description: _______________________ 944 ____________________________________ 946 ____________________________________ 948 Contact person: ____________________ 950 email: ____________________ 952 11 Security Considerations 954 The ANNOTATE extension does not raise any security considerations 955 that are not present in the base [IMAP4] protocol, and these issues 956 are discussed in [IMAP4]. 958 Care must be taken to ensure that annotations whose values are 959 intended to remain private are not stored in mailboxes which are 960 accessible to other users. This includes mailboxes owned by the 961 user by whose ACLs permit access by others as well as any shared 962 mailboxes. 964 12 Normative References 966 [ABNF] Crocker, Overell, "Augmented BNF for Syntax Specifications: 967 ABNF", RFC 2234, November 1997. 969 [ACAP] Newman, Myers, "ACAP -- Application Configuration Access 970 Protocol", RFC 2244, November 1997. 972 [CONDSTORE] Melnikov, Hole, "IMAP Extension for Conditional STORE 973 operation", 974 995 13 Informative References 997 [ACL] Myers, "IMAP4 ACL extension", RFC 2086, January 1997. 999 14 Acknowledgments 1001 Many thanks to Chris Newman for his detailed comments on the first 1002 draft of this document, and to the participants at the ACAP working 1003 dinner in Pittsburgh. 1005 15 Authors' Addresses 1007 Randall Gellens 1008 QUALCOMM Incorporated 1009 5775 Morehouse Dr. 1010 San Diego, CA 92121-2779 1011 U.S.A. 1013 Email: randy@qualcomm.com 1015 Cyrus Daboo 1016 Cyrusoft International, Inc. 1017 Suite 780, 5001 Baum Blvd. 1018 Pittsburgh, PA 15213 1019 U.S.A. 1021 Email: daboo@cyrusoft.com 1023 16 Full Copyright Statement 1025 Copyright (C) The Internet Society 2003. All Rights Reserved. 1027 This document and translations of it may be copied and furnished to 1028 others, and derivative works that comment on or otherwise explain it 1029 or assist in its implementation may be prepared, copied, published 1030 and distributed, in whole or in part, without restriction of any 1031 kind, provided that the above copyright notice and this paragraph 1032 are included on all such copies and derivative works. However, this 1033 document itself may not be modified in any way, such as by removing 1034 the copyright notice or references to the Internet Society or other 1035 Internet organizations, except as needed for the purpose of 1036 developing Internet standards in which case the procedures for 1037 copyrights defined in the Internet Standards process must be 1038 followed, or as required to translate it into languages other than 1039 English. 1041 The limited permissions granted above are perpetual and will not be 1042 revoked by the Internet Society or its successors or assigns. 1044 This document and the information contained herein is provided on an 1045 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING 1046 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING 1047 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION 1048 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF 1049 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.