<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE rfc SYSTEM 'rfc2629.dtd' [  <!ENTITY rfc2119 PUBLIC '' 'bibxml/reference.RFC.2119.xml'>  <!ENTITY rfc2244 PUBLIC '' 'bibxml/reference.RFC.2244.xml'>  <!ENTITY rfc3501 PUBLIC '' 'bibxml/reference.RFC.3501.xml'>  <!ENTITY rfc4314 PUBLIC '' 'bibxml/reference.RFC.4314.xml'>  <!ENTITY rfc4466 PUBLIC '' 'bibxml/reference.RFC.4466.xml'>  <!ENTITY rfc5161 PUBLIC '' 'bibxml/reference.RFC.5161.xml'>  <!ENTITY rfc5234 PUBLIC '' 'bibxml/reference.RFC.5234.xml'>]><?rfc toc="yes" ?><?rfc symrefs="yes" ?><?rfc sortrefs="yes"?><?rfc compact="yes"?><rfc category='std' ipr='full3978' docName='draft-daboo-imap-annotatemore-16'><front><title>IMAP METADATA Extension</title>  <author initials="C." surname="Daboo" fullname="Cyrus Daboo">    <organization abbrev="Apple, Inc.">Apple Inc.</organization>    <address>      <postal>        <street>1 Infinite Loop</street>        <city>Cupertino</city>        <region>CA</region>        <code>95014</code>        <country>USA</country>      </postal>      <email>cyrus@daboo.name</email>      <uri>http://www.apple.com/</uri>    </address>  </author><date /><area>Applications</area><abstract><t>The METADATA extension to the Internet Message Access Protocol permits clients and servers to maintain "annotations" or "meta data" on IMAP servers. It is possible to have annotations on a per-mailbox basis or on the server as a whole. For example, this would allow comments about the purpose of a particular mailbox to be "attached" to that mailbox, or a "message of the day" containing server status information to be made available to anyone logging in to the server.</t></abstract></front><middle><section title='Introduction and Overview'><t>The goal of the METADATA extension is to provide a means for clients to set and retrieve "annotations" or "meta data" on an IMAP server. The annotations can be associated with specific mailboxes or the server as a whole. The server can choose to support only server annotations or both server and mailbox annotations.</t><t>A server that supports both server and mailbox annotations indicates the presence of this extension by returning "METADATA" as one of the supported capabilities in the CAPABILITY command response.</t><t>A server that supports only server annotations indicates the presence of this extension by returning "METADATA-SERVER" as one of the supported capabilities in the CAPABILITY command response.</t><t>A server that supports unsolicited annotation change responses MUST support the "ENABLE" <xref target='RFC5161' /> extension to allow clients to turn that feature on.</t><t>The METADATA extension adds two new commands and one new untagged response to the IMAP base protocol.</t><t>This extension makes the following changes to the IMAP protocol:</t><t><list style='symbols'><t>adds a new SETMETADATA command</t><t>adds a new GETMETADATA command</t><t>adds a new METADATA untagged response</t><t>adds a new METADATA response code</t></list></t><t>The rest of this document describes the data model and protocol changes more rigorously.</t></section><section title='Conventions Used in This Document'><t>In examples, "C:" and "S:" indicate lines sent by the client and server respectively.</t><t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT","SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in thisdocument are to be interpreted as described in <xref target='RFC2119'/>.</t><t>Whitespace and line breaks have been added to the examples in this document to promote readability.</t></section><section title='Data Model'><section title='Overview'><t>Mailboxes or the server as a whole may have zero or more annotations associated with them. An annotation contains a uniquely named entry each of which has a value. Annotations can be added to mailboxes when a mailbox name is provided as the first argument to the SETMETADATA command, or to the server as a whole when the empty string is provided as the first argument to the command.</t><t>For example, a general comment being added to a mailbox may have an entry name of "/comment" and a value "Really useful mailbox".</t><t>The protocol changes to IMAP described below allow a client to access or change the values of any annotation entry, assuming it has sufficient access rights to do so.</t></section><section title='Namespace of entries'><t>Each annotation is an entry that has a hierarchical name, with each component of the name separated by a slash ("/"). An entry name MUST NOT contain two consecutive "/" characters and MUST NOT end with a "/" character.</t><t>The value of an entry is NIL (has no value), or a string or binary data of zero or more octets. A string MAY contain multiple lines of text. Clients MUST use the CRLF (0x0D 0x0A) character octet sequence to represent line ends in a multi-line string value.</t><t>Entry names MUST NOT contain asterisk ("*") or percent ("%") characters and MUST NOT contain non-ASCII characters or characters with octet values in the range 0x00 to 0x19. Invalid entry names result in a BAD response in any IMAP commands where they are used.</t><t>Entry names are case-insensitive.</t><t>Use of control or punctuation characters in entry names is strongly discouraged.</t><t>This specification defines an initial set of entry names available for use with mailbox and server annotations. In addition an extension mechanism is described to allow additional names to be added for extensibility.</t><t>The first component in entry names defines the scope of the annotation. Currently only the prefixes "/private" or "/public" are defined. These prefixes are used to indicate whether an annotation is stored on a per-user basis ("/private") and not visible to other users, or whether an annotation is shared between authorized users ("/public") with a single value that can be read and changed by authorized users with appropriate access. See <xref target='ACCESS' /> for details.</t><section title='Entry Names'><t>Entry names MUST be specified in a standards track or IESG approved experimental RFC, or fall under the vendor namespace. See <xref target='IANAREGISTER' /> for the registration template.</t><section title='Server Entries'><t>These entries are set or retrieved when the mailbox name argument to the new SETMETADATA or GETMETATDATA commands is the empty string.</t><t>/public/comment<list><t>Defines a comment or note associated with the server shared with authorized users of the server.</t></list></t><t>/public/admin<list><t>Indicates a method for contacting the server administrator. The value MUST be a URI (e.g., a mailto: or tel: URL). This entry is always read-only - clients cannot change it. It is visible to authorized users of the system.</t></list></t><t>/public/vendor/&lt;vendor-token&gt;<list><t>Defines the top-level of public entries associated with the server as created by a particular product of some vendor. This entry can be used by vendors to provide server or client specific annotations. The vendor-token MUST be registered with IANA, using the <xref target='RFC2244'>ACAP</xref> vendor subtree registry.</t></list></t><t>/private/vendor/&lt;vendor-token&gt;<list><t>Defines the top-level of private entries associated with the server as created by a particular product of some vendor. This entry can be used by vendors to provide server or client specific annotations. The vendor-token MUST be registered with IANA, using the <xref target='RFC2244'>ACAP</xref> vendor subtree registry.</t></list></t></section><section title='Mailbox Entries'><t>These entries are set or retrieved when the mailbox name argument to the new SETMETADATA or GETMETADATA commands is not the empty string.</t><t>/public/comment<list><t>Defines a public comment or note associated with a mailbox.</t></list></t><t>/private/comment<list><t>Defines a private (per-user) comment or note associated with a mailbox.</t></list></t><t>/public/vendor/&lt;vendor-token&gt;<list><t>Defines the top-level of public entries associated with a specific mailbox as created by a particular product of some vendor. This entry can be used by vendors to provide client specific annotations. The vendor-token MUST be registered with IANA, using the <xref target='RFC2244'>ACAP</xref> vendor subtree registry.</t></list></t><t>/private/vendor/&lt;vendor-token&gt;<list><t>Defines the top-level of private entries associated with a specific mailbox as created by a particular product of some vendor. This entry can be used by vendors to provide client specific annotations. The vendor-token MUST be registered with IANA, using the <xref target='RFC2244'>ACAP</xref> vendor subtree registry.</t></list></t></section></section></section><section anchor='ACCESS' title='Private versus Public and Access Control'><t>In the absence of the ACL extension <xref target='RFC4314'/>, users can only set and retrieve private or public mailbox annotations on a mailbox which exists and is returned to them via a LIST or LSUB command, and on which they have either read or write access to the actual message content of the mailbox (as determined by the READ-ONLY and READ-WRITE response codes as described in Section 5.2 of <xref target='RFC4314'/>).</t>   <t>When the ACL extension <xref target='RFC4314'/> is present, users can only set and retrieve private or public mailbox annotations on a mailbox on which they have the "l" right, and any one of the "r", "s", "w", "i" or "p" rights.</t><t>If a client attempts to set or retrieve annotations on mailboxes which do not satisfy the conditions above, the server MUST respond with a NO response.</t><t>Users can always retrieve private or public server annotations if they exist. Servers MAY restrict the creation of private or public server annotations as appropriate. When restricted, the server MUST return a NO response when the SETMETADATA command is used to try and create a server annotation.</t><t>If the METADATA extension is present, support for public annotations is REQUIRED, whilst support for private annotations is OPTIONAL.  This recognizes the fact that support for private annotations may introduce significantly more complexity to a server in terms of tracking ownership of the annotations, how quota is determined for users based on their own annotations etc.</t></section></section><section title='IMAP Protocol Changes'><section title='General Considerations'><t>The new SETMETADATA command and the METADATA response each have a mailbox name argument. An empty string is used for the mailbox name to signify server annotations. A non-empty string is used to signify mailbox annotations attached to the corresponding mailbox.</t><t>Servers SHOULD ensure that mailbox annotations are automatically moved when the mailbox they refer to is renamed, i.e., the annotations follow the mailbox. This applies to a rename of the INBOX, with the additional behavior that the annotations are copied from the original INBOX to the renamed mailbox. i.e., mailbox annotations are preserved on the INBOX when it is renamed.</t><t>Servers SHOULD delete annotations for a mailbox when the mailbox is deleted, so that a mailbox created with the same name as a previously existing mailbox does not inherit the old mailbox annotations.</t><t>Servers SHOULD allow annotations on all 'types' of mailbox, including ones reporting \Noselect for their LIST response. Servers can implicitly remove \Noselect mailboxes when all child mailboxes are removed, and as such any annotations associated with the \Noselect mailbox SHOULD be removed.</t><t>The server is allowed to impose limitations on the size of any one annotation or the total number of annotations for a single mailbox or for the server as a whole. However, the server MUST accept a minimum annotation data size of at least 1024 bytes, and a minimum annotation count per server or mailbox of at least 10.</t><t>Some annotations may be "read-only" - i.e., they are set by the server and cannot be changed by the client. Also, such annotations may be "computed" - i.e., the value changes based on underlying properties of the mailbox or server. For example, an annotation reporting the total size of all messages in the mailbox would change as messages are added or removed. Or, an annotation containing an IMAP URL for the mailbox would change if the mailbox was renamed.</t><t>Servers MAY support sending unsolicited responses for use when annotations are changed by some "third-party" (see <xref target='unsolicited2' />). In order to do so servers MUST support the ENABLE command <xref target='RFC5161' /> and MUST only send unsolicited responses if the client uses the ENABLE command <xref target='RFC5161' /> extension with the capability string "METADATA" or "METADATA-SERVER" earlier in the session, depending on which of those capabilities is supported by the server.</t></section><section title='GETMETADATA Command'><t>This extension adds the GETMETADATA command. This allows clients to retrieve server or mailbox annotations.</t><t>This command is only available in authenticated or selected state <xref target='RFC3501' />.</t><figure><artwork><![CDATA[    Arguments:  mailbox-name                options                entry-specifier    Responses:  required METADATA response    Result:     OK - command completed                NO - command failure: can't access annotations on                     the server                BAD - command unknown or arguments invalid]]></artwork></figure><t>When the mailbox name is the empty string, this command retrieves server annotations. When the mailbox name is not empty, this command retrieves annotations on the specified mailbox.</t><t>Options MAY be included with this command and are defined below.</t><t>Example:<figure><artwork><![CDATA[        C: a GETMETADATA "" /public/comment        S: * METADATA "" (/public/comment "Shared comment")        S: a OK GETMETADATA complete]]></artwork></figure><list><t>In the above example, the contents of the value of the "/public/comment" server entry is requested by the client and returned by the server.</t></list></t><t>Example:<figure><artwork><![CDATA[        C: a GETMETADATA "INBOX" /private/comment        S: * METADATA "INBOX" (/private/comment "My own comment")        S: a OK GETMETADATA complete]]></artwork></figure><list><t>In the above example, the contents of the value of the "/private/comment" mailbox entry for the mailbox "INBOX" is requested by the client and returned by the server.</t></list></t><t>Entry specifiers can be lists of atomic specifiers, so that multiple annotations may be returned in a single GETMETADATA command.</t><t>Example:<figure><artwork><![CDATA[        C: a GETMETADATA "INBOX" (/public/comment /private/comment)        S: * METADATA "INBOX" (/public/comment "Shared comment"                               /private/comment "My own comment")        S: a OK GETMETADATA complete]]></artwork></figure><list><t>In the above example, the values of the two server entries "/public/comment" and "/private/comment" on the mailbox "inbox" are requested by the client and returned by the server.</t></list></t><section title='MAXSIZE GETMETADATA Command Option'><t>When MAXSIZE option is specified with the GETMETADATA command, it restricts which entry values are returned by the server. Only entry values which are less than or equal in octet size to the specified MAXSIZE limit are returned. If there are any entries with values larger than the MAXSIZE limit, the server MUST include the METADATA LONGENTRIES response code in the tagged OK response for the GETMETADATA command. The METADATA LONGENTRIES response code returns the size of the biggest entry value requested by the client which exceeded the MAXSIZE limit.</t><t>Example:<figure><artwork><![CDATA[        C: a GETMETADATA "INBOX" (MAXSIZE 1024)                                 (/public/comment /private/comment)        S: * METADATA "INBOX" (/private/comment "My own comment")        S: a OK [METADATA LONGENTRIES 2199] GETMETADATA complete]]></artwork></figure><list><t>In the above example, the values of the two server entries "/public/comment" and "/private/comment" on the mailbox "inbox" are requested by the client which wants to restrict the size of returned values to 1024 octets. In this case the "/public/comment" entry value is 2199 octets and is not returned.</t></list></t></section><section title='DEPTH GETMETADATA Command Option'><t>When DEPTH option is specified with the GETMETADATA command, it extends the list of entry values returned by the server. For each entry name specified in the GETMETADATA command, the server returns the value of the specified entry name (if it exists), plus all entries below the entry name up to the specified DEPTH. Three values are allowed for DEPTH:<list>    <t>"0" - no entries below the specified entry are returned</t>    <t>"1" - only entries immediately below the specified entry are returned</t>    <t>"infinity" - all entries below the specified entry are returned</t></list>Thus, "depth 1" for an entry "/a" will match "/a" as well as its children entries (e.g. "/a/b"), but will not match grandchildren entries (e.g. "/a/b/c").</t><t>If the DEPTH option is not specified, this is the same as specifying "DEPTH 0".</t><t>Example:<figure><artwork><![CDATA[        C: a GETMETADATA "INBOX" (DEPTH 1)                                (/private/filters/values)        S: * METADATA "INBOX" (/private/filters/values/small             "SMALLER 5000" /private/filters/values/boss             "FROM \"boss@example.com\"")        S: a OK GETMETADATA complete]]></artwork></figure><list><t>In the above example, 2 entries below the /private/filters/values entry exist on the mailbox "INBOX": "/private/filters/values/small" and "/private/filters/values/boss".</t></list></t></section></section><section title='SETMETADATA Command'><t>This extension adds the SETMETADATA command. This allows clients to set annotations.</t><t>This command is only available in authenticated or selected state <xref target='RFC3501' />.</t><figure><artwork><![CDATA[    Arguments:  mailbox-name                entry                value                list of entry, values    Responses:  no specific responses for this command    Result:     OK - command completed                NO - command failure: can't set annotations,                     or annotation too big or too many                BAD - command unknown or arguments invalid]]></artwork></figure><t>This command sets the specified list of entries by adding or replacing the specified values provided, on the specified existing mailboxes or on the server (if the mailbox argument is the empty string). Clients can use NIL for the value of entries it wants to remove. The server SHOULD NOT return a METADATA response containing the updated annotation data. Clients MUST NOT assume that a METADATA response will be sent, and MUST assume that if the command succeeds then the annotation has been changed.</t><t>If the server is unable to set an annotation because the size of its value is too large, the server MUST return a tagged NO response with a "[METADATA MAXSIZE NNN]" response code when NNN is the maximum octet count that it is willingly to accept.</t><t>If the server is unable to set a new annotation because the maximum number of allowed annotations has already been reached, the server MUST return a tagged NO response with a "[METADATA TOOMANY]" response code.</t><t>If the server is unable to set a new annotation because it does not support private annotations on one of the specified mailboxes, the server MUST return a tagged NO response with a "[METADATA NOPRIVATE]" response code.</t><t>When any one annotation fails to be set, resulting in a tagged NO response from the server, then the server MUST NOT change the values for other annotations specified in the SETMETADATA command.</t><t>Example:<figure><artwork><![CDATA[        C: a SETMETADATA INBOX (/private/comment {33}        S: + ready for data        My new comment across        two lines.        )        S: a OK SETMETADATA complete]]></artwork></figure><list><t>In the above example, the entry "/private/comment" for the mailbox "INBOX" is created (if not already present) and the value set to a multi-line string.</t></list></t><t>Example:<figure><artwork><![CDATA[        C: a SETMETADATA INBOX (/private/comment NIL)        S: a OK SETMETADATA complete]]></artwork></figure><list><t>In the above example, the entry "/private/comment" is removed from the mailbox "INBOX".</t></list></t><t>Multiple entries can be set in a single SETMETADATA command by listing entry-value pairs in the list.</t><t>Example:<figure><artwork><![CDATA[        C: a SETMETADATA INBOX (/private/comment "My new comment"                            /public/comment "This one is for you!")        S: a OK SETMETADATA complete]]></artwork></figure><list><t>In the above example, the entries "/private/comment" and "/public/comment" for the mailbox "INBOX" are created (if not already present) and the values set as specified.</t></list></t><t>Example:<figure><artwork><![CDATA[        C: a SETMETADATA INBOX (/private/comment "My new comment")        S: a NO [METADATA TOOMANY] SETMETADATA failed]]></artwork></figure><list><t>In the above example, the server is unable to set the requested (new) annotation as it has reached the limit on the number of annotations it can support on the specified mailbox.</t></list></t></section><section title='METADATA Response' anchor='unsolicited2'><t>The METADATA response displays results of a GETMETADATA command, or can be returned as an unsolicited response at anytime by the server in response to a change in a server or mailbox annotation.</t><t>When unsolicited responses are activated by the ENABLE <xref target='RFC5161' /> command for this extension, servers MUST send unsolicited METADATA responses if server or mailbox annotations are changed by a third-party, allowing servers to keep clients updated with changes.</t><t>Unsolicited METADATA responses MUST only contain entry names, not the values. If the client wants to update any cached values it must explicitly retrieve those using a GETMETADATA command.</t><t>The METADATA response can contain multiple entries in a single response,  but the server is free to return multiple responses for each entry or group of entries if it desires.</t><t>This response is only available in authenticated or selected state <xref target='RFC3501' />.</t><section title='METADATA response with values'><t>The response consists of a list of entry-value pairs.</t><t>Example:<figure><artwork><![CDATA[        C: a GETMETADATA "" /public/comment        S: * METADATA "" (/public/comment "My comment")        S: a OK GETMETADATA complete]]></artwork></figure><list><t>In the above example, a single entry with its value is returned by the server.</t></list></t><t>Example:<figure><artwork><![CDATA[        C: a GETMETADATA "INBOX" /private/comment /public/comment        S: * METADATA "INBOX" (/private/comment "My comment"                               /public/comment "Its sunny outside!")        S: a OK GETMETADATA complete]]></artwork></figure><list><t>In the above example, two entries and their values are returned by the server.</t></list></t><t>Example:<figure><artwork><![CDATA[        C: a GETMETADATA "INBOX" /private/comment /public/comment        S: * METADATA "INBOX" (/private/comment "My comment")        S: * METADATA "INBOX" (/public/comment "Its sunny outside!")        S: a OK GETMETADATA complete]]></artwork></figure><list><t>In the above example, the server returns two separate responses for each of the two entries requested.</t></list></t></section><section title='Unsolicited METADATA response without values'><t>The response consists of a list of entries, each of which have changed on the server or mailbox.</t><t>Example:<figure><artwork><![CDATA[        C: a NOOP        S: * METADATA "" /public/comment        S: a OK NOOP complete]]></artwork></figure><list><t>In the above example, the server indicates that the "/public/comment" server entry has been changed.</t></list></t><t>Example:<figure><artwork><![CDATA[        C: a NOOP        S: * METADATA "INBOX" /public/comment /private/comment        S: a OK NOOP complete]]></artwork></figure><list><t>In the above example, the server indicates a change to two mailbox entries.</t></list></t></section></section></section><section title='Formal Syntax'><t>The following syntax specification uses the Augmented Backus-Naur Form (ABNF) notation as specified in <xref target='RFC5234' />.</t><t>Non-terminals referenced but not defined below are as defined by <xref target='RFC3501' /> with the new definitions in <xref target='RFC4466' /> superseding those in <xref target='RFC3501' />.</t><t>Except as noted otherwise, all alphabetic characters are case- insensitive. The use of upper or lower case characters to define token strings is for editorial clarity only. Implementations MUST accept these strings in a case-insensitive fashion.</t><figure><artwork><![CDATA[    capability        =/ "METADATA" / "METADATA-SERVER" /                         "METADATA-UNSOLICITED"                        ; defines the capabilities for this extension    command-auth      =/ setmetadata / getmetadata                        ; adds to original IMAP command    entries           = entry /                        "(" entry *(SP entry) ")"                        ; entry specifiers    entry             = astring                        ; slash-separated path to entry                        ; MUST NOT contain "*" or "%"    entry-value       = entry SP value    entry-values      = "(" entry-value *(SP entry-value) ")"    entry-list        = entry *(SP entry)                        ; list of entries used in unsolicited                        ; METADATA response    getmetadata       = "GETMETADATA" [SP getmetadata-options]                                      SP mailbox SP entries                        ; empty string for mailbox implies                        ; server annotation.    getmetadata-options = "(" getmetadata-option                              *(SP getmetadata-option) ")"    getmetadata-option = tagged-ext-label [SP tagged-ext-val]                        ; tagged-ext-label, tagged-ext-val are                        ; defined in [RFC4466].    maxsize-opt       = "MAXSIZE" SP number                        ; Used as a getmetadata-option    metadata-resp     = "METADATA" SP mailbox SP                         (entry-values / entry-list)                        ; empty string for mailbox implies                        ; server annotation.    response-payload  =/ metadata-resp                        ; adds to original IMAP data responses    resp-text-code    =/ "METADATA" SP "LONGENTRIES" SP number                           ; new response codes for GETMETADATA    resp-text-code    =/ "METADATA" SP ("MAXSIZE" SP number /                                        "TOOMANY" / "NOPRIVATE")                        ; new response codes for SETMETADATA                        ; failures    scope-opt         =  "DEPTH" SP ("0" / "1" / "infinity")                        ; Used as a getmetadata-option    setmetadata       = "SETMETADATA" SP mailbox                                      SP entry-values                        ; empty string for mailbox implies                        ; server annotation.    value             = nstring / literal8]]></artwork></figure></section><section title='IANA Considerations'><t>Entry names MUST be specified in a standards track or IESG approved experimental RFC, or fall under the vendor namespace. All entries MUST have either "/public" or "/private" as a prefix.</t><t>Each entry registration MUST include a content-type that is used to indicate the nature of the annotation value. Where applicable a charset parameter MUST be included with the content-type.</t><section anchor='IANAREGISTER' title='Entry and Attribute Registration Template'><figure><artwork><![CDATA[    To: iana@iana.org    Subject: IMAP METADATA Entry Registration    Type:         [Either "Mailbox" or "Server"]    Name:         [the name of the entry]    Description:  [a description of what the entry is for]        Content-type: [MIME Content-Type and charset for the entry value]    RFC Number:   [for entries published as RFCs]    Contact:      [email and/or physical address to contact for                   additional information]]]></artwork></figure></section><section title='Server Entry Registrations'><t>The following templates specify the IANA registrations of annotation entries specified in this document.</t><section title='/public/comment'><figure><artwork><![CDATA[    To: iana@iana.org    Subject: IMAP METADATA Entry Registration    Type:         Server    Name:         /public/comment    Description:  Defines a comment or note associated with the                   server shared with authorized users of the server.      Content-type: text/plain; charset=utf-8    RFC Number:   This RFC.    Contact:      IMAP Extensions mailto:ietf-imapext@imc.org]]></artwork></figure></section><section title='/public/admin'><figure><artwork><![CDATA[    To: iana@iana.org    Subject: IMAP METADATA Entry Registration    Type:         Server    Name:         /public/admin    Description:  Indicates a method for contacting the server                  administrator. The value MUST be a URI (e.g., a                  mailto: or tel: URL). This entry is always                  read-only - clients cannot change it. It is visible                  to authorized users of the system.      Content-type: text/plain; charset=utf-8    RFC Number:   This RFC.    Contact:      IMAP Extensions mailto:ietf-imapext@imc.org]]></artwork></figure></section></section><section title='Mailbox Entry Registrations'><t>The following templates specify the IANA registrations of annotation entries specified in this document.</t><section title='/public/comment'><figure><artwork><![CDATA[    To: iana@iana.org    Subject: IMAP METADATA Entry Registration    Type:         Mailbox    Name:         /public/comment    Description:  Defines a public comment or note associated with a                  mailbox.      Content-type: text/plain; charset=utf-8    RFC Number:   This RFC.    Contact:      IMAP Extensions mailto:ietf-imapext@imc.org]]></artwork></figure></section><section title='/private/comment'><figure><artwork><![CDATA[    To: iana@iana.org    Subject: IMAP METADATA Entry Registration    Type:         Mailbox    Name:         /private/comment    Description:  Defines a private comment or note associated with a                  mailbox.      Content-type: text/plain; charset=utf-8    RFC Number:   This RFC.    Contact:      IMAP Extensions mailto:ietf-imapext@imc.org]]></artwork></figure></section></section></section><section title='Security Considerations'><t>Annotations can contain arbitrary data of varying size. As such servers MUST ensure that size limits are enforced to prevent a user from using up all available space on a server and preventing use by others. Clients MUST treat annotation data values as an "untrusted" source of data as it is possible for it to contain malicious content.</t><t>Annotations whose values are intended to remain private MUST be stored only in entries that have the "/private" prefix on the entry name. Servers MUST ensure that /private annotations are only visible to the user that created them.</t><t>Excluding the above issues the METADATA extension does not raise any security considerations that are not present in the base IMAP protocol, and these issues are discussed in <xref target='RFC3501' />.</t></section></middle><back><references title='Normative References'>&rfc2119;&rfc2244;&rfc3501;&rfc4314;&rfc4466;&rfc5161;&rfc5234;</references><!--<references title='Informative References'></references>--><section title='Acknowledgments'><t>The ideas expressed in this document are based on the message annotation document that was co-authored by Randall Gellens. The participants of the IMAPext working group made significant contributions to this work.</t></section><section title='Change History (to be removed prior to publication as an RFC)'><t>Changes from -15 to -16:<list style='numbers'><t>Tweaked enable capability behavior.</t><t>Changed access control text to be more explicit about which ACL privileges are required.</t></list></t><t>Changes from -14 to -15:<list style='numbers'><t>Addressed minor issues from Gen-ART review on -12 version.</t><t>Removed comparator paragraph - no need to specify how the server does its comparisons.</t><t>Added MAXSIZE GETMETADATA option.</t><t>Added DEPTH GETMETADATA option.</t><t>Additional restriction on entry name octet values added.</t><t>Added text about access restrictions for server annotations.</t></list></t><t>Changes from -13 to -14:<list style='numbers'><t>Add statement that no annotations are set when any one fails in a single SETMETADATA command.</t><t>Make unsolicited responses a MUST when ENABLE is used, but make support for ENABLE METADATA optional so servers aren't required to do unsolicited responses. This required a new capbility for the unsolicited behavior.</t><t>Re-ordered Security considerations paragraphs and added additional text about the possibility of malicious content in data values. [SECDIR suggestion]</t><t>Reworded "all users" to "authorized users" in appropriate places. [SECDIR suggestion]</t><t>Added addition text to Security considerations about the need for servers to keep /private annotations private to the user that created them. [SECDIR suggestion]</t><t>Added comment that string values can be multi-line and that CRLF must be the line end indicator. Also changes one example to be multi-line. [SECDIR suggestion]</t></list></t><t>Changes from -12 to -13:<list style='numbers'><t>Major changes to simplify things.</t><t>Removed dependency on LISTEXT - GETMETADATA now used to get annotations on mailboxes.</t><t>Changed data model to remove attributes - annotations are now only entry-value pairs.</t><t>Removed all wildcard behavior on entry names.</t><t>Cut down the registered annotations to only a few essential ones.</t></list></t><t>Changes from -11 to -12:<list style='numbers'><t>Allow server annotations to be used without mailbox annotations.</t><t>Require i;unicode-casemap when COMPARATOR is not present.</t><t>Use ENABLE to turn on unsolicited responses.</t><t>Use formal syntax elements from SORT/THREAD extensions to define the values for /sort and /thread entries.</t><t>Added a comment that use of IDLE is preferred even when /check is true.</t><t>Use formal syntax element from base spec for the /size value.</t><t>Removed IANA registration for attributes as we don't expect any more to be defined.</t><t>Tweaked IANA registration template to be more compact and add RFC Number reference.</t><t>Some minor re-phrasing was done.</t><t>Added text about handling of annotations on INBOX when it is renamed.</t><t>Require a BAD response when an unknown collation is used in LISTEXT selection option.</t></list></t><t>Changes from -10 to -11:<list style='numbers'><t>Added new paragraph to indicate that values may be read-only or computed.</t><t>/admin server annotation value now must be a URI.</t><t>Clarified that SORT and THREAD extensions are not required.</t><t>Fixed use of undefined entries in some examples.</t><t>Fixed many examples.</t><t>Added IANA registration for LIST-EXTENDED items.</t><t>Added match type and collation identifier to the LIST-EXTENDED selection option.</t><t>Made support for IMAP-I18N a requirement.</t><t>Minor text clarifications applied.</t><t>Remove mailbox list set atomicity requirement.</t><t>Clarified that annotations can only be set on mailboxes that actually exist.</t></list></t><t>Changes from -09 to -10:<list style='numbers'><t>Updated to rfc 4466 reference.</t><t>Reworded data model description.</t><t>Reworked LIST-EXTENDED so that responses have metadata items after the mailbox info.</t><t>Various spelling fixes.</t></list></t><t>Changes from -08 to -09:<list style='numbers'><t>Remove content-language attribute and reference.</t><t>Changed capability and command names.</t><t>Revised abstract.</t></list></t><t>Changes from -07 to -08:<list style='numbers'><t>Changed 'string' formal syntax to 'list-mailbox' and 'astring' for entry/attribute names.</t><t>Updated examples to match new astring syntax.</t><t>Changed CAPABILITY name due to incompatible syntax change.</t><t>Removed content-type attribute.</t><t>Added Content-type to IANA registration for entries.</t><t>Removed vendor attributes.</t><t>Fixed examples in section 3.3 for multi-mailbox and multi-entry cases.</t><t>Removed wildcards for attributes.</t><t>Entry/attributes can now only be ASCII.</t><t>Tied up text wrt storing/fetching.</t><t>Added Conventions section</t><t>Entry/attributes MUST NOT contain consecutive or trailing '/' or '.'.</t><t>Changed to use IMAP ABNF extensions document for some formal syntax items.</t></list></t><t>Changes from -06 to -07:<list style='numbers'><t>Reworded /checkperiod item.</t><t>Clarified unsolicited response behavior.</t></list></t><t>Changes from -05 to -06:<list style='numbers'><t>Removed 'modifiedsince' attribute as there is currently no use for it.</t><t>Added content-language attribute.</t><t>Changed access to allow .priv and .shared on any mailbox returned by LIST/LSUB.</t><t>Added IANA registrations for items defined in this document.</t><t>Added latest IPR statement.</t><t>Updated references.</t></list></t><t>Changes from -04 to -05:<list style='numbers'><t>Fix for valid IMAP state of commands.</t><t>Fix formatting, ID nits etc.</t></list></t><t>Changes from -03 to -04:<list style='numbers'><t>Allow retrieval of shared annotations for READ-ONLY mailbox.</t><t>Clarification of annotation loss on implicit removal of \Noselect mailboxes.</t><t>Now requires roll-back of all changes to matching mailboxes if there is a partial failure in SETANNOTATION.</t></list></t><t>Changes from -02 to -03:<list style='numbers'><t>Reworked entry naming scheme to split out mailbox name and use empty string for server items.</t></list></t><t>Changes from -01 to -02:<list style='numbers'><t>SETANNOTATION lists use (..).</t><t>Explicitly state behavior of unsolicited responses.</t><t>Adding SHOULD behavior for rename/delete of mailboxes.</t><t>Added statement about supporting annotations on \Noselect mailboxes.</t><t>Cleaned up formal syntax to use IMAP string type for entry and attributes, with requirements on how the string is formatted.</t><t>Use of ACAP vendor subtree registry for vendor tokens.</t></list></t><t>Changes from -00 to -01:<list style='numbers'><t>Multiple entry-att responses are now simply delimited by spaces in line with ANNOTATE spec. Adjusted examples to match.</t><t>Fixed entry-list formal syntax item to account for unsolicited parenthesized list of entries.</t><t>Removed setentries formal syntax item for simplicity since its only used once.</t><t>Removed reference to 'message annotation' in section 5.1.</t><t>Changed formal syntax to restrict top level entries to /server and /mailbox/{...} only. Re-arranged entry names section to account for this change.</t><t>Added comment and example for ANNOTATION response to allow servers to return separate responses for each entry if desired.</t></list></t></section></back></rfc>