idnits 2.17.1 draft-ietf-imapext-annotate-01.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 Internet-Drafts being working documents. == 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 is 1 instance of too long lines in the document, the longest one being 6 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 (February 2001) is 8443 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 337, 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) -- Possible downref: Non-RFC (?) normative reference: ref. 'MODTIME-EXT' ** Obsolete normative reference: RFC 1891 (ref. 'SMTP-DSN') (Obsoleted by RFC 3461) -- Possible downref: Non-RFC (?) normative reference: ref. 'SORT-EXT' Summary: 11 errors (**), 0 flaws (~~), 3 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-01.txt February 2001 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. Internet-Drafts are 11 working documents of the Internet Engineering Task Force (IETF), its 12 areas, and its working groups. Note that other groups may also 13 distribute working documents as Internet-Drafts. 15 Internet-Drafts are draft documents valid for a maximum of six 16 months and may be updated, replaced, or obsoleted by other documents 17 at any time. It is inappropriate to use Internet-Drafts as 18 reference material or to cite them other than as "work in progress." 20 The list of current Internet-Drafts can be accessed at 21 http://www.ietf.org/ietf/1id-abstracts.txt. The list of Internet- 22 Draft Shadow Directories can be accessed at 23 http://www.ietf.org/shadow.html. 25 Copyright Notice 27 Copyright (C) The Internet Society 2001. All Rights Reserved. 29 Table of Contents 30 1 Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . 2 31 2 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . 2 32 3 Conventions Used in This Document . . . . . . . . . . . . . . 2 33 4 Document Meta-Data . . . . . . . . . . . . . . . . . . . . . 3 34 4.1 Open Issues . . . . . . . . . . . . . . . . . . . . . . . 3 35 4.2 Change History . . . . . . . . . . . . . . . . . . . . . 3 36 5 Introduction and Overview . . . . . . . . . . . . . . . . . . 4 37 6 Data Model . . . . . . . . . . . . . . . . . . . . . . . . . 4 38 6.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . 4 39 6.2 Namespace of Entries and Attributes . . . . . . . . . . 5 40 6.2.1 Entry Names . . . . . . . . . . . . . . . . . . . . . 5 41 6.2.2 Attribute Names . . . . . . . . . . . . . . . . . . 7 42 7 Private versus Shared . . . . . . . . . . . . . . . . . . . . 8 43 8 IMAP Protocol Changes . . . . . . . . . . . . . . . . . . . 9 44 8.1 ANNOTATION Message Data Item in FETCH Command . . . . . . 9 45 8.2 ANNOTATION Message Data Item in FETCH Response . . . . . 10 46 8.3 ANNOTATION Message Data Item in STORE . . . . . . . . . . 12 47 8.4 ANNOTATION Message Data Item in APPEND . . . . . . . . . 13 48 8.5 ANNOTATION Criterion in SEARCH . . . . . . . . . . . . . 13 49 8.6 ANNOTATION Key in SORT . . . . . . . . . . . . . . . . . 14 50 8.7 ACL Rights . . . . . . . . . . . . . . . . . . . . . . . 15 51 9 Interaction with MODTIME . . . . . . . . . . . . . . . . . . 15 52 10 Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . . 15 53 11 IANA Considerations . . . . . . . . . . . . . . . . . . . . 17 54 11.1 Entry and Attribute Registration Template . . . . . . . . 17 55 12 Security Considerations . . . . . . . . . . . . . . . . . . 17 56 13 References . . . . . . . . . . . . . . . . . . . . . . . . . 17 57 14 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . 18 58 15 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . 18 59 16 Full Copyright Statement . . . . . . . . . . . . . . . . . . 18 61 1 Abstract 63 The ANNOTATE extension to the Internet Message Access Protocol 64 [IMAP4] permits clients and servers to maintain "metadata" for 65 messages stored in an IMAP4 mailbox. 67 2 Discussion 69 Public comments can be sent to the IETF IMAP Extensions mailing 70 list, . To subscribe, send a message to 71 with the word SUBSCRIBE as the body. 72 Private comments should be sent to the authors. 74 3 Conventions Used in This Document 76 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 77 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 78 document are to be interpreted as described in RFC 2119 [KEYWORDS]. 80 Formal syntax is defined using ABNF [ABNF] as modified by [IMAP4]. 82 In examples, "C:" and "S:" indicate lines sent by the client and 83 server respectively. Line breaks not preceded by a "C:" or "S:" are 84 for editorial clarity only. 86 4 Document Meta-Data 88 4.1 Open Issues 90 At points in this document open issues are discussed, marked by the 91 text "<<>>". These are items which have not been 92 finalized. Discussion and comment is requested. Please use the 93 IETF IMAP Extensions mailing list, as described in section 94 2. 96 4.2 Change History 98 Changes from -01 to -02: 99 1. MODTIME moved to its own draft, which this draft now 100 depends on. Thus, Conditional Annotation STORE and 101 related items deleted from this draft. 102 2. Private versus Shared Annotations: both are possible 103 (separately addressable using ".priv" and ".shared" 104 suffixes). There is a per-mailbox setting for the 105 default. It is an open issue how this is viewed or 106 changed by the client. 107 3. In ACLs, the "w" right is needed to updated shared state; 108 the "s" right is needed to update private state. 109 4. Various clarifications and text modifications. 110 5. Added 'forwarded' flag for message parts. 112 Changes from -00 to -01: 113 1. Clarified text describing attributions, entries, and 114 attributes. 115 2. Changed 'modifiedsince' to 'modtime'; referenced ACAP spec. 116 3. Deleted 'queued' flag. 117 4. Expanded and explained smtp-envelope entry. 118 5. Restricted including ANNOTATION data in unsolicited responses 119 until the client uses it first. (Open issue as to if needed). 120 6. Examples now only use valid entries and attributes. 121 7. Updated Security Considerations. 122 8. Content-Type now defaults to text/plain. 123 9. Open Issue: Shared vs. private annotations. 124 10. Open issue: Annotation Modtime untagged response or VALIDTIME 125 FETCH data. 126 11. Open issue: Conditional annotation STORE. 127 12. ANNOTATION criterion available if both "ANNOTATE" and "SORT" 128 in CAPABILITY command response. 130 13. Prohibition on annotations in lieu of base spec functionality. 131 14. Specified required ACL rights. 132 15. ANNOTATION message data item in APPEND. 133 16. ANNOTATION-MODTIME message data item in STATUS. 134 17. Replaced ATOM_CHAR with utf8-char. 135 18. Updated other ABNF entries. 137 5 Introduction and Overview 139 The ANNOTATE extension is present in any IMAP4 implementation which 140 returns "ANNOTATE" as one of the supported capabilities in the 141 CAPABILITY command response. 143 The ANNOTATE extension adds a new message data item to the FETCH and 144 STORE commands, as well as adding SEARCH and SORT keys and APPEND 145 and STATUS modifiers. 147 This extension makes the following changes to the IMAP4 protocol: 149 a) adds a new ANNOTATION message data item for use in FETCH 150 b) adds a new ANNOTATION message data item for use in STORE 151 c) adds a new ANNOTATION search criterion for use in SEARCH 152 d) adds a new ANNOTATION sort key for use in SORT extension 153 e) adds a new ANNOTATION data item for use in APPEND 155 The data model used for the storage of annotations is based on that 156 of the Application Configuration Access Protocol [ACAP]. Note that 157 there is no inheritance in annotations. 159 Clients MUST NOT use annotations in lieu of equivalent IMAP base 160 specification facilities. For example, use of a "seen" flag in the 161 vendor namespace together with ".PEEK" in fetches. Such behavior 162 would significantly reduce IMAP interoperability. 164 <<>> 166 A possible exception to this rule is the potential use of annotation 167 flags in lieu of or as an alternate means of accessing IMAP flags. 169 The rest of this document describes the data model and protocol 170 changes more rigorously. 172 6 Data Model 174 6.1 Overview 176 The data model used in ANNOTATE is that of a uniquely named entry 177 which contains a set of standard attributes. A single coherent unit 178 of "metadata" for a message is stored as a single entry, made up of 179 several attributes. 181 For example, a comment added to a message has an entry name of 182 "/message/comment". This entry is composed of several attributes 183 such as "value", "modtime", etc. which contain the properties and 184 data of the entry. 186 The protocol changes to IMAP described below allow a client to 187 access or change the values of any attributes in any entries in a 188 message annotation, assuming it has sufficient access rights to do 189 so (see section 8.7 for specifics). 191 6.2 Namespace of Entries and Attributes 193 Each message annotation is made up of a set of entries. Each entry 194 has a hierarchical name in UTF-8, with each component of the name 195 separated by a slash ("/"). 197 Each entry is made up of a set of attributes. Each attribute has a 198 hierarchical name in UTF-8, with each component of the name 199 separated by a period ("."). 201 The value of an attribute is NIL (has no value), or is a string of 202 zero or more octets. 204 Entry and attribute names MUST NOT contain asterisk ("*") or percent 205 ("%") characters and MUST be valid UTF-8 strings which do not 206 contain the NULL octet. Invalid entry or attribute names result in 207 a BAD response in any IMAP commands where they are used. 209 Use of non-visible UTF-8 characters in entry and attribute names is 210 strongly discouraged. 212 This specification defines an initial set of entry and attribute 213 names available for use in message annotations. In addition, an 214 extension mechanism is described to allow additional names to be 215 added for extensibility. 217 6.2.1 Entry Names 219 Entry names MUST be specified in a standards track or IESG approved 220 experimental RFC, or fall under the vendor namespace. See section 221 11.1 for the registration template. 223 /message 224 Defines the top-level of entries associated with an entire 225 message. This entry itself does not contain any attributes. 227 /message/comment 228 Defines a comment or note associated with an entire message. 230 /message/flags 231 Defines the top-level of entries for client-use flags associated 232 with an entire message. All sub-entries are maintained entirely 233 by the client. There is no implicit change to any flag by the 234 server. 236 /message/flags/redirected 237 /message/flags/forwarded 238 Defines client-use flags for an entire message. The "value" 239 attribute of these entries must be either "1", "0" or NIL. The 240 'redirected' flag indicates that a message has been handed off 241 to someone else, by resending the message with minimal 242 alterations, and in such a way that a reply by the new recipient 243 is addressed to the original author, not the user who performed 244 the redirection. The 'forwarded' flag indicates the message was 245 resent to another user, embedded within or attached to a new 246 message. 248 /message/smtp-envelope 249 Defines the top-level of entries which together describe the 250 SMTP envelope used in delivery of the message. There are no 251 attributes at this level. The client SHOULD NOT modify the 252 /message/smtp-envelope entry or any sub-entries or any of their 253 attributes, except in messages which have the DRAFT flag set. 254 /message/smtp-envelope/from 255 /message/smtp-envelope/to 256 /message/smtp-envelope/orcpt 257 /message/smtp-envelope/envid 258 Contains the properties of the SMTP envelope: 'from' is the 259 return-path of the message; 'to' is the recipient of the 260 message. 'orcpt' and 'envid' contain the original recipient and 261 envelope ID as specified in [SMTP-DSN]. 263 /message/subject 264 Contains text supplied by the message recipient, to be used by 265 the client instead of the original message Subject. 267 /message/vendor/ 268 Defines the top-level of entries associated with an entire 269 message as created by a particular product of some vendor. 270 These sub-entries can be used by vendors to provide 271 client-specific attributes. The vendor-token MUST be registered 272 with IANA. 274 /body/ 275 Defines the top-level of entries associated with a specific body 276 part of a message. This entry itself does not contain any 277 attributes. The part-specifier uses the same part specifier 278 syntax as the BODY message data item in the FETCH command 279 [IMAP4]. 281 /body//comment 282 Defines a comment or note associated with a specific body part 283 of a message. 285 /body//flags 286 Defines the top-level of entries associated with flag state for 287 a specific body part of a message. All sub-entries are 288 maintained entirely by the client. There is no implicit change 289 to any flag by the server. 291 /body//flags/seen 292 /body//flags/answered 293 /body//flags/flagged 294 /body//flags/forwarded 295 Defines flags for a specific body part of a message. The 296 "value" attribute of these entries must be either "1", "0" or 297 NIL. 299 /body//vendor/ 300 Defines the top-level of entries associated with a specific body 301 part of a message as created by a particular product of some 302 vendor. This entry can be used by vendors to provide client 303 specific attributes. The vendor-token MUST be registered with 304 IANA. 306 6.2.2 Attribute Names 308 Attribute names MUST be specified in a standards track or IESG 309 approved experimental RFC, or fall under the vendor namespace. See 310 section 11.1 for the registration template. 312 All attribute names implicitly have a ".priv" and a ".shared" suffix 313 which maps to private and shared versions of the entry. Searching 314 or fetching without using either suffix includes both. Storing 315 without using either suffix stores into the default. The default is 316 set per-mailbox. See section 7 for more information. 318 value 319 The data value of the attribute. 321 size 322 The size of the value, in octets. Set automatically by the 323 server, read-only to clients. 325 modtime 326 An opaque value set by the server when this entry is modified. 327 It can be used by the client to request notification of which 328 entries have changed relative to that of a known entry. In 329 addition to its use in disconnected/synchronization operations, 330 it can also be helpful in determining which entries have changed 331 while a client is connected. (The value is intended to be used 332 only for comparisons within a server, not as an accurate 333 timestamp.) It is described more fully in section 3.1.1 of 334 [ACAP]. 336 content-type 337 A MIME [MIME] content type and subtype that describes the nature 338 of the content of the "value" attribute. If not present, a 339 value of "text/plain; charset=utf8" is assumed. 341 vendor. 342 Defines an attribute associated with a particular product of 343 some vendor. This attribute can be used by vendors to provide 344 client specific attributes. The vendor-token MUST be registered 345 with IANA. 347 7 Private versus Shared 349 Some IMAP mailboxes are private, accessible only to the owning user. 350 Other mailboxes are not, either because the owner has set an ACL 351 [ACL-EXT] which permits access by other users, or because it is a 352 shared mailbox. 354 This raises the issue of shared versus private annotations. 356 If all annotations are private, it is impossible to set annotations 357 in a shared or otherwise non-private mailbox that are visible to 358 other users. This eliminates what could be a useful aspect of 359 annotations in a shared environment. An example of such use is a 360 shared IMAP folder containing bug reports. Engineers may want to 361 use annotations to add information to existing messages, indicate 362 assignments, status, etc. This use requires shared annotations. 364 If all annotations are shared, it is impossible to use annotations 365 for private notes on messages in shared mailboxes. Also, modifying 366 an ACL to permit access to a mailbox by other users may 367 unintentionally expose private information. 369 There are also situations in which both shared and private 370 annotations are useful. For example, an administrator may want to 371 set shared annotations on messages in a shared folder, which 372 individual users may wish to supplement with additional notes. 374 If shared and private annotations are to coexist, we need a clear 375 way to differentiate them. Also, it should be as easy as possible 376 for a client to access both and not overlook either. There is also 377 a danger in allowing a client to store an annotation without knowing 378 if it is shared or private. 380 This document proposes two standard suffixes for all attributes: 381 ".shared" and ".priv". A search, fetch, or sort which specifies 382 neither uses both. A store without using either stores into the 383 default. 385 <<>> 387 This is dangerous since it allows a client to store an entry without 388 knowing if other users are able to view it. 390 How a client learns or changes the default is an open issue. One 391 suggestion is to use an additional ACL bit to indicate the current 392 default state. 394 It may be better to remove the default, and force clients to always 395 explicitly store into one or the other. 397 8 IMAP Protocol Changes 399 8.1 ANNOTATION Message Data Item in FETCH Command 401 This extension adds an ANNOTATION message data item to the FETCH 402 command. This allows clients to retrieve annotations for a range of 403 messages in the currently selected mailbox. 405 ANNOTATION 406 The ANNOTATION message data item, when used by the client in the 407 FETCH command, takes an entry specifier and an attribute 408 specifier. 410 Example: 411 C: a FETCH 1 (ANNOTATION ("/message/comment" "value")) 412 S: * 1 FETCH (ANNOTATION ("/message/comment" 413 ("value.priv" "My comment" 414 "value.shared" "Group note"))) 415 S: a OK Fetch complete 417 In the above example, the content of the "value" attribute for the 418 "/message/comment" entry is requested by the client and returned by 419 the server. Since neither ".shared" nor ".priv" was specified, both 420 are returned. 422 "*" and "%" wildcard characters can be used in either specifier to 423 match one or more characters at that position, with the exception 424 that "%" does not match the hierarchy delimiter for the specifier it 425 appears in (that is, "/" for an entry specifier or "." for an 426 attribute specifier). Thus an entry specifier of "/message/%" 427 matches entries such as "/message/comment" and "/message/subject", 428 but not "/message/flags/redirected". 430 Examples: 431 C: a FETCH 1 (ANNOTATION ("/message/*" ("value.priv" 432 "modtime.priv"))) 433 S: * 1 FETCH (ANNOTATION 434 (("/message/comment" ("value.priv" "My comment" 435 "modtime.priv" "20000704000001")) 436 ("/message/subject" ("value.priv" "Rhinoceroses!" 437 "modtime.priv" "19991231235959")) 438 ("/message/vendor/eudora/label.priv" 439 ("value.priv" "label43" 440 "modtime.priv" "20000705101502")) 441 ("/message/vendor/eudora/personality" 442 ("value.priv" "Tallulah Bankhead" 443 "modtime.priv" "20000705101558")))) 444 S: a OK Fetch complete 446 In the above example, the contents of the private "value" and 447 "modtime" attributes for any entries in the "/message" hierarchy are 448 requested by the client and returned by the server. 450 C: a FETCH 1 (ANNOTATION ("/message/%" "value.shared")) 451 S: * 1 FETCH (ANNOTATION 452 (("/message/comment" ("value.shared" "Patch Mangler")) 453 ("/message/subject" ("value.shared" "Patches? We don' 454 need no steenkin patches!")))) 455 S: a OK Fetch complete 457 In the above example, the contents of the shared "value" attributes 458 for entries at the top level only of the "/message" hierarchy are 459 requested by the client and returned by the server. 461 Entry and attribute specifiers can be lists of atomic specifiers, so 462 that multiple items of each type may be returned in a single FETCH 463 command. 465 Examples: 466 C: a FETCH 1 (ANNOTATION 467 (("/message/comment" "/message/subject") "value.priv")) 468 S: * 1 FETCH (ANNOTATION 469 (("/message/comment" ("value.priv" "What a chowder-head")) 470 ("/message/subject" ("value.priv" "How to crush beer 471 cans")))) 472 S: a OK Fetch complete 474 In the above example, the contents of the private "value" attributes 475 for the two entries "/message/comment" and "/message/subject" are 476 requested by the client and returned by the server. 478 8.2 ANNOTATION Message Data Item in FETCH Response 480 The ANNOTATION message data item in the FETCH response displays 481 information about annotations in a message. 483 ANNOTATION parenthesised list 484 The response consists of a list of entries, each of which has a 485 list of attribute-value pairs. 487 Examples: 488 C: a FETCH 1 (ANNOTATION ("/message/comment" "value")) 489 S: * 1 FETCH (ANNOTATION ("/message/comment" 490 ("value.priv" "My comment" 491 "value.shared" NIL))) 492 S: a OK Fetch complete 494 In the above example, a single entry with a single attribute-value 495 pair is returned by the server. Since the client did not specify a 496 ".shared" or ".priv" suffix, both are returned. Only the private 497 attribute has a value (the shared value is NIL). 499 C: a FETCH 1 (ANNOTATION 500 (("/message/comment" "/message/subject") "value")) 501 S: * 1 FETCH (ANNOTATION 502 (("/message/comment" ("value.priv" "My comment" 503 "value.shared" NIL)) 504 ("/message/subject" ("value.priv" "My subject" 505 "value.shared" NIL)))) 506 S: a OK Fetch complete 508 In the above example, two entries each with a single attribute-value 509 pair are returned by the server. Since the client did not specify a 510 ".shared" or ".priv" suffix, both are returned. Only the private 511 attributes have values; the shared attributes are NIL. 513 C: a FETCH 1 (ANNOTATION 514 ("/message/comment" ("value" "modtime"))) 515 S: * 1 FETCH (ANNOTATION 516 (("/message/comment" 517 ("value.priv" "My comment" 518 "value.shared" NIL 519 "modtime.priv" "19990203205432" 520 "modtime.shared" NIL)))) 521 S: a OK Fetch complete 523 In the above example, a single entry with two attribute-value pairs 524 is returned by the server. Since the client did not specify a 525 ".shared" or ".priv" suffix, both are returned. Only the private 526 attributes have values; the shared attributes are NIL. 528 Servers SHOULD send ANNOTATION message data items in unsolicited 529 FETCH responses if an annotation entry is changed by a third-party. 530 This allows servers to keep clients updated with changes to 531 annotations by other clients. 533 Servers MUST NOT include ANNOTATION data in unsolicited responses 534 until the client has used ANNOTATION data in a FETCH command. This 535 restriction avoids sending ANNOTATION data to a client until the 536 client has shown it is capable of handling it. 538 <<>> 539 Is this prohibition really necessary? 541 * OK [ANNOTATIONS FLAGS MODTIME ] 543 8.3 ANNOTATION Message Data Item in STORE 545 ANNOTATION 546 Sets the specified list of entries by adding or replacing the 547 specified attributes with the values provided. Clients can use 548 NIL for values of attributes it wants to remove from entries. 550 The ANNOTATION message data item used with the STORE command has an 551 implicit ".SILENT" behavior. This means the server does not 552 generate an untagged FETCH in response to the STORE command and 553 assumes that the client updates its own cache if the command 554 succeeds. 556 Examples: 557 C: a STORE 1 ANNOTATION ("/message/comment" 558 ("value.priv" "My new comment")) 559 S: a OK Store complete 561 In the above example, the entry "/message/comment" is created (if 562 not already present) and the private attribute "value" with data set 563 to "My new comment" is created if not already present, or replaced 564 if it exists. 566 C: a STORE 1 ANNOTATION ("/message/comment" 567 ("value.shared" NIL)) 568 S: a OK Store complete 570 In the above example, the shared "value" attribute of the entry 571 "/message/comment" is removed. 573 Multiple entries can be set in a single STORE command by listing 574 entry-attribute-value pairs in the list. 576 Example: 577 C: a STORE 1 ANNOTATION ("/message/comment" ("value.priv" 578 "Get tix Tuesday") 579 "/message/subject" ("value.priv" 580 "Wots On")) 581 S: a OK Store complete 583 In the above example, the entries "/message/comment" and 584 "/message/subject" are created (if not already present) and the 585 private attribute "value" is created for each entry if not already 586 present, or replaced if they exist. 588 Multiple attributes can be set in a single STORE command by listing 589 multiple attribute-value pairs in the entry list. 591 Example: 592 C: a STORE 1 ANNOTATION ("/message/comment" 593 ("value.priv" "My new comment" 594 "vendor.foobar.priv" "foo's bar")) 595 S: a OK Store complete 597 In the above example, the entry "/message/comment" is created (if 598 not already present) and the private attributes "value" and 599 "vendor.foobar" are created if not already present, or replaced if 600 they exist. 602 8.4 ANNOTATION Message Data Item in APPEND 604 ANNOTATION 605 Sets the specified list of entries and attributes in the 606 resulting message. 608 Example: 609 C: a APPEND drafts ANNOTATION ("/message/comment" 610 ("value.priv" "Don't send until we hear from Sally")) {310} 611 S: + Ready for literal data 612 C: MIME-Version: 1.0 613 ... 614 C: 615 S: a OK APPEND completed 617 In the above example, a comment with a private value is added to a 618 new message appended to the mailbox. The ellipsis represents the 619 bulk of the message. 621 8.5 ANNOTATION Criterion in SEARCH 623 The ANNOTATION criterion for the SEARCH command allows a client to 624 search for a specified string in the value of an annotation entry of 625 a message. 626 ANNOTATION 628 Messages that have annotations with entries matching 629 and attributes matching and the specified string 630 in their values are returned in the SEARCH results. The "*" 631 character can be used in the entry or attribute name fields to match 632 any content in those items. The "%" character can be used in the 633 entry or attribute name fields to match a single level of hierarchy 634 only. 636 Examples: 637 C: a SEARCH ANNOTATION "/message/comment" "value" "IMAP4" 638 S: * SEARCH 2 3 5 7 11 13 17 19 23 639 S: a OK Search complete 641 In the above example, the message numbers of any messages containing 642 the string "IMAP4" in the shared or private "value" attribute of the 643 "/message/comment" entry are returned in the search results. 645 C: a SEARCH ANNOTATION "*" "*" "IMAP4" 646 S: * SEARCH 1 2 3 5 8 13 21 34 647 S: a OK Search complete 649 In the above example, the message numbers of any messages containing 650 the string "IMAP4" in any attribute (public or private) of any entry 651 are returned in the search results. 653 A special case exists when the "modtime" attribute is used as the 654 parameter in the ANNOTATION search criterion. In 655 this case the server matches messages when the corresponding 656 "modtime" value is greater than the value supplied in the ANNOTATION 657 criterion. This allows a client, for example, to find out which 658 messages contain annotations that have changed since the last time 659 it updated its disconnected cache. 661 Example: 662 C: a SEARCH ANNOTATION "*" "modtime" "1999101713283412" 663 S: * SEARCH 1 3 6 10 15 21 28 36 45 55 664 S: a OK Search complete 666 In the above example, the message numbers of any messages whose 667 "modtime" attribute of any entry exceeds the value 668 "1999101713283412" are returned in the search results. Both public 669 and private attributes are searched. 671 8.6 ANNOTATION Key in SORT 673 The ANNOTATION criterion for the SORT command [SORT-EXT] instructs 674 the server to return the message numbers or UIDs of a mailbox, 675 sorted using the values of the specified annotations. The 676 ANNOTATION criterion is available if the server returns both 677 "ANNOTATE" and "SORT" as supported capabilities in the CAPABILITY 678 command response. 679 ANNOTATION 681 Messages are sorted using the values of the 682 attributes in the entries. (The charset argument 683 determines sort order, as specified in the SORT extension 684 description.) 686 Examples: 687 C: a SORT (ANNOTATION "/message/subject" "value.shared") UTF-8 688 ALL 689 S: * SORT 2 3 4 5 1 11 10 6 7 9 8 690 S: a OK Sort complete 692 In the above example, the message numbers of all messages are 693 returned, sorted according to the shared "value" attribute of the 694 "/message/subject" entry. 696 Note that the ANNOTATION sort key must include a fully specified 697 entry and attribute -- wildcards are not allowed. 699 8.7 ACL Rights 701 The "r" right, as specified in [ACL-EXT], is required to use 702 annotations in any command other than STORE. 704 The "w" right is needed to use shared annotations in the STORE 705 command. 707 The "s" right is needed to use private annotations in the STORE 708 command. 710 <<>> 712 Should there be a special ACL bit to indicate if annotations are 713 shared or private by default for a mailbox? 715 9 Interaction with MODTIME 717 The [MODTIME-EXT] document defines an IMAP extension which allows 718 clients to be supplied with an opaque value called a modtime. The 719 specific value is server dependent, but has the property that all 720 such values issued by a server are numerically increasing with 721 respect to the order of changes. That is, for any two items, the 722 one that was modified later has a greater modtime. 724 10 Formal Syntax 726 The following syntax specification uses the Augmented Backus-Naur 727 Form (ABNF) notation as specified in [ABNF]. 729 Non-terminals referenced but not defined below are as defined by 730 [IMAP4]. 732 Except as noted otherwise, all alphabetic characters are case- 733 insensitive. The use of upper or lower case characters to define 734 token strings is for editorial clarity only. Implementations MUST 735 accept these strings in a case-insensitive fashion. 737 append = "APPEND" SP mailbox [SP flag-list] [SP date-time] 739 [SP "ANNOTATION" SP att-annotate] 740 SP literal 741 ; modifies original IMAP4 APPEND command 743 att-annotate = "(" entry-att *(SP entry-att) ")" 745 fetch-att =/ fetch-annotate 746 ; modifies original IMAP4 fetch-att 748 fetch-annotate = "ANNOTATION" SP "(" entries SP attribs ")" 749 fetch-ann-resp = "ANNOTATION" SP "(" entry-att *(SP entry-att) ")" 751 store-att-flags =/ att-annotate 752 ; modifies original IMAP4 STORE command 754 search-key =/ search-annotate 755 ; modifies original IMAP4 search-key 757 search-annotate = "ANNOTATION" SP entry-match SP attrib-match 758 SP value 760 sort-key =/ sort-annotate 761 ; modifies original 762 ; draft-crispin-imapext-sort-xx.txt sort-key 764 sort-annotate = "ANNOTATION" SP entry SP attrib 766 status =/ "ANNOTATION-MODTIME" 767 ; modifies original IMAP4 STATUS command 769 entries = entry-match / 770 "(" entry-match *(SP entry-match) ")" 771 attribs = attrib-match / 772 "(" attrib-match *(SP attrib-match) ")" 773 entry-att = entry SP "(" att-value *(SP att-value) ") 774 att-value = attrib SP value 776 utf8-char = %x01-FF 777 ; any character, excluding NUL 778 atom-slash = any utf8-char except "/" 779 atom-dot = any utf8-char except "." 781 entry = DQUOTE 1*atom-slash *("/" 1*atom-slash) DQUOTE 782 entry-match = DQUOTE 1*entry-match-atom 783 *("/" 1*entry-match-atom) DQUOTE 784 entry-match-atom = 1*(list-wildcards / atom-slash) 785 *(list-wildcards / atom-slash) 787 attrib = DQUOTE 1*atom-dot *("/" 1*atom-dot) DQUOTE 788 attrib-match = DQUOTE 1*attrib-match-atom 789 *("/" 1*attrib-match-atom) DQUOTE 790 attrib-match-atom = 1*(list-wildcards / atom-dot) 791 *(list-wildcards / atom-dot) 793 value = nstring 795 11 IANA Considerations 797 Both entry names and attribute names MUST be specified in a 798 standards track or IESG approved experimental RFC, or fall under the 799 vendor namespace. Vendor names MUST be registered. 801 11.1 Entry and Attribute Registration Template 803 To: iana@iana.org 804 Subject: IMAP Annotate Registration 806 Please register the following IMAP Annotate item: 808 [] Entry [] Attribute 809 [] Vendor [] Open: RFC _______ 811 Name: ______________________________ 813 Description: _______________________ 815 ____________________________________ 817 ____________________________________ 819 Contact person: ____________________ 821 email: ____________________ 823 12 Security Considerations 825 Care must be taken to ensure that annotations whose values are 826 intended to remain private are not stored in mailboxes which are 827 accessible to other users. This includes mailboxes owned by the 828 user by whose ACLs permit access by others as well as any shared 829 mailboxes. 831 13 References 833 [ABNF] Crocker, Overell, "Augmented BNF for Syntax Specifications: 834 ABNF", RFC 2234, Internet Mail Consortium, Demon Internet Ltd, 835 November 1997. 837 [ACAP] Newman, Myers, "ACAP -- Application Configuration Access 838 Protocol", RFC 2244, Innosoft, Netscape, November 1997. 840 [ACL-EXT] Myers, "IMAP4 ACL extension", RFC 2086, Carnegie Mellon, 841 January 1997. 843 [IMAP4] Crispin, "Internet Message Access Protocol - Version 4rev1", 844 RFC 2060, University of Washington, December 1996. 846 [KEYWORDS] Bradner, "Key words for use in RFCs to Indicate 847 Requirement Levels", RFC 2119, Harvard University, March 1997. 849 [MODTIME-EXT] Melnikov, "IMAP Conditional Store", work in progress. 850 852 [SMTP-DSN] Moore, "SMTP Service Extension for Delivery Status 853 Notifications", RFC 1891, University of Tennessee, January 1996. 855 [SORT-EXT] Crispin, "Internet Message Access Protocol -- SORT 856 Extension", work in progress. 857 859 14 Acknowledgments 861 Many thanks to Chris Newman for his detailed comments on the first 862 draft of this document, and to the participants at the ACAP working 863 dinner in Pittsburgh. 865 15 Authors' Addresses 867 Randall Gellens 868 QUALCOMM Incorporated 869 5775 Morehouse Dr. 870 San Diego, CA 92121-2779 871 U.S.A. 873 Phone: +1 858 651 5115 874 Email: randy@qualcomm.com 876 Cyrus Daboo 877 Cyrusoft International, Inc. 878 Suite 780, 5001 Baum Blvd. 879 Pittsburgh, PA 15213 880 U.S.A. 882 Phone: +1 412 605 0499 883 Email: daboo@cyrusoft.com 885 16 Full Copyright Statement 886 Copyright (C) The Internet Society 2001. All Rights Reserved. 888 This document and translations of it may be copied and furnished to 889 others, and derivative works that comment on or otherwise explain it 890 or assist in its implementation may be prepared, copied, published 891 and distributed, in whole or in part, without restriction of any 892 kind, provided that the above copyright notice and this paragraph 893 are included on all such copies and derivative works. However, this 894 document itself may not be modified in any way, such as by removing 895 the copyright notice or references to the Internet Society or other 896 Internet organizations, except as needed for the purpose of 897 developing Internet standards in which case the procedures for 898 copyrights defined in the Internet Standards process must be 899 followed, or as required to translate it into languages other than 900 English. 902 The limited permissions granted above are perpetual and will not be 903 revoked by the Internet Society or its successors or assigns. 905 This document and the information contained herein is provided on an 906 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING 907 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING 908 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION 909 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF 910 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.