rfc5464.IMAP_METADATA_extension.txt 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177
  1. Network Working Group C. Daboo
  2. Request for Comments: 5464 Apple, Inc.
  3. Category: Standards Track February 2009
  4. The IMAP METADATA Extension
  5. Status of This Memo
  6. This document specifies an Internet standards track protocol for the
  7. Internet community, and requests discussion and suggestions for
  8. improvements. Please refer to the current edition of the "Internet
  9. Official Protocol Standards" (STD 1) for the standardization state
  10. and status of this protocol. Distribution of this memo is unlimited.
  11. Abstract
  12. The METADATA extension to the Internet Message Access Protocol
  13. permits clients and servers to maintain "annotations" or "metadata"
  14. on IMAP servers. It is possible to have annotations on a per-mailbox
  15. basis or on the server as a whole. For example, this would allow
  16. comments about the purpose of a particular mailbox to be "attached"
  17. to that mailbox, or a "message of the day" containing server status
  18. information to be made available to anyone logging in to the server.
  19. Daboo Standards Track [Page 1]
  20. RFC 5464 The IMAP METADATA Extension February 2009
  21. Table of Contents
  22. 1. Introduction and Overview . . . . . . . . . . . . . . . . . . 3
  23. 2. Conventions Used in This Document . . . . . . . . . . . . . . 3
  24. 3. Data Model . . . . . . . . . . . . . . . . . . . . . . . . . . 4
  25. 3.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . 4
  26. 3.2. Namespace of Entries . . . . . . . . . . . . . . . . . . . 4
  27. 3.2.1. Entry Names . . . . . . . . . . . . . . . . . . . . . 5
  28. 3.3. Private versus Shared and Access Control . . . . . . . . . 6
  29. 4. IMAP Protocol Changes . . . . . . . . . . . . . . . . . . . . 7
  30. 4.1. General Considerations . . . . . . . . . . . . . . . . . . 7
  31. 4.2. GETMETADATA Command . . . . . . . . . . . . . . . . . . . 8
  32. 4.2.1. MAXSIZE GETMETADATA Command Option . . . . . . . . . . 9
  33. 4.2.2. DEPTH GETMETADATA Command Option . . . . . . . . . . . 10
  34. 4.3. SETMETADATA Command . . . . . . . . . . . . . . . . . . . 10
  35. 4.4. METADATA Response . . . . . . . . . . . . . . . . . . . . 12
  36. 4.4.1. METADATA Response with Values . . . . . . . . . . . . 13
  37. 4.4.2. Unsolicited METADATA Response without Values . . . . . 13
  38. 5. Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . . 14
  39. 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 16
  40. 6.1. Entry and Attribute Registration Template . . . . . . . . 16
  41. 6.2. Server Entry Registrations . . . . . . . . . . . . . . . . 16
  42. 6.2.1. /shared/comment . . . . . . . . . . . . . . . . . . . 17
  43. 6.2.2. /shared/admin . . . . . . . . . . . . . . . . . . . . 17
  44. 6.3. Mailbox Entry Registrations . . . . . . . . . . . . . . . 17
  45. 6.3.1. /shared/comment . . . . . . . . . . . . . . . . . . . 18
  46. 6.3.2. /private/comment . . . . . . . . . . . . . . . . . . . 18
  47. 7. Security Considerations . . . . . . . . . . . . . . . . . . . 18
  48. 8. Normative References . . . . . . . . . . . . . . . . . . . . . 19
  49. Appendix A. Acknowledgments . . . . . . . . . . . . . . . . . . . 19
  50. Daboo Standards Track [Page 2]
  51. RFC 5464 The IMAP METADATA Extension February 2009
  52. 1. Introduction and Overview
  53. The goal of the METADATA extension is to provide a means for clients
  54. to set and retrieve "annotations" or "metadata" on an IMAP server.
  55. The annotations can be associated with specific mailboxes or the
  56. server as a whole. The server can choose to support only server
  57. annotations or both server and mailbox annotations.
  58. A server that supports both server and mailbox annotations indicates
  59. the presence of this extension by returning "METADATA" as one of the
  60. supported capabilities in the CAPABILITY command response.
  61. A server that supports only server annotations indicates the presence
  62. of this extension by returning "METADATA-SERVER" as one of the
  63. supported capabilities in the CAPABILITY command response.
  64. A server that supports unsolicited annotation change responses MUST
  65. support the "ENABLE" [RFC5161] extension to allow clients to turn
  66. that feature on.
  67. The METADATA extension adds two new commands and one new untagged
  68. response to the IMAP base protocol.
  69. This extension makes the following changes to the IMAP protocol:
  70. o adds a new SETMETADATA command
  71. o adds a new GETMETADATA command
  72. o adds a new METADATA untagged response
  73. o adds a new METADATA response code
  74. The rest of this document describes the data model and protocol
  75. changes more rigorously.
  76. 2. Conventions Used in This Document
  77. In examples, "C:" and "S:" indicate lines sent by the client and
  78. server, respectively.
  79. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
  80. "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
  81. document are to be interpreted as described in [RFC2119].
  82. Whitespace and line breaks have been added to the examples in this
  83. document to promote readability.
  84. Daboo Standards Track [Page 3]
  85. RFC 5464 The IMAP METADATA Extension February 2009
  86. 3. Data Model
  87. 3.1. Overview
  88. Mailboxes or the server as a whole may have zero or more annotations
  89. associated with them. An annotation contains a uniquely named entry,
  90. which has a value. Annotations can be added to mailboxes when a
  91. mailbox name is provided as the first argument to the SETMETADATA
  92. command, or to the server as a whole when the empty string is
  93. provided as the first argument to the command.
  94. For example, a general comment being added to a mailbox may have an
  95. entry name of "/comment" and a value of "Really useful mailbox".
  96. The protocol changes to IMAP described below allow a client to access
  97. or change the values of any annotation entry, assuming it has
  98. sufficient access rights to do so.
  99. 3.2. Namespace of Entries
  100. Each annotation is an entry that has a hierarchical name, with each
  101. component of the name separated by a slash ("/"). An entry name MUST
  102. NOT contain two consecutive "/" characters and MUST NOT end with a
  103. "/" character.
  104. The value of an entry is NIL (has no value), or a string or binary
  105. data of zero or more octets. A string MAY contain multiple lines of
  106. text. Clients MUST use the CRLF (0x0D 0x0A) character octet sequence
  107. to represent line ends in a multi-line string value.
  108. Entry names MUST NOT contain asterisk ("*") or percent ("%")
  109. characters and MUST NOT contain non-ASCII characters or characters
  110. with octet values in the range 0x00 to 0x19. Invalid entry names
  111. result in a BAD response in any IMAP command in which they are used.
  112. Entry names are case-insensitive.
  113. Use of control or punctuation characters in entry names is strongly
  114. discouraged.
  115. This specification defines an initial set of entry names available
  116. for use with mailbox and server annotations. In addition, an
  117. extension mechanism is described to allow additional names to be
  118. added for extensibility.
  119. The first component in entry names defines the scope of the
  120. annotation. Currently, only the prefixes "/private" or "/shared" are
  121. defined. These prefixes are used to indicate whether an annotation
  122. Daboo Standards Track [Page 4]
  123. RFC 5464 The IMAP METADATA Extension February 2009
  124. is stored on a per-user basis ("/private") and not visible to other
  125. users, or whether an annotation is shared between authorized users
  126. ("/shared") with a single value that can be read and changed by
  127. authorized users with appropriate access. See Section 3.3 for
  128. details.
  129. Entry names can have any number of components starting at 2, unless
  130. they fall under the vendor namespaces (i.e., have a /shared/vendor/
  131. <vendor-token> or /private/vendor/<vendor-token> prefix as described
  132. below), in which case they have at least 4 components.
  133. 3.2.1. Entry Names
  134. Entry names MUST be specified in a Standards Track or IESG-approved
  135. Experimental RFC, or fall under the vendor namespace. See
  136. Section 6.1 for the registration template.
  137. 3.2.1.1. Server Entries
  138. These entries are set or retrieved when the mailbox name argument to
  139. the new SETMETADATA or GETMETADATA command is the empty string.
  140. /shared/comment
  141. Defines a comment or note that is associated with the server and
  142. that is shared with authorized users of the server.
  143. /shared/admin
  144. Indicates a method for contacting the server administrator. The
  145. value MUST be a URI (e.g., a mailto: or tel: URL). This entry is
  146. always read-only -- clients cannot change it. It is visible to
  147. authorized users of the system.
  148. /shared/vendor/<vendor-token>
  149. Defines the top level of shared entries associated with the
  150. server, as created by a particular product of some vendor. This
  151. entry can be used by vendors to provide server- or client-specific
  152. annotations. The vendor-token MUST be registered with IANA, using
  153. the Application Configuration Access Protocol (ACAP) [RFC2244]
  154. vendor subtree registry.
  155. /private/vendor/<vendor-token>
  156. Defines the top level of private entries associated with the
  157. server, as created by a particular product of some vendor. This
  158. entry can be used by vendors to provide server- or client-specific
  159. Daboo Standards Track [Page 5]
  160. RFC 5464 The IMAP METADATA Extension February 2009
  161. annotations. The vendor-token MUST be registered with IANA, using
  162. the ACAP [RFC2244] vendor subtree registry.
  163. 3.2.1.2. Mailbox Entries
  164. These entries are set or retrieved when the mailbox name argument to
  165. the new SETMETADATA or GETMETADATA command is not the empty string.
  166. /shared/comment
  167. Defines a shared comment or note associated with a mailbox.
  168. /private/comment
  169. Defines a private (per-user) comment or note associated with a
  170. mailbox.
  171. /shared/vendor/<vendor-token>
  172. Defines the top level of shared entries associated with a specific
  173. mailbox, as created by a particular product of some vendor. This
  174. entry can be used by vendors to provide client-specific
  175. annotations. The vendor-token MUST be registered with IANA, using
  176. the ACAP [RFC2244] vendor subtree registry.
  177. /private/vendor/<vendor-token>
  178. Defines the top level of private entries associated with a
  179. specific mailbox, as created by a particular product of some
  180. vendor. This entry can be used by vendors to provide client-
  181. specific annotations. The vendor-token MUST be registered with
  182. IANA, using the ACAP [RFC2244] vendor subtree registry.
  183. 3.3. Private versus Shared and Access Control
  184. In the absence of the ACL (Access Control List) extension [RFC4314],
  185. users can only set and retrieve private or shared mailbox annotations
  186. on a mailbox that exists and is returned to them via a LIST or LSUB
  187. command, and on which they have either read or write access to the
  188. actual message content of the mailbox (as determined by the READ-ONLY
  189. and READ-WRITE response codes as described in Section 5.2 of
  190. [RFC4314]).
  191. When the ACL extension [RFC4314] is present, users can only set and
  192. retrieve private or shared mailbox annotations on a mailbox on which
  193. they have the "l" right and any one of the "r", "s", "w", "i", or "p"
  194. rights.
  195. Daboo Standards Track [Page 6]
  196. RFC 5464 The IMAP METADATA Extension February 2009
  197. If a client attempts to set or retrieve annotations on mailboxes that
  198. do not satisfy the conditions above, the server MUST respond with a
  199. NO response.
  200. Users can always retrieve private or shared server annotations if
  201. they exist. Servers MAY restrict the creation of private or shared
  202. server annotations as appropriate. When restricted, the server MUST
  203. return a NO response when the SETMETADATA command is used to try to
  204. create a server annotation.
  205. If the METADATA extension is present, support for shared annotations
  206. is REQUIRED, whilst support for private annotations is OPTIONAL.
  207. This recognizes the fact that support for private annotations may
  208. introduce significantly more complexity to a server in terms of
  209. tracking ownership of the annotations, how quota is determined for
  210. users based on their own annotations, etc.
  211. 4. IMAP Protocol Changes
  212. 4.1. General Considerations
  213. The new SETMETADATA command and the METADATA response each have a
  214. mailbox name argument. An empty string is used for the mailbox name
  215. to signify server annotations. A non-empty string is used to signify
  216. mailbox annotations attached to the corresponding mailbox.
  217. Servers SHOULD ensure that mailbox annotations are automatically
  218. moved when the mailbox they refer to is renamed, i.e., the
  219. annotations follow the mailbox. This applies to a rename of the
  220. INBOX, with the additional behavior that the annotations are copied
  221. from the original INBOX to the renamed mailbox, i.e., mailbox
  222. annotations are preserved on the INBOX when it is renamed.
  223. Servers SHOULD delete annotations for a mailbox when the mailbox is
  224. deleted, so that a mailbox created with the same name as a previously
  225. existing mailbox does not inherit the old mailbox annotations.
  226. Servers SHOULD allow annotations on all 'types' of mailboxes,
  227. including ones reporting \Noselect for their LIST response. Servers
  228. can implicitly remove \Noselect mailboxes when all child mailboxes
  229. are removed, and, at that time any annotations associated with the
  230. \Noselect mailbox SHOULD be removed.
  231. The server is allowed to impose limitations on the size of any one
  232. annotation or the total number of annotations for a single mailbox or
  233. for the server as a whole. However, the server MUST accept an
  234. annotation data size of at least 1024 bytes, and an annotation count
  235. per server or mailbox of at least 10.
  236. Daboo Standards Track [Page 7]
  237. RFC 5464 The IMAP METADATA Extension February 2009
  238. Some annotations may be "read-only" -- i.e., they are set by the
  239. server and cannot be changed by the client. Also, such annotations
  240. may be "computed" -- i.e., the value changes based on underlying
  241. properties of the mailbox or server. For example, an annotation
  242. reporting the total size of all messages in the mailbox would change
  243. as messages are added or removed. Or, an annotation containing an
  244. IMAP URL for the mailbox would change if the mailbox was renamed.
  245. Servers MAY support sending unsolicited responses for use when
  246. annotations are changed by some "third-party" (see Section 4.4). In
  247. order to do so, servers MUST support the ENABLE command [RFC5161] and
  248. MUST only send unsolicited responses if the client used the ENABLE
  249. command [RFC5161] extension with the capability string "METADATA" or
  250. "METADATA-SERVER" earlier in the session, depending on which of those
  251. capabilities is supported by the server.
  252. 4.2. GETMETADATA Command
  253. This extension adds the GETMETADATA command. This allows clients to
  254. retrieve server or mailbox annotations.
  255. This command is only available in authenticated or selected state
  256. [RFC3501].
  257. Arguments: mailbox-name
  258. options
  259. entry-specifier
  260. Responses: required METADATA response
  261. Result: OK - command completed
  262. NO - command failure: can't access annotations on
  263. the server
  264. BAD - command unknown or arguments invalid
  265. When the mailbox name is the empty string, this command retrieves
  266. server annotations. When the mailbox name is not empty, this command
  267. retrieves annotations on the specified mailbox.
  268. Options MAY be included with this command and are defined below.
  269. Example:
  270. C: a GETMETADATA "" /shared/comment
  271. S: * METADATA "" (/shared/comment "Shared comment")
  272. S: a OK GETMETADATA complete
  273. Daboo Standards Track [Page 8]
  274. RFC 5464 The IMAP METADATA Extension February 2009
  275. In the above example, the contents of the value of the "/shared/
  276. comment" server entry is requested by the client and returned by
  277. the server.
  278. Example:
  279. C: a GETMETADATA "INBOX" /private/comment
  280. S: * METADATA "INBOX" (/private/comment "My own comment")
  281. S: a OK GETMETADATA complete
  282. In the above example, the contents of the value of the "/private/
  283. comment" mailbox entry for the mailbox "INBOX" is requested by the
  284. client and returned by the server.
  285. Entry specifiers can be lists of atomic specifiers, so that multiple
  286. annotations may be returned in a single GETMETADATA command.
  287. Example:
  288. C: a GETMETADATA "INBOX" (/shared/comment /private/comment)
  289. S: * METADATA "INBOX" (/shared/comment "Shared comment"
  290. /private/comment "My own comment")
  291. S: a OK GETMETADATA complete
  292. In the above example, the values of the two server entries
  293. "/shared/comment" and "/private/comment" on the mailbox "INBOX"
  294. are requested by the client and returned by the server.
  295. 4.2.1. MAXSIZE GETMETADATA Command Option
  296. When the MAXSIZE option is specified with the GETMETADATA command, it
  297. restricts which entry values are returned by the server. Only entry
  298. values that are less than or equal in octet size to the specified
  299. MAXSIZE limit are returned. If there are any entries with values
  300. larger than the MAXSIZE limit, the server MUST include the METADATA
  301. LONGENTRIES response code in the tagged OK response for the
  302. GETMETADATA command. The METADATA LONGENTRIES response code returns
  303. the size of the biggest entry value requested by the client that
  304. exceeded the MAXSIZE limit.
  305. Example:
  306. C: a GETMETADATA "INBOX" (MAXSIZE 1024)
  307. (/shared/comment /private/comment)
  308. S: * METADATA "INBOX" (/private/comment "My own comment")
  309. S: a OK [METADATA LONGENTRIES 2199] GETMETADATA complete
  310. Daboo Standards Track [Page 9]
  311. RFC 5464 The IMAP METADATA Extension February 2009
  312. In the above example, the values of the two server entries
  313. "/shared/comment" and "/private/comment" on the mailbox "INBOX"
  314. are requested by the client, which wants to restrict the size of
  315. returned values to 1024 octets. In this case, the "/shared/
  316. comment" entry value is 2199 octets and is not returned.
  317. 4.2.2. DEPTH GETMETADATA Command Option
  318. When the DEPTH option is specified with the GETMETADATA command, it
  319. extends the list of entry values returned by the server. For each
  320. entry name specified in the GETMETADATA command, the server returns
  321. the value of the specified entry name (if it exists), plus all
  322. entries below the entry name up to the specified DEPTH. Three values
  323. are allowed for DEPTH:
  324. "0" - no entries below the specified entry are returned
  325. "1" - only entries immediately below the specified entry are returned
  326. "infinity" - all entries below the specified entry are returned
  327. Thus, "depth 1" for an entry "/a" will match "/a" as well as its
  328. children entries (e.g., "/a/b"), but will not match grandchildren
  329. entries (e.g., "/a/b/c").
  330. If the DEPTH option is not specified, this is the same as specifying
  331. "DEPTH 0".
  332. Example:
  333. C: a GETMETADATA "INBOX" (DEPTH 1)
  334. (/private/filters/values)
  335. S: * METADATA "INBOX" (/private/filters/values/small
  336. "SMALLER 5000" /private/filters/values/boss
  337. "FROM \"boss@example.com\"")
  338. S: a OK GETMETADATA complete
  339. In the above example, 2 entries below the /private/filters/values
  340. entry exist on the mailbox "INBOX": "/private/filters/values/
  341. small" and "/private/filters/values/boss".
  342. 4.3. SETMETADATA Command
  343. This extension adds the SETMETADATA command. This allows clients to
  344. set annotations.
  345. This command is only available in authenticated or selected state
  346. [RFC3501].
  347. Daboo Standards Track [Page 10]
  348. RFC 5464 The IMAP METADATA Extension February 2009
  349. Arguments: mailbox-name
  350. entry
  351. value
  352. list of entry, values
  353. Responses: no specific responses for this command
  354. Result: OK - command completed
  355. NO - command failure: can't set annotations,
  356. or annotation too big or too many
  357. BAD - command unknown or arguments invalid
  358. This command sets the specified list of entries by adding or
  359. replacing the specified values provided, on the specified existing
  360. mailboxes or on the server (if the mailbox argument is the empty
  361. string). Clients can use NIL for the value of entries it wants to
  362. remove. The server SHOULD NOT return a METADATA response containing
  363. the updated annotation data. Clients MUST NOT assume that a METADATA
  364. response will be sent, and MUST assume that if the command succeeds,
  365. then the annotation has been changed.
  366. If the server is unable to set an annotation because the size of its
  367. value is too large, the server MUST return a tagged NO response with
  368. a "[METADATA MAXSIZE NNN]" response code when NNN is the maximum
  369. octet count that it is willing to accept.
  370. If the server is unable to set a new annotation because the maximum
  371. number of allowed annotations has already been reached, the server
  372. MUST return a tagged NO response with a "[METADATA TOOMANY]" response
  373. code.
  374. If the server is unable to set a new annotation because it does not
  375. support private annotations on one of the specified mailboxes, the
  376. server MUST return a tagged NO response with a "[METADATA NOPRIVATE]"
  377. response code.
  378. When any one annotation fails to be set, resulting in a tagged NO
  379. response from the server, then the server MUST NOT change the values
  380. for other annotations specified in the SETMETADATA command.
  381. Example:
  382. C: a SETMETADATA INBOX (/private/comment {33}
  383. S: + ready for data
  384. My new comment across
  385. two lines.
  386. )
  387. S: a OK SETMETADATA complete
  388. Daboo Standards Track [Page 11]
  389. RFC 5464 The IMAP METADATA Extension February 2009
  390. In the above example, the entry "/private/comment" for the mailbox
  391. "INBOX" is created (if not already present) and the value set to a
  392. multi-line string.
  393. Example:
  394. C: a SETMETADATA INBOX (/private/comment NIL)
  395. S: a OK SETMETADATA complete
  396. In the above example, the entry "/private/comment" is removed from
  397. the mailbox "INBOX".
  398. Multiple entries can be set in a single SETMETADATA command by
  399. listing entry-value pairs in the list.
  400. Example:
  401. C: a SETMETADATA INBOX (/private/comment "My new comment"
  402. /shared/comment "This one is for you!")
  403. S: a OK SETMETADATA complete
  404. In the above example, the entries "/private/comment" and "/shared/
  405. comment" for the mailbox "INBOX" are created (if not already
  406. present) and the values set as specified.
  407. Example:
  408. C: a SETMETADATA INBOX (/private/comment "My new comment")
  409. S: a NO [METADATA TOOMANY] SETMETADATA failed
  410. In the above example, the server is unable to set the requested
  411. (new) annotation as it has reached the limit on the number of
  412. annotations it can support on the specified mailbox.
  413. 4.4. METADATA Response
  414. The METADATA response displays results of a GETMETADATA command, or
  415. can be returned as an unsolicited response at any time by the server
  416. in response to a change in a server or mailbox annotation.
  417. When unsolicited responses are activated by the ENABLE [RFC5161]
  418. command for this extension, servers MUST send unsolicited METADATA
  419. responses if server or mailbox annotations are changed by a third-
  420. party, allowing servers to keep clients updated with changes.
  421. Unsolicited METADATA responses MUST only contain entry names, not the
  422. values. If the client wants to update any cached values, it must
  423. explicitly retrieve those using a GETMETADATA command.
  424. Daboo Standards Track [Page 12]
  425. RFC 5464 The IMAP METADATA Extension February 2009
  426. The METADATA response can contain multiple entries in a single
  427. response, but the server is free to return multiple responses for
  428. each entry or group of entries, if it desires.
  429. This response is only available in authenticated or selected state
  430. [RFC3501].
  431. 4.4.1. METADATA Response with Values
  432. The response consists of a list of entry-value pairs.
  433. Example:
  434. C: a GETMETADATA "" /shared/comment
  435. S: * METADATA "" (/shared/comment "My comment")
  436. S: a OK GETMETADATA complete
  437. In the above example, a single entry with its value is returned by
  438. the server.
  439. Example:
  440. C: a GETMETADATA "INBOX" /private/comment /shared/comment
  441. S: * METADATA "INBOX" (/private/comment "My comment"
  442. /shared/comment "Its sunny outside!")
  443. S: a OK GETMETADATA complete
  444. In the above example, two entries and their values are returned by
  445. the server.
  446. Example:
  447. C: a GETMETADATA "INBOX" /private/comment /shared/comment
  448. S: * METADATA "INBOX" (/private/comment "My comment")
  449. S: * METADATA "INBOX" (/shared/comment "Its sunny outside!")
  450. S: a OK GETMETADATA complete
  451. In the above example, the server returns two separate responses
  452. for each of the two entries requested.
  453. 4.4.2. Unsolicited METADATA Response without Values
  454. The response consists of a list of entries, each of which have
  455. changed on the server or mailbox.
  456. Example:
  457. Daboo Standards Track [Page 13]
  458. RFC 5464 The IMAP METADATA Extension February 2009
  459. C: a NOOP
  460. S: * METADATA "" /shared/comment
  461. S: a OK NOOP complete
  462. In the above example, the server indicates that the "/shared/
  463. comment" server entry has been changed.
  464. Example:
  465. C: a NOOP
  466. S: * METADATA "INBOX" /shared/comment /private/comment
  467. S: a OK NOOP complete
  468. In the above example, the server indicates a change to two mailbox
  469. entries.
  470. 5. Formal Syntax
  471. The following syntax specification uses the Augmented Backus-Naur
  472. Form (ABNF) notation as specified in [RFC5234].
  473. Non-terminals referenced but not defined below are as defined by
  474. [RFC3501], with the new definitions in [RFC4466] superseding those in
  475. [RFC3501].
  476. Except as noted otherwise, all alphabetic characters are case-
  477. insensitive. The use of upper or lower case characters to define
  478. token strings is for editorial clarity only. Implementations MUST
  479. accept these strings in a case-insensitive fashion.
  480. capability =/ "METADATA" / "METADATA-SERVER"
  481. ; defines the capabilities for this extension.
  482. command-auth =/ setmetadata / getmetadata
  483. ; adds to original IMAP command
  484. entries = entry /
  485. "(" entry *(SP entry) ")"
  486. ; entry specifiers
  487. entry = astring
  488. ; slash-separated path to entry
  489. ; MUST NOT contain "*" or "%"
  490. entry-value = entry SP value
  491. entry-values = "(" entry-value *(SP entry-value) ")"
  492. Daboo Standards Track [Page 14]
  493. RFC 5464 The IMAP METADATA Extension February 2009
  494. entry-list = entry *(SP entry)
  495. ; list of entries used in unsolicited
  496. ; METADATA response
  497. getmetadata = "GETMETADATA" [SP getmetadata-options]
  498. SP mailbox SP entries
  499. ; empty string for mailbox implies
  500. ; server annotation.
  501. getmetadata-options = "(" getmetadata-option
  502. *(SP getmetadata-option) ")"
  503. getmetadata-option = tagged-ext-label [SP tagged-ext-val]
  504. ; tagged-ext-label and tagged-ext-val
  505. ; are defined in [RFC4466].
  506. maxsize-opt = "MAXSIZE" SP number
  507. ; Used as a getmetadata-option
  508. metadata-resp = "METADATA" SP mailbox SP
  509. (entry-values / entry-list)
  510. ; empty string for mailbox implies
  511. ; server annotation.
  512. response-payload =/ metadata-resp
  513. ; adds to original IMAP data responses
  514. resp-text-code =/ "METADATA" SP "LONGENTRIES" SP number
  515. ; new response codes for GETMETADATA
  516. resp-text-code =/ "METADATA" SP ("MAXSIZE" SP number /
  517. "TOOMANY" / "NOPRIVATE")
  518. ; new response codes for SETMETADATA
  519. ; failures
  520. scope-opt = "DEPTH" SP ("0" / "1" / "infinity")
  521. ; Used as a getmetadata-option
  522. setmetadata = "SETMETADATA" SP mailbox
  523. SP entry-values
  524. ; empty string for mailbox implies
  525. ; server annotation.
  526. value = nstring / literal8
  527. Daboo Standards Track [Page 15]
  528. RFC 5464 The IMAP METADATA Extension February 2009
  529. 6. IANA Considerations
  530. All entries MUST have either "/shared" or "/private" as a prefix.
  531. Entry names MUST be specified in a Standards Track or IESG-approved
  532. Experimental RFC, or fall under the vendor namespace (i.e., use
  533. /shared/vendor/<vendor-token> or /private/vendor/<vendor-token> as
  534. the prefix).
  535. Each entry registration MUST include a content-type that is used to
  536. indicate the nature of the annotation value. Where applicable, a
  537. charset parameter MUST be included with the content-type.
  538. 6.1. Entry and Attribute Registration Template
  539. To: iana@iana.org
  540. Subject: IMAP METADATA Entry Registration
  541. Type: [Either "Mailbox" or "Server"]
  542. Name: [the name of the entry]
  543. Description: [a description of what the entry is for]
  544. Content-type: [MIME Content-Type and charset for the entry value]
  545. RFC Number: [for entries published as RFCs]
  546. Contact: [email and/or physical address to contact for
  547. additional information]
  548. 6.2. Server Entry Registrations
  549. The following templates specify the IANA registrations of annotation
  550. entries specified in this document.
  551. Daboo Standards Track [Page 16]
  552. RFC 5464 The IMAP METADATA Extension February 2009
  553. 6.2.1. /shared/comment
  554. To: iana@iana.org
  555. Subject: IMAP METADATA Entry Registration
  556. Type: Server
  557. Name: /shared/comment
  558. Description: Defines a comment or note that is associated
  559. with the server and that is shared with
  560. authorized users of the server.
  561. Content-type: text/plain; charset=utf-8
  562. RFC Number: RFC 5464
  563. Contact: IMAP Extensions mailto:ietf-imapext@imc.org
  564. 6.2.2. /shared/admin
  565. To: iana@iana.org
  566. Subject: IMAP METADATA Entry Registration
  567. Type: Server
  568. Name: /shared/admin
  569. Description: Indicates a method for contacting the server
  570. administrator. The value MUST be a URI (e.g., a
  571. mailto: or tel: URL). This entry is always
  572. read-only -- clients cannot change it. It is visible
  573. to authorized users of the system.
  574. Content-type: text/plain; charset=utf-8
  575. RFC Number: RFC 5464
  576. Contact: IMAP Extensions mailto:ietf-imapext@imc.org
  577. 6.3. Mailbox Entry Registrations
  578. The following templates specify the IANA registrations of annotation
  579. entries specified in this document.
  580. Daboo Standards Track [Page 17]
  581. RFC 5464 The IMAP METADATA Extension February 2009
  582. 6.3.1. /shared/comment
  583. To: iana@iana.org
  584. Subject: IMAP METADATA Entry Registration
  585. Type: Mailbox
  586. Name: /shared/comment
  587. Description: Defines a shared comment or note associated with a
  588. mailbox.
  589. Content-type: text/plain; charset=utf-8
  590. RFC Number: RFC 5464
  591. Contact: IMAP Extensions mailto:ietf-imapext@imc.org
  592. 6.3.2. /private/comment
  593. To: iana@iana.org
  594. Subject: IMAP METADATA Entry Registration
  595. Type: Mailbox
  596. Name: /private/comment
  597. Description: Defines a private comment or note associated with a
  598. mailbox.
  599. Content-type: text/plain; charset=utf-8
  600. RFC Number: RFC 5464
  601. Contact: IMAP Extensions mailto:ietf-imapext@imc.org
  602. 7. Security Considerations
  603. The security considerations in Section 11 of [RFC3501] apply here
  604. with respect to protecting annotations from snooping. Servers MAY
  605. choose to only support the METADATA and/or METADATA-SERVER extensions
  606. after a privacy layer has been negotiated by the client.
  607. Annotations can contain arbitrary data of varying size. As such,
  608. servers MUST ensure that size limits are enforced to prevent a user
  609. from using up all available space on a server and preventing use by
  610. others. Clients MUST treat annotation data values as an "untrusted"
  611. source of data as it is possible for it to contain malicious content.
  612. Daboo Standards Track [Page 18]
  613. RFC 5464 The IMAP METADATA Extension February 2009
  614. Annotations whose values are intended to remain private MUST be
  615. stored only in entries that have the "/private" prefix on the entry
  616. name.
  617. Excluding the above issues, the METADATA extension does not raise any
  618. security considerations that are not present in the base IMAP
  619. protocol, and these issues are discussed in [RFC3501].
  620. 8. Normative References
  621. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
  622. Requirement Levels", BCP 14, RFC 2119, March 1997.
  623. [RFC2244] Newman, C. and J. Myers, "ACAP -- Application
  624. Configuration Access Protocol", RFC 2244, November 1997.
  625. [RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION
  626. 4rev1", RFC 3501, March 2003.
  627. [RFC4314] Melnikov, A., "IMAP4 Access Control List (ACL) Extension",
  628. RFC 4314, December 2005.
  629. [RFC4466] Melnikov, A. and C. Daboo, "Collected Extensions to IMAP4
  630. ABNF", RFC 4466, April 2006.
  631. [RFC5161] Gulbrandsen, A. and A. Melnikov, "The IMAP ENABLE
  632. Extension", RFC 5161, March 2008.
  633. [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax
  634. Specifications: ABNF", STD 68, RFC 5234, January 2008.
  635. Appendix A. Acknowledgments
  636. The ideas expressed in this document are based on the message
  637. annotation document that was co-authored by Randall Gellens. The
  638. author would like to thank the following individuals for contributing
  639. their ideas and support for writing this specification: Dave
  640. Cridland, Arnt Gulbrandsen, Dan Karp, Alexey Melnikov, Ken Murchison,
  641. Chris Newman, and Michael Wener.
  642. Daboo Standards Track [Page 19]
  643. RFC 5464 The IMAP METADATA Extension February 2009
  644. Author's Address
  645. Cyrus Daboo
  646. Apple Inc.
  647. 1 Infinite Loop
  648. Cupertino, CA 95014
  649. USA
  650. EMail: cyrus@daboo.name
  651. URI: http://www.apple.com/
  652. Daboo Standards Track [Page 20]
  653. RFC 5464 The IMAP METADATA Extension February 2009
  654. Full Copyright Statement
  655. Copyright (C) The IETF Trust (2009).
  656. This document is subject to the rights, licenses and restrictions
  657. contained in BCP 78, and except as set forth therein, the authors
  658. retain all their rights.
  659. This document and the information contained herein are provided on an
  660. "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
  661. OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND
  662. THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS
  663. OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF
  664. THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
  665. WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  666. Intellectual Property
  667. The IETF takes no position regarding the validity or scope of any
  668. Intellectual Property Rights or other rights that might be claimed to
  669. pertain to the implementation or use of the technology described in
  670. this document or the extent to which any license under such rights
  671. might or might not be available; nor does it represent that it has
  672. made any independent effort to identify any such rights. Information
  673. on the procedures with respect to rights in RFC documents can be
  674. found in BCP 78 and BCP 79.
  675. Copies of IPR disclosures made to the IETF Secretariat and any
  676. assurances of licenses to be made available, or the result of an
  677. attempt made to obtain a general license or permission for the use of
  678. such proprietary rights by implementers or users of this
  679. specification can be obtained from the IETF on-line IPR repository at
  680. http://www.ietf.org/ipr.
  681. The IETF invites any interested party to bring to its attention any
  682. copyrights, patents or patent applications, or other proprietary
  683. rights that may cover technology that may be required to implement
  684. this standard. Please address the information to the IETF at
  685. ietf-ipr@ietf.org.
  686. Daboo Standards Track [Page 21]