idnits 2.17.00 (12 Aug 2021) /tmp/idnits54673/draft-ietf-imapext-annotate-04.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. ** The document seems to lack separate sections for Informative/Normative References. All references will be assumed normative when checking for downward references. ** There are 2 instances of too long lines in the document, the longest one being 1 character in excess of 72. ** There are 2 instances of lines with control characters in the document. ** 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 (March 2002) is 7371 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: 'MIME' is mentioned on line 370, but not defined ** Obsolete normative reference: RFC 2234 (ref. 'ABNF') (Obsoleted by RFC 4234) ** Obsolete normative reference: RFC 2086 (ref. 'ACL-EXT') (Obsoleted by RFC 4314) ** Obsolete normative reference: RFC 2060 (ref. 'IMAP4') (Obsoleted by RFC 3501) ** Obsolete normative reference: RFC 1891 (ref. 'SMTP-DSN') (Obsoleted by RFC 3461) -- Possible downref: Non-RFC (?) normative reference: ref. 'SORT-EXT' Summary: 12 errors (**), 0 flaws (~~), 3 warnings (==), 4 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-04.txt March 2002 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 2002. 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 . . . . . . . . . . 5 41 6.2.1 Entry Names . . . . . . . . . . . . . . . . . . . . . 6 42 6.2.2 Attribute Names . . . . . . . . . . . . . . . . . . 8 43 7 Private versus Shared and Access Control . . . . . . . . . . 8 44 8 IMAP Protocol Changes . . . . . . . . . . . . . . . . . . . 9 45 8.1 Optional parameters with the SELECT/EXAMINE commands . . 9 46 8.2 ANNOTATION Message Data Item in FETCH Command . . . . . 10 47 8.3 ANNOTATION Message Data Item in FETCH Response . . . . . 12 48 8.4 ANNOTATION Message Data Item in STORE . . . . . . . . . 13 49 8.5 ANNOTATION interaction with COPY . . . . . . . . . . . . 14 50 8.6 ANNOTATION Message Data Item in APPEND . . . . . . . . . 14 51 8.7 ANNOTATION Criterion in SEARCH . . . . . . . . . . . . . 15 52 8.8 ANNOTATION Key in SORT . . . . . . . . . . . . . . . . . 15 53 9 Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . . 16 54 10 IANA Considerations . . . . . . . . . . . . . . . . . . . . 18 55 10.1 Entry and Attribute Registration Template . . . . . . . . 18 56 11 Security Considerations . . . . . . . . . . . . . . . . . . 18 57 12 References . . . . . . . . . . . . . . . . . . . . . . . . . 18 58 13 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . 19 59 14 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . 19 60 15 Full Copyright Statement . . . . . . . . . . . . . . . . . . 19 62 1 Abstract 64 The ANNOTATE extension to the Internet Message Access Protocol 65 [IMAP4] permits clients and servers to maintain "metadata" for 66 messages stored in an IMAP4 mailbox. 68 2 Discussion 70 Public comments can be sent to the IETF IMAP Extensions mailing 71 list, . To subscribe, send a message to 72 with the word SUBSCRIBE as the body. 73 Private comments should be sent to the authors. 75 3 Conventions Used in This Document 77 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 78 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 79 document are to be interpreted as described in RFC 2119 [KEYWORDS]. 81 Formal syntax is defined using ABNF [ABNF] as modified by [IMAP4]. 83 In examples, "C:" and "S:" indicate lines sent by the client and 84 server respectively. Line breaks not preceded by a "C:" or "S:" are 85 for editorial clarity only. 87 4 Change History 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. 97 7. Added comment that the recent flag annotation is read-only. 99 Changes from -02 to -03: 100 1. Removed reference to status modtime item. 101 2. Added missing 'notify' and 'ret' dsn annotations for 102 /message/smtp-envelope. 103 3. Added requirement to store data permanently - no 104 'session only' annotations. 105 4. Removed Access Control section. Replaced with comments 106 on read-only/read-write mailboxes and storing private or 107 shared annotations. 108 5. Removed STORE to default .priv or .shared. 109 6. Added section on optional select parameters. 111 Changes from -01 to -02: 112 1. Now require .priv or .shared on store operations. 114 Changes from -00 to -01: 115 1. MODTIME moved to its own draft, which this draft now 116 depends on. Thus, Conditional Annotation STORE and 117 related items deleted from this draft. 118 2. Private versus Shared Annotations: both are possible 119 (separately addressable using ".priv" and ".shared" 120 suffixes). There is a per-mailbox setting for the 121 default. It is an open issue how this is viewed or 122 changed by the client. 123 3. In ACLs, the "w" right is needed to updated shared state; 124 the "s" 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 130 attributes. 131 2. Changed 'modifiedsince' to 'modtime'; referenced ACAP spec. 133 3. Deleted 'queued' flag. 134 4. Expanded and explained smtp-envelope entry. 135 5. Restricted including ANNOTATION data in unsolicited responses 136 until the client uses it first. (Open issue as to if needed). 137 6. Examples now only use valid entries and attributes. 138 7. Updated Security Considerations. 139 8. Content-Type now defaults to text/plain. 140 9. Open Issue: Shared vs. private annotations. 141 10. Open issue: Annotation Modtime untagged response or VALIDTIME 142 FETCH data. 143 11. Open issue: Conditional annotation STORE. 144 12. ANNOTATION criterion available if both "ANNOTATE" and "SORT" 145 in CAPABILITY command response. 146 13. Prohibition on annotations in lieu of base spec functionality. 147 14. Specified required ACL rights. 148 15. ANNOTATION message data item in APPEND. 149 16. ANNOTATION-MODTIME message data item in STATUS. 150 17. Replaced ATOM_CHAR with utf8-char. 151 18. Updated other ABNF entries. 153 5 Introduction and Overview 155 The ANNOTATE extension is present in any IMAP4 implementation which 156 returns "ANNOTATE" as one of the supported capabilities in the 157 CAPABILITY response. 159 The ANNOTATE extension adds a new message data item to the FETCH and 160 STORE commands, as well as adding SEARCH and SORT keys and an APPEND 161 modifier. 163 This extension makes the following changes to the IMAP4 protocol: 165 a) adds a new ANNOTATION message data item for use in FETCH 166 b) adds a new ANNOTATION message data item for use in STORE 167 c) adds a new ANNOTATION search criterion for use in SEARCH 168 d) adds a new ANNOTATION sort key for use in SORT extension 169 e) adds a new ANNOTATION data item for use in APPEND 170 f) adds a new requirement on the COPY command 171 g) adds a extension mechanism for adding parameters to the 172 SELECT/EXAMINE commands and defines the ANNOTATE parameter 174 The data model used for the storage of annotations is based on that 175 of the Application Configuration Access Protocol [ACAP]. Note that 176 there is no inheritance in annotations. 178 Clients MUST NOT use annotations in lieu of equivalent IMAP base 179 specification facilities. For example, use of a "seen" flag in the 180 vendor namespace together with ".PEEK" in fetches. Such behaviour 181 would significantly reduce IMAP interoperability. 183 If a server supports annotations, then it MUST store all annotation 184 data permanently, i.e. there is no concept of 'session only' 185 annotations that would correspond to the behaviour of 'session' 186 flags as defined in the IMAP base specification. The exception to 187 this is IMAP flags (which are accessible directly through 188 annotations) which may be 'session only' as determined by the FLAGS 189 and PERMANENTFLAGS responses to a SELECT or EXAMINE command. 191 This extension also introduces a generalised mechanism for adding 192 parameters to the SELECT or EXAMINE commands. It is anticipated 193 that other extensions may want to utilise this, so it is not 194 strictly dependent on the ANNOTATE extension being present. 196 The rest of this document describes the data model and protocol 197 changes more rigorously. 199 6 Data Model 201 6.1 Overview 203 The data model used in ANNOTATE is that of a uniquely named entry 204 which contains a set of standard attributes. A single coherent unit 205 of "metadata" for a message is stored as a single entry, made up of 206 several attributes. 208 For example, a comment added to a message has an entry name of 209 "/message/comment". This entry is composed of several attributes 210 such as "value", "size", etc. which contain the properties and data 211 of the entry. 213 The protocol changes to IMAP described below allow a client to 214 access or change the values of any attributes in any entries in a 215 message annotation, assuming it has sufficient access rights to do 216 so (see Section 7 for specifics). 218 6.2 Namespace of Entries and Attributes 220 Each message annotation is made up of a set of entries. Each entry 221 has a hierarchical name in UTF-8, with each component of the name 222 separated by a slash ("/"). 224 Each entry is made up of a set of attributes. Each attribute has a 225 hierarchical name in UTF-8, with each component of the name 226 separated by a period ("."). 228 The value of an attribute is NIL (has no value), or is a string of 229 zero or more octets. 231 Entry and attribute names MUST NOT contain asterisk ("*") or percent 232 ("%") characters and MUST be valid UTF-8 strings which do not 233 contain the NULL octet. Invalid entry or attribute names result in 234 a BAD response in any IMAP commands where they are used. 236 Use of non-visible UTF-8 characters in entry and attribute names is 237 strongly discouraged. 239 This specification defines an initial set of entry and attribute 240 names available for use in message annotations. In addition, an 241 extension mechanism is described to allow additional names to be 242 added for extensibility. 244 6.2.1 Entry Names 246 Entry names MUST be specified in a standards track or IESG approved 247 experimental RFC, or fall under the vendor namespace. See Section 248 10.1 for the registration template. 250 /message 251 Defines the top-level of entries associated with an entire 252 message. This entry itself does not contain any attributes. 254 /message/comment 255 Defines a comment or note associated with an entire message. 257 /message/flags 258 Defines the top-level of entries for flags associated with an 259 entire message. The "value" attribute of each of the entries 260 described below must be either "1", "0" or NIL. "1" corresponds 261 to the flag being set. 263 /message/flags/answered 264 /message/flags/flagged 265 /message/flags/deleted 266 /message/flags/seen 267 /message/flags/draft 268 /message/flags/recent 269 These attributes represent the standard IMAP flags as returned 270 by the FLAGS fetch item. Changes to these annotations are 271 reflected in the standard IMAP flags. The recent attribute is 272 read only, clients MUST NOT attempt to change it. 274 /message/flags/redirected 275 /message/flags/forwarded 276 The 'redirected' flag indicates that a message has been handed 277 off to someone else, by resending the message with minimal 278 alterations, and in such a way that a reply by the new recipient 279 is addressed to the original author, not the user who performed 280 the redirection. The 'forwarded' flag indicates the message was 281 resent to another user, embedded within or attached to a new 282 message. 284 /message/smtp-envelope 285 Defines the top-level of entries which together describe the 286 SMTP envelope used in delivery of the message. There are no 287 attributes at this level. The client SHOULD NOT modify the 288 /message/smtp-envelope entry or any sub-entries or any of their 289 attributes, except in messages which have the DRAFT flag set. 290 /message/smtp-envelope/from 291 /message/smtp-envelope/to 292 /message/smtp-envelope/orcpt 293 /message/smtp-envelope/envid 294 /message/smtp-envelope/notify 295 /message/smtp-envelope/ret 296 Contains the properties of the SMTP envelope: 'from' is the 297 return-path of the message; 'to' is the recipient of the 298 message. 'notify', 'orcpt', 'ret' and 'envid' contain the 299 notification options, original recipient, envelope ID and return 300 options as specified in [SMTP-DSN]. 302 /message/subject 303 Contains text supplied by the message recipient, to be used by 304 the client instead of the original message Subject. 306 /message/vendor/ 307 Defines the top-level of entries associated with an entire 308 message as created by a particular product of some vendor. 309 These sub-entries can be used by vendors to provide 310 client-specific attributes. The vendor-token MUST be registered 311 with IANA. 313 /body/ 314 Defines the top-level of entries associated with a specific body 315 part of a message. This entry itself does not contain any 316 attributes. The part-specifier uses the same part specifier 317 syntax as the BODY message data item in the FETCH command 318 [IMAP4]. The server MUST return a BAD response if the client 319 uses an incorrect part specifier (either incorrect syntax or a 320 specifier referring to a non-existent part). The server MUST 321 return a BAD response if the client uses an empty part specifier 322 (which is used in [IMAP4] to represent the entire message). 324 /body//comment 325 Defines a comment or note associated with a specific body part 326 of a message. 328 /body//flags 329 Defines the top-level of entries associated with flag state for 330 a specific body part of a message. All sub-entries are 331 maintained entirely by the client. There is no implicit change 332 to any flag by the server. 334 /body//flags/seen 335 /body//flags/answered 336 /body//flags/flagged 337 /body//flags/forwarded 338 Defines flags for a specific body part of a message. The 339 "value" attribute of these entries must be either "1", "0" or 340 NIL. 342 /body//vendor/ 343 Defines the top-level of entries associated with a specific body 344 part of a message as created by a particular product of some 345 vendor. This entry can be used by vendors to provide client 346 specific attributes. The vendor-token MUST be registered with 347 IANA. 349 6.2.2 Attribute Names 351 Attribute names MUST be specified in a standards track or IESG 352 approved experimental RFC, or fall under the vendor namespace. See 353 Section 10.1 for the registration template. 355 All attribute names implicitly have a ".priv" and a ".shared" suffix 356 which maps to private and shared versions of the entry. Searching 357 or fetching without using either suffix includes both. The client 358 MUST specify either a ".priv" or ".shared" suffix when storing an 359 annotation. 361 value 362 A UTF8 string representing the data value of the attribute. To 363 delete an annotation, the client can store NIL into the value. 365 size 366 The size of the value, in octets. Set automatically by the 367 server, read-only to clients. 369 content-type 370 A MIME [MIME] content type and subtype that describes the nature 371 of the content of the "value" attribute. If not present, a 372 value of "text/plain; charset=utf8" is assumed. 374 vendor. 375 Defines an attribute associated with a particular product of 376 some vendor. This attribute can be used by vendors to provide 377 client specific attributes. The vendor-token MUST be registered 378 with IANA. 380 7 Private versus Shared and Access Control 382 Some IMAP mailboxes are private, accessible only to the owning user. 383 Other mailboxes are not, either because the owner has set an ACL 384 [ACL-EXT] which permits access by other users, or because it is a 385 shared mailbox. 387 This raises the issue of shared versus private annotations. 389 If all annotations are private, it is impossible to set annotations 390 in a shared or otherwise non-private mailbox that are visible to 391 other users. This eliminates what could be a useful aspect of 392 annotations in a shared environment. An example of such use is a 393 shared IMAP folder containing bug reports. Engineers may want to 394 use annotations to add information to existing messages, indicate 395 assignments, status, etc. This use requires shared annotations. 397 If all annotations are shared, it is impossible to use annotations 398 for private notes on messages in shared mailboxes. Also, modifying 399 an ACL to permit access to a mailbox by other users may 400 unintentionally expose private information. 402 There are also situations in which both shared and private 403 annotations are useful. For example, an administrator may want to 404 set shared annotations on messages in a shared folder, which 405 individual users may wish to supplement with additional notes. 407 If shared and private annotations are to coexist, we need a clear 408 way to differentiate them. Also, it should be as easy as possible 409 for a client to access both and not overlook either. There is also 410 a danger in allowing a client to store an annotation without knowing 411 if it is shared or private. 413 This document proposes two standard suffixes for all attributes: 414 ".shared" and ".priv". A search, fetch, or sort which specifies 415 neither uses both. Store operations MUST explicitly use .priv or 416 .shared suffixes. 418 A user can only store and fetch private annotations on messages in 419 any mailbox which they can SELECT or EXAMINE, including ones which 420 only open READ-ONLY. A user can only store and fetch shared 421 annotations on messages in any mailbox that they can SELECT and 422 which opens READ-WRITE. If a client attempts to store or fetch a 423 shared annotation on a READ-ONLY mailbox, the server MUST respond 424 with a NO response. 426 8 IMAP Protocol Changes 428 8.1 Optional parameters with the SELECT/EXAMINE commands 430 This extension adds the ability to include one or more parameters 431 with the IMAP SELECT or EXAMINE commands, to turn on or off certain 432 standard behaviour, or to add new optional behaviours required for a 433 particular extension. It is anticipated that other extensions may 434 want to use this facility, so a generalised approach is given here. 435 This facility is not dependent on the presence of the ANNOTATE 436 extension - other extensions can use it with a server that does not 437 implement ANNOTATE. 439 Optional parameters to the SELECT or EXAMINE commands are added as a 440 parenthesised list of atoms or strings, and appear after the mailbox 441 name in the standard SELECT or EXAMINE command. The order of 442 individual parameters is arbitrary. Individual parameters may 443 consist of one or more atoms or strings in a specific order. If a 444 parameter consists of more than one atom or string, it MUST appear 445 in its own parenthesised list. Any parameter not defined by 446 extensions that the server supports MUST be rejected with a NO 447 response. 449 Example: 450 C: a SELECT INBOX (ANNOTATE) 451 S: ... 452 S: a OK SELECT complete 454 In the above example, a single parameter is used with the 455 SELECT command. 457 C: a EXAMINE INBOX (ANNOTATE (RESPONSES "UID Responses") MODTIME) 458 S: ... 459 S: a OK EXAMINE complete 461 In the above example, three parameters are used with the 462 EXAMINE command. The second parameter consists of two 463 items: an atom followed by a quoted string. 465 C: a SELECT INBOX (BLURDYBLOOP) 466 S: a NO Unknown parameter in SELECT command 468 In the above example, a parameter not supported by the 469 server is incorrectly used. 471 The ANNOTATE extension defines a single optional select parameter 472 "ANNOTATE", which is used to turn on unsolicited responses for 473 annotations as described in Section 8.3. 475 8.2 ANNOTATION Message Data Item in FETCH Command 477 This extension adds an ANNOTATION message data item to the FETCH 478 command. This allows clients to retrieve annotations for a range of 479 messages in the currently selected mailbox. 481 ANNOTATION 482 The ANNOTATION message data item, when used by the client in the 483 FETCH command, takes an entry specifier and an attribute 484 specifier. 486 Example: 487 C: a FETCH 1 (ANNOTATION ("/message/comment" "value")) 488 S: * 1 FETCH (ANNOTATION ("/message/comment" 489 ("value.priv" "My comment" 490 "value.shared" "Group note"))) 491 S: a OK Fetch complete 493 In the above example, the content of the "value" attribute 494 for the "/message/comment" entry is requested by the client 495 and returned by the server. Since neither ".shared" nor 496 ".priv" was specified, both are returned. 498 "*" and "%" wildcard characters can be used in either specifier to 499 match one or more characters at that position, with the exception 500 that "%" does not match the hierarchy delimiter for the specifier it 501 appears in (that is, "/" for an entry specifier or "." for an 502 attribute specifier). Thus an entry specifier of "/message/%" 503 matches entries such as "/message/comment" and "/message/subject", 504 but not "/message/flags/redirected". 506 Examples: 507 C: a FETCH 1 (ANNOTATION ("/message/*" ("value.priv" 508 "size.priv"))) 509 S: * 1 FETCH (ANNOTATION 510 (("/message/comment" ("value.priv" "My comment" 511 "size.priv" "10")) 512 ("/message/subject" ("value.priv" "Rhinoceroses!" 513 "size.priv" "13")) 514 ("/message/vendor/foobar/label.priv" 515 ("value.priv" "label43" 516 "size.priv" "7")) 517 ("/message/vendor/foobar/personality" 518 ("value.priv" "Tallulah Bankhead" 519 "size.priv" "17")))) 520 S: a OK Fetch complete 522 In the above example, the contents of the private "value" and "size" 523 attributes for any entries in the "/message" hierarchy are requested 524 by the client and returned by the server. 526 C: a FETCH 1 (ANNOTATION ("/message/%" "value.shared")) 527 S: * 1 FETCH (ANNOTATION 528 (("/message/comment" ("value.shared" "Patch Mangler")) 529 ("/message/subject" ("value.shared" "Patches? We don' 530 need no steenkin patches!")))) 531 S: a OK Fetch complete 533 In the above example, the contents of the shared "value" 534 attributes for entries at the top level only of the 535 "/message" hierarchy are requested by the client and 536 returned by the server. 538 Entry and attribute specifiers can be lists of atomic specifiers, so 539 that multiple items of each type may be returned in a single FETCH 540 command. 542 Examples: 543 C: a FETCH 1 (ANNOTATION 544 (("/message/comment" "/message/subject") "value.priv")) 545 S: * 1 FETCH (ANNOTATION 546 (("/message/comment" ("value.priv" "What a chowder-head")) 547 ("/message/subject" ("value.priv" "How to crush beer 548 cans")))) 549 S: a OK Fetch complete 551 In the above example, the contents of the private "value" attributes 552 for the two entries "/message/comment" and "/message/subject" are 553 requested by the client and returned by the server. 555 8.3 ANNOTATION Message Data Item in FETCH Response 557 The ANNOTATION message data item in the FETCH response displays 558 information about annotations in a message. 560 ANNOTATION parenthesised list 562 The response consists of a list of entries, each of which has a 563 list of attribute-value pairs. 565 Examples: 566 C: a FETCH 1 (ANNOTATION ("/message/comment" "value")) 567 S: * 1 FETCH (ANNOTATION ("/message/comment" 568 ("value.priv" "My comment" 569 "value.shared" NIL))) 570 S: a OK Fetch complete 572 In the above example, a single entry with a single attribute-value 573 pair is returned by the server. Since the client did not specify a 574 ".shared" or ".priv" suffix, both are returned. Only the private 575 attribute has a value (the shared value is NIL). 577 C: a FETCH 1 (ANNOTATION 578 (("/message/comment" "/message/subject") "value")) 579 S: * 1 FETCH (ANNOTATION 580 (("/message/comment" ("value.priv" "My comment" 581 "value.shared" NIL)) 582 ("/message/subject" ("value.priv" "My subject" 583 "value.shared" NIL)))) 584 S: a OK Fetch complete 586 In the above example, two entries each with a single attribute-value 587 pair are returned by the server. Since the client did not specify a 588 ".shared" or ".priv" suffix, both are returned. Only the private 589 attributes have values; the shared attributes are NIL. 591 C: a FETCH 1 (ANNOTATION 592 ("/message/comment" ("value" "size"))) 593 S: * 1 FETCH (ANNOTATION 594 (("/message/comment" 595 ("value.priv" "My comment" 596 "value.shared" NIL 597 "size.priv" "10" 598 "size.shared" 0)))) 599 S: a OK Fetch complete 601 In the above example, a single entry with two attribute-value pairs 602 is returned by the server. Since the client did not specify a 603 ".shared" or ".priv" suffix, both are returned. Only the private 604 attributes have values; the shared attributes are NIL. 606 Servers MUST NOT include ANNOTATION data in unsolicited responses 607 unless the client used the ANNOTATE select parameter when it issued 608 the last SELECT or EXAMINE command. This restriction avoids sending 609 ANNOTATION data to a client unless the client explicitly asks for 610 it. 612 Servers SHOULD send ANNOTATION message data items in unsolicited 613 FETCH responses if an annotation entry is changed by a third-party, 614 and the ANNOTATE select parameter was used. This allows servers to 615 keep clients updated with changes to annotations by other clients. 617 8.4 ANNOTATION Message Data Item in STORE 619 ANNOTATION 620 Sets the specified list of entries by adding or replacing the 621 specified attributes with the values provided. Clients can use 622 NIL for values of attributes it wants to remove from entries. 624 The ANNOTATION message data item used with the STORE command has an 625 implicit ".SILENT" behaviour. This means the server does not 626 generate an untagged FETCH in response to the STORE command and 627 assumes that the client updates its own cache if the command 628 succeeds. 630 Examples: 631 C: a STORE 1 ANNOTATION ("/message/comment" 632 ("value.priv" "My new comment")) 633 S: a OK Store complete 635 In the above example, the entry "/message/comment" is created (if 636 not already present) and the private attribute "value" with data set 637 to "My new comment" is created if not already present, or replaced 638 if it exists. 640 C: a STORE 1 ANNOTATION ("/message/comment" 641 ("value.shared" NIL)) 642 S: a OK Store complete 643 In the above example, the shared "value" attribute of the entry 644 "/message/comment" is removed by storing NIL into the attribute. 646 Multiple entries can be set in a single STORE command by listing 647 entry-attribute-value pairs in the list. 649 Example: 650 C: a STORE 1 ANNOTATION ("/message/comment" ("value.priv" 651 "Get tix Tuesday") 652 "/message/subject" ("value.priv" 653 "Wots On")) 654 S: a OK Store complete 656 In the above example, the entries "/message/comment" and 657 "/message/subject" are created (if not already present) and the 658 private attribute "value" is created for each entry if not already 659 present, or replaced if they exist. 661 Multiple attributes can be set in a single STORE command by listing 662 multiple attribute-value pairs in the entry list. 664 Example: 665 C: a STORE 1 ANNOTATION ("/message/comment" 666 ("value.priv" "My new comment" 667 "vendor.foobar.priv" "foo's bar")) 668 S: a OK Store complete 670 In the above example, the entry "/message/comment" is created (if 671 not already present) and the private attributes "value" and 672 "vendor.foobar" are created if not already present, or replaced if 673 they exist. 675 8.5 ANNOTATION interaction with COPY 677 The COPY command can be used to move messages from one mailbox to 678 another on the same server. Servers that support the ANNOTATION 679 extension MUST copy all the annotation data associated with any 680 messages being copied via the COPY command. The only exception to 681 this is if the destination mailbox permissions are such that either 682 the '.priv' or '.shared' annotations are not allowed. 684 8.6 ANNOTATION Message Data Item in APPEND 686 ANNOTATION 687 Sets the specified list of entries and attributes in the 688 resulting message. 690 Example: 691 C: a APPEND drafts ANNOTATION ("/message/comment" 692 ("value.priv" "Don't send until we hear from Sally")) {310} 693 S: + Ready for literal data 694 C: MIME-Version: 1.0 695 ... 696 C: 697 S: a OK APPEND completed 699 In the above example, a comment with a private value is added to a 700 new message appended to the mailbox. The ellipsis represents the 701 bulk of the message. 703 8.7 ANNOTATION Criterion in SEARCH 705 The ANNOTATION criterion for the SEARCH command allows a client to 706 search for a specified string in the value of an annotation entry of 707 a message. 708 ANNOTATION 710 Messages that have annotations with entries matching 711 and attributes matching and the specified string 712 in their values are returned in the SEARCH results. The "*" 713 character can be used in the entry or attribute name fields to match 714 any content in those items. The "%" character can be used in the 715 entry or attribute name fields to match a single level of hierarchy 716 only. 718 Examples: 719 C: a SEARCH ANNOTATION "/message/comment" "value" "IMAP4" 720 S: * SEARCH 2 3 5 7 11 13 17 19 23 721 S: a OK Search complete 723 In the above example, the message numbers of any messages containing 724 the string "IMAP4" in the shared or private "value" attribute of the 725 "/message/comment" entry are returned in the search results. 727 C: a SEARCH ANNOTATION "*" "*" "IMAP4" 728 S: * SEARCH 1 2 3 5 8 13 21 34 729 S: a OK Search complete 731 In the above example, the message numbers of any messages containing 732 the string "IMAP4" in any attribute (public or private) of any entry 733 are returned in the search results. 735 8.8 ANNOTATION Key in SORT 737 The ANNOTATION criterion for the SORT command [SORT-EXT] instructs 738 the server to return the message numbers or UIDs of a mailbox, 739 sorted using the values of the specified annotations. The 740 ANNOTATION criterion is available if the server returns both 741 "ANNOTATE" and "SORT" as supported capabilities in the CAPABILITY 742 command response. 744 ANNOTATION 746 Messages are sorted using the values of the 747 attributes in the entries. (The charset argument 748 determines sort order, as specified in the SORT extension 749 description.) 751 Examples: 752 C: a SORT (ANNOTATION "/message/subject" "value.shared") UTF-8 753 ALL 754 S: * SORT 2 3 4 5 1 11 10 6 7 9 8 755 S: a OK Sort complete 757 In the above example, the message numbers of all messages are 758 returned, sorted according to the shared "value" attribute of the 759 "/message/subject" entry. 761 Note that the ANNOTATION sort key must include a fully specified 762 entry and attribute -- wildcards are not allowed. 764 9 Formal Syntax 766 The following syntax specification uses the Augmented Backus-Naur 767 Form (ABNF) notation as specified in [ABNF]. 769 Non-terminals referenced but not defined below are as defined by 770 [IMAP4]. 772 Except as noted otherwise, all alphabetic characters are case- 773 insensitive. The use of upper or lower case characters to define 774 token strings is for editorial clarity only. Implementations MUST 775 accept these strings in a case-insensitive fashion. 777 append = "APPEND" SP mailbox [SP flag-list] [SP date-time] 778 [SP "ANNOTATION" SP att-annotate] 779 SP literal 780 ; modifies original IMAP4 APPEND command 782 att-annotate = "(" entry-att *(SP entry-att) ")" 784 fetch-att =/ fetch-annotate 785 ; modifies original IMAP4 fetch-att 787 fetch-annotate = "ANNOTATION" SP "(" entries SP attribs ")" 788 fetch-ann-resp = "ANNOTATION" SP "(" entry-att *(SP entry-att) ")" 790 store-att-flags =/ att-annotate 791 ; modifies original IMAP4 STORE command 793 search-key =/ search-annotate 794 ; modifies original IMAP4 search-key 795 search-annotate = "ANNOTATION" SP entry-match SP attrib-match 796 SP value 798 sort-key =/ sort-annotate 799 ; modifies original 800 ; draft-crispin-imapext-sort-xx.txt sort-key 802 sort-annotate = "ANNOTATION" SP entry SP attrib 804 entries = entry-match / 805 "(" entry-match *(SP entry-match) ")" 806 attribs = attrib-match / 807 "(" attrib-match *(SP attrib-match) ")" 808 entry-att = entry SP "(" att-value *(SP att-value) ") 809 att-value = attrib SP value 811 utf8-char = %x01-FF 812 ; any character, excluding NUL 813 atom-slash = any utf8-char except "/" 814 atom-dot = any utf8-char except "." 816 entry = DQUOTE 1*atom-slash *("/" 1*atom-slash) DQUOTE 817 entry-match = DQUOTE 1*entry-match-atom 818 *("/" 1*entry-match-atom) DQUOTE 819 entry-match-atom = 1*(list-wildcards / atom-slash) 820 *(list-wildcards / atom-slash) 822 attrib = DQUOTE 1*atom-dot *("." 1*atom-dot) DQUOTE 823 attrib-match = DQUOTE 1*attrib-match-atom 824 *("." 1*attrib-match-atom) DQUOTE 825 attrib-match-atom = 1*(list-wildcards / atom-dot) 826 *(list-wildcards / atom-dot) 828 value = nstring 830 select =/ *(SP "(" select-param *(SP select-param) ")" 831 ; modifies the original IMAP4 select command to 832 ; accept optional parameters 834 examine =/ *(SP "(" select-param *(SP select-param) ")" 835 ; modifies the original IMAP4 examine command to 836 ; accept optional parameters 838 select-param = astring / "(" astring SP astring *(SP astring) ")" 839 ; parameters to SELECT may contain one or 840 ; more atoms or strings - multiple items 841 ; are always parenthesised 843 annotate-param = "ANNOTATE" 844 ; defines the select parameter used with 845 ; ANNOTATE extension 846 10 IANA Considerations 848 Both entry names and attribute names MUST be specified in a 849 standards track or IESG approved experimental RFC, or fall under the 850 vendor namespace. Vendor names MUST be registered. 852 10.1 Entry and Attribute Registration Template 854 To: iana@iana.org 855 Subject: IMAP Annotate Registration 857 Please register the following IMAP Annotate item: 859 [] Entry [] Attribute 860 [] Vendor [] Open: RFC _______ 862 Name: ______________________________ 864 Description: _______________________ 866 ____________________________________ 868 ____________________________________ 870 Contact person: ____________________ 872 email: ____________________ 874 11 Security Considerations 876 Care must be taken to ensure that annotations whose values are 877 intended to remain private are not stored in mailboxes which are 878 accessible to other users. This includes mailboxes owned by the 879 user by whose ACLs permit access by others as well as any shared 880 mailboxes. 882 12 References 884 [ABNF] Crocker, Overell, "Augmented BNF for Syntax Specifications: 885 ABNF", RFC 2234, Internet Mail Consortium, Demon Internet Ltd, 886 November 1997. 888 [ACAP] Newman, Myers, "ACAP -- Application Configuration Access 889 Protocol", RFC 2244, Innosoft, Netscape, November 1997. 891 [ACL-EXT] Myers, "IMAP4 ACL extension", RFC 2086, Carnegie Mellon, 892 January 1997. 894 [IMAP4] Crispin, "Internet Message Access Protocol - Version 4rev1", 895 RFC 2060, University of Washington, December 1996. 897 [KEYWORDS] Bradner, "Key words for use in RFCs to Indicate 898 Requirement Levels", RFC 2119, Harvard University, March 1997. 900 [SMTP-DSN] Moore, "SMTP Service Extension for Delivery Status 901 Notifications", RFC 1891, University of Tennessee, January 1996. 903 [SORT-EXT] Crispin, "Internet Message Access Protocol -- SORT 904 Extension", work in progress. 905 907 13 Acknowledgments 909 Many thanks to Chris Newman for his detailed comments on the first 910 draft of this document, and to the participants at the ACAP working 911 dinner in Pittsburgh. 913 14 Authors' Addresses 915 Randall Gellens 916 QUALCOMM Incorporated 917 5775 Morehouse Dr. 918 San Diego, CA 92121-2779 919 U.S.A. 921 Email: randy@qualcomm.com 923 Cyrus Daboo 924 Cyrusoft International, Inc. 925 Suite 780, 5001 Baum Blvd. 926 Pittsburgh, PA 15213 927 U.S.A. 929 Email: daboo@cyrusoft.com 931 15 Full Copyright Statement 933 Copyright (C) The Internet Society 2002. All Rights Reserved. 935 This document and translations of it may be copied and furnished to 936 others, and derivative works that comment on or otherwise explain it 937 or assist in its implementation may be prepared, copied, published 938 and distributed, in whole or in part, without restriction of any 939 kind, provided that the above copyright notice and this paragraph 940 are included on all such copies and derivative works. However, this 941 document itself may not be modified in any way, such as by removing 942 the copyright notice or references to the Internet Society or other 943 Internet organizations, except as needed for the purpose of 944 developing Internet standards in which case the procedures for 945 copyrights defined in the Internet Standards process must be 946 followed, or as required to translate it into languages other than 947 English. 949 The limited permissions granted above are perpetual and will not be 950 revoked by the Internet Society or its successors or assigns. 952 This document and the information contained herein is provided on an 953 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING 954 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING 955 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION 956 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF 957 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.