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