rfc5258.IMAP4_LIST_command_extension.txt 64 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739
  1. Network Working Group B. Leiba
  2. Request for Comments: 5258 IBM T.J. Watson Research Center
  3. Obsoletes: 3348 A. Melnikov
  4. Updates: 2193 Isode Limited
  5. Category: Standards Track June 2008
  6. Internet Message Access Protocol version 4 - LIST Command Extensions
  7. Status of This Memo
  8. This document specifies an Internet standards track protocol for the
  9. Internet community, and requests discussion and suggestions for
  10. improvements. Please refer to the current edition of the "Internet
  11. Official Protocol Standards" (STD 1) for the standardization state
  12. and status of this protocol. Distribution of this memo is unlimited.
  13. Abstract
  14. IMAP4 has two commands for listing mailboxes: LIST and LSUB. As we
  15. have added extensions, such as Mailbox Referrals, that have required
  16. specialized lists we have had to expand the number of list commands,
  17. since each extension must add its function to both LIST and LSUB, and
  18. these commands are not, as they are defined, extensible. If we've
  19. needed the extensions to work together, we've had to add a set of
  20. commands to mix the different options, the set increasing in size
  21. with each new extension. This document describes an extension to the
  22. base LIST command that will allow these additions to be done with
  23. mutually compatible options to the LIST command, avoiding the
  24. exponential increase in specialized list commands.
  25. Leiba & Melnikov Standards Track [Page 1]
  26. RFC 5258 IMAP4 LIST Command Extensions June 2008
  27. Table of Contents
  28. 1. Introduction and Overview . . . . . . . . . . . . . . . . . . 3
  29. 2. Conventions Used in This Document . . . . . . . . . . . . . . 4
  30. 3. Extended LIST Command . . . . . . . . . . . . . . . . . . . . 4
  31. 3.1. Initial List of Selection Options . . . . . . . . . . . . 7
  32. 3.2. Initial List of Return Options . . . . . . . . . . . . . . 8
  33. 3.3. General Principles for Returning LIST Responses . . . . . 9
  34. 3.4. Additional Requirements on LIST-EXTENDED Clients . . . . . 9
  35. 3.5. CHILDINFO Extended Data Item . . . . . . . . . . . . . . . 10
  36. 4. The CHILDREN Return Option . . . . . . . . . . . . . . . . . . 11
  37. 5. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
  38. 6. Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . . 19
  39. 7. Internationalization Considerations . . . . . . . . . . . . . 22
  40. 8. Security Considerations . . . . . . . . . . . . . . . . . . . 23
  41. 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 23
  42. 9.1. Guidelines for IANA . . . . . . . . . . . . . . . . . . . 23
  43. 9.2. Registration Procedure and Change Control . . . . . . . . 23
  44. 9.3. Registration Template for LIST-EXTENDED Options . . . . . 25
  45. 9.4. Initial LIST-EXTENDED Option Registrations . . . . . . . . 25
  46. 9.5. Registration Template for LIST-EXTENDED Extended Data
  47. Item . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
  48. 9.6. Initial LIST-EXTENDED Extended Data Item Registrations . . 28
  49. 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 29
  50. 11. References . . . . . . . . . . . . . . . . . . . . . . . . . . 29
  51. 11.1. Normative References . . . . . . . . . . . . . . . . . . . 29
  52. 11.2. Informative References . . . . . . . . . . . . . . . . . . 30
  53. Leiba & Melnikov Standards Track [Page 2]
  54. RFC 5258 IMAP4 LIST Command Extensions June 2008
  55. 1. Introduction and Overview
  56. The LIST command is extended by amending the syntax to allow options
  57. and multiple patterns to be specified. The list of options replaces
  58. the several commands that are currently used to mix and match the
  59. information requested. The new syntax is backward compatible, with
  60. no ambiguity: the new syntax is being used if one of the following
  61. conditions is true:
  62. 1. if the first word after the command name begins with a
  63. parenthesis ("LIST selection options")
  64. 2. if the second word after the command name begins with a
  65. parenthesis ("multiple mailbox patterns")
  66. 3. if the LIST command has more than 2 parameters ("LIST return
  67. options")
  68. Otherwise the original syntax is used.
  69. By adding options to the LIST command, we are announcing the intent
  70. to phase out and eventually to deprecate the RLIST and RLSUB commands
  71. described in [MBRef]. We are also defining the mechanism to request
  72. extended mailbox information, such as is described in the Child
  73. Mailbox Extension [CMbox]. The base LSUB command is not deprecated
  74. by this extension; rather, this extension adds a way to obtain
  75. subscription information with more options, with those server
  76. implementations that support it. Clients that simply need a list of
  77. subscribed mailboxes, as provided by the LSUB command, SHOULD
  78. continue to use that command.
  79. This document defines an IMAP4 extension that is identified by the
  80. capability string "LIST-EXTENDED". The LIST-EXTENDED extension makes
  81. the following changes to the IMAP4 protocol, which are described in
  82. more detail in Section 3 and Section 4:
  83. a. defines new syntax for LIST command options.
  84. b. extends LIST to allow for multiple mailbox patterns.
  85. c. adds LIST command selection options: SUBSCRIBED, REMOTE, and
  86. RECURSIVEMATCH.
  87. d. adds LIST command return options: SUBSCRIBED and CHILDREN.
  88. e. adds new mailbox attributes: "\NonExistent", "\Subscribed",
  89. "\Remote", "\HasChildren", and "\HasNoChildren".
  90. Leiba & Melnikov Standards Track [Page 3]
  91. RFC 5258 IMAP4 LIST Command Extensions June 2008
  92. f. adds CHILDINFO extended data item.
  93. 2. Conventions Used in This Document
  94. In examples, "C:" indicates lines sent by a client that is connected
  95. to a server. "S:" indicates lines sent by the server to the client.
  96. The key words "MUST", "MUST NOT", "SHOULD", "SHOULD NOT", and "MAY"
  97. are used in this document as specified in RFC 2119 [Kwds].
  98. The term "canonical LIST pattern" refers to the canonical pattern
  99. constructed internally by the server from the reference and mailbox
  100. name arguments (Section 6.3.8 of [IMAP4]). The [IMAP4] LIST command
  101. returns only mailboxes that match the canonical LIST pattern.
  102. Other terms are introduced where they are referenced for the first
  103. time.
  104. 3. Extended LIST Command
  105. This extension updates the syntax of the LIST command to allow for
  106. multiple mailbox patterns to be specified, if they are enclosed in
  107. parentheses. A mailbox name matches a list of mailbox patterns if it
  108. matches at least one mailbox pattern. If a mailbox name matches
  109. multiple mailbox patterns from the list, the server SHOULD return
  110. only a single LIST response.
  111. Note that the non-extended LIST command is required to treat an empty
  112. ("" string) mailbox name argument as a special request to return the
  113. hierarchy delimiter and the root name of the name given in the
  114. reference parameter (as per [IMAP4]). However, ANY extended LIST
  115. command (extended in any of 3 ways specified in Section 1, or any
  116. combination thereof) MUST NOT treat the empty mailbox name as such a
  117. special request, and any regular processing described in this
  118. document applies. In particular, if an extended LIST command has
  119. multiple mailbox names and one (or more) of them is the empty string,
  120. the empty string MUST be ignored for the purpose of matching.
  121. Some servers might restrict which patterns are allowed in a LIST
  122. command. If a server doesn't accept a particular pattern, it MUST
  123. silently ignore it.
  124. The LIST command syntax is also extended in two additional ways: by
  125. adding a parenthesized list of command options between the command
  126. name and the reference name (LIST selection options) and an optional
  127. Leiba & Melnikov Standards Track [Page 4]
  128. RFC 5258 IMAP4 LIST Command Extensions June 2008
  129. list of options at the end that control what kind of information
  130. should be returned (LIST return options). See the formal syntax in
  131. Section 6 for specific details.
  132. A LIST selection option tells the server which mailbox names should
  133. be selected by the LIST operation. The server should return
  134. information about all mailbox names that match any of the "canonical
  135. LIST pattern" (as described above) and satisfy additional selection
  136. criteria (if any) specified by the LIST selection options. Let's
  137. call any such mailbox name a "matched mailbox name". When multiple
  138. selection options are specified, the server MUST return information
  139. about mailbox names that satisfy every selection option, unless a
  140. description of a particular specified option prescribes special
  141. rules. An example of an option prescribing special rules is the
  142. RECURSIVEMATCH selection option described later in this section. We
  143. will use the term "selection criteria" when referring collectively to
  144. all selection options specified in a LIST command.
  145. A LIST return option controls which information is returned for each
  146. matched mailbox name. Note that return options MUST NOT cause the
  147. server to report information about additional mailbox names. If the
  148. client has not specified any return option, only information about
  149. attributes should be returned by the server. (Of course, the server
  150. is allowed to include any other information at will.)
  151. Both selection and return command options will be defined in this
  152. document and in approved extension documents; each option will be
  153. enabled by a capability string (one capability may enable multiple
  154. options), and a client MUST NOT send an option for which the server
  155. has not advertised support. A server MUST respond to options it does
  156. not recognize with a BAD response. The client SHOULD NOT specify any
  157. option more than once; however, if the client does this, the server
  158. MUST act as if it received the option only once. The order in which
  159. options are specified by the client is not significant.
  160. In general, each selection option except RECURSIVEMATCH will have a
  161. corresponding return option. The REMOTE selection option is an
  162. anomaly in this regard, and does not have a corresponding return
  163. option. That is because it expands, rather than restricts, the set
  164. of mailboxes that are returned. Future extensions to this
  165. specification should keep parallelism in mind and define a pair of
  166. corresponding options.
  167. This extension is identified by the capability string
  168. "LIST-EXTENDED", and support for it is a prerequisite for any future
  169. extensions that require specialized forms of the LIST command. Such
  170. extensions MUST refer to this document and MUST add their function
  171. through command options as described herein. Note that extensions
  172. Leiba & Melnikov Standards Track [Page 5]
  173. RFC 5258 IMAP4 LIST Command Extensions June 2008
  174. that don't require support for an extended LIST command, but use
  175. extended LIST responses (see below), don't need to advertise the
  176. "LIST-EXTENDED" capability string.
  177. This extension also defines extensions to the LIST response, allowing
  178. a series of extended fields at the end, a parenthesized list of
  179. tagged data (also referred to as "extended data item"). The first
  180. element of an extended field is a tag, which identifies the type of
  181. data. Tags MUST be registered with IANA, as described in Section 9.5
  182. of this document. An example of such an extended set might be
  183. tablecloth (("edge" "lacy") ("color" "red"))) (X-Sample "text"))
  184. or
  185. tablecloth ("edge" "lacy")) (X-Sample "text" "more text"))
  186. See the formal syntax, in Section 6, for the full syntactic details.
  187. The server MUST NOT return any extended data item unless the client
  188. has expressed its ability to support extended LIST responses, for
  189. example, by using an extended LIST command. The server MAY return
  190. data in the extended fields that was not directly solicited by the
  191. client in the corresponding LIST command. For example, the client
  192. can enable extra extended fields by using another IMAP extension that
  193. make use of the extended LIST responses. The client MUST ignore all
  194. extended fields it doesn't recognize.
  195. The LIST-EXTENDED capability also defines several new mailbox
  196. attributes.
  197. The "\NonExistent" attribute indicates that a mailbox name does not
  198. refer to an existing mailbox. Note that this attribute is not
  199. meaningful by itself, as mailbox names that match the canonical LIST
  200. pattern but don't exist must not be returned unless one of the two
  201. conditions listed below is also satisfied:
  202. a. The mailbox name also satisfies the selection criteria (for
  203. example, it is subscribed and the "SUBSCRIBED" selection option
  204. has been specified).
  205. b. "RECURSIVEMATCH" has been specified, and the mailbox name has at
  206. least one descendant mailbox name that does not match the LIST
  207. pattern and does match the selection criteria.
  208. In practice, this means that the "\NonExistent" attribute is usually
  209. returned with one or more of "\Subscribed", "\Remote",
  210. "\HasChildren", or the CHILDINFO extended data item (see their
  211. description below).
  212. Leiba & Melnikov Standards Track [Page 6]
  213. RFC 5258 IMAP4 LIST Command Extensions June 2008
  214. The "\NonExistent" attribute implies "\NoSelect". The "\NonExistent"
  215. attribute MUST be supported and MUST be accurately computed.
  216. 3.1. Initial List of Selection Options
  217. The selection options defined in this specification are as follows:
  218. SUBSCRIBED - causes the LIST command to list subscribed names,
  219. rather than the existing mailboxes. This will often be a subset
  220. of the actual mailboxes. It's also possible for this list to
  221. contain the names of mailboxes that don't exist. In any case, the
  222. list MUST include exactly those mailbox names that match the
  223. canonical list pattern and are subscribed to. This option is
  224. intended to supplement the LSUB command. Of particular note are
  225. the mailbox attributes as returned by this option, compared with
  226. what is returned by LSUB. With the latter, the attributes
  227. returned may not reflect the actual attribute status on the
  228. mailbox name, and the \NoSelect attribute has a second special
  229. meaning (it indicates that this mailbox is not, itself,
  230. subscribed, but that it has descendant mailboxes that are). With
  231. the SUBSCRIBED selection option described here, the attributes are
  232. accurate and complete, and have no special meanings. "LSUB" and
  233. "LIST (SUBSCRIBED)" are, thus, not the same thing, and some
  234. servers must do significant extra work to respond to "LIST
  235. (SUBSCRIBED)". Because of this, clients SHOULD continue to use
  236. "LSUB" unless they specifically want the additional information
  237. offered by "LIST (SUBSCRIBED)".
  238. This option defines a new mailbox attribute, "\Subscribed", that
  239. indicates that a mailbox name is subscribed to. The "\Subscribed"
  240. attribute MUST be supported and MUST be accurately computed when
  241. the SUBSCRIBED selection option is specified.
  242. Note that the SUBSCRIBED selection option implies the SUBSCRIBED
  243. return option (see below).
  244. REMOTE - causes the LIST command to show remote mailboxes as well as
  245. local ones, as described in [MBRef]. This option is intended to
  246. replace the RLIST command and, in conjunction with the SUBSCRIBED
  247. selection option, the RLSUB command.
  248. This option defines a new mailbox attribute, "\Remote", that
  249. indicates that a mailbox is a remote mailbox. The "\Remote"
  250. attribute MUST be accurately computed when the REMOTE option is
  251. specified.
  252. The REMOTE selection option has no interaction with other options.
  253. Its effect is to tell the server to apply the other options, if
  254. Leiba & Melnikov Standards Track [Page 7]
  255. RFC 5258 IMAP4 LIST Command Extensions June 2008
  256. any, to remote mailboxes, in addition to local ones. In
  257. particular, it has no interaction with RECURSIVEMATCH (see below).
  258. A request for (REMOTE RECURSIVEMATCH) is invalid, because a
  259. request for (RECURSIVEMATCH) is. A request for (REMOTE
  260. RECURSIVEMATCH SUBSCRIBED) is asking for all subscribed mailboxes,
  261. both local and remote.
  262. RECURSIVEMATCH - this option forces the server to return information
  263. about parent mailboxes that don't match other selection options,
  264. but have some submailboxes that do. Information about children is
  265. returned in the CHILDINFO extended data item, as described in
  266. Section 3.5.
  267. Note 1: In order for a parent mailbox to be returned, it still has
  268. to match the canonical LIST pattern.
  269. Note 2: When returning the CHILDINFO extended data item, it
  270. doesn't matter whether or not the submailbox matches the canonical
  271. LIST pattern. See also example 9 in Section 5.
  272. The RECURSIVEMATCH option MUST NOT occur as the only selection
  273. option (or only with REMOTE), as it only makes sense when other
  274. selection options are also used. The server MUST return BAD
  275. tagged response in such case.
  276. Note that even if the RECURSIVEMATCH option is specified, the
  277. client MUST still be able to handle a case when a CHILDINFO
  278. extended data item is returned and there are no submailboxes that
  279. meet the selection criteria of the subsequent LIST command, as
  280. they can be deleted/renamed after the LIST response was sent, but
  281. before the client had a chance to access them.
  282. 3.2. Initial List of Return Options
  283. The return options defined in this specification are as follows:
  284. SUBSCRIBED - causes the LIST command to return subscription state
  285. for all matching mailbox names. The "\Subscribed" attribute MUST
  286. be supported and MUST be accurately computed when the SUBSCRIBED
  287. return option is specified. Further, all mailbox flags MUST be
  288. accurately computed (this differs from the behavior of the LSUB
  289. command).
  290. CHILDREN - requests mailbox child information as originally proposed
  291. in [CMbox]. See Section 4, below, for details. This option MUST
  292. be supported by all servers.
  293. Leiba & Melnikov Standards Track [Page 8]
  294. RFC 5258 IMAP4 LIST Command Extensions June 2008
  295. 3.3. General Principles for Returning LIST Responses
  296. This section outlines several principles that can be used by server
  297. implementations of this document to decide whether a LIST response
  298. should be returned, as well as how many responses and what kind of
  299. information they may contain.
  300. 1. At most one LIST response should be returned for each mailbox
  301. name that matches the canonical LIST pattern. Server
  302. implementors must not assume that clients will be able to
  303. assemble mailbox attributes and other information returned in
  304. multiple LIST responses.
  305. 2. There are only two reasons for including a matching mailbox name
  306. in the responses to the LIST command (note that the server is
  307. allowed to return unsolicited responses at any time, and such
  308. responses are not governed by this rule):
  309. A. The mailbox name also satisfies the selection criteria.
  310. B. The mailbox name doesn't satisfy the selection criteria, but
  311. it has at least one descendant mailbox name that satisfies
  312. the selection criteria and that doesn't match the canonical
  313. LIST pattern.
  314. For more information on this case, see the CHILDINFO extended
  315. data item described in Section 3.5. Note that the CHILDINFO
  316. extended data item can only be returned when the
  317. RECURSIVEMATCH selection option is specified.
  318. 3. Attributes returned in the same LIST response must be treated
  319. additively. For example, the following response
  320. S: * LIST (\Subscribed \NonExistent) "/" "Fruit/Peach"
  321. means that the "Fruit/Peach" mailbox doesn't exist, but it is
  322. subscribed.
  323. 3.4. Additional Requirements on LIST-EXTENDED Clients
  324. All clients that support this extension MUST treat an attribute with
  325. a stronger meaning as implying any attribute that can be inferred
  326. from it. For example, the client must treat the presence of the
  327. \NoInferiors attribute as if the \HasNoChildren attribute was also
  328. sent by the server.
  329. Leiba & Melnikov Standards Track [Page 9]
  330. RFC 5258 IMAP4 LIST Command Extensions June 2008
  331. The following table summarizes inference rules described in
  332. Section 3.
  333. +--------------------+-------------------+
  334. | returned attribute | implied attribute |
  335. +--------------------+-------------------+
  336. | \NoInferiors | \HasNoChildren |
  337. | \NonExistent | \NoSelect |
  338. +--------------------+-------------------+
  339. 3.5. CHILDINFO Extended Data Item
  340. The CHILDINFO extended data item MUST NOT be returned unless the
  341. client has specified the RECURSIVEMATCH selection option.
  342. The CHILDINFO extended data item in a LIST response describes the
  343. selection criteria that has caused it to be returned and indicates
  344. that the mailbox has at least one descendant mailbox that matches the
  345. selection criteria.
  346. The LSUB command indicates this condition by using the "\NoSelect"
  347. attribute, but the LIST (SUBSCRIBED) command MUST NOT do that, since
  348. "\NoSelect" retains its original meaning here. Further, the
  349. CHILDINFO extended data item is more general, in that it can be used
  350. with any extended set of selection criteria.
  351. Note: Some servers allow for mailboxes to exist without requiring
  352. their parent to exist. For example, a mailbox "Customers/ABC" can
  353. exist while the mailbox "Customers" does not. As CHILDINFO extended
  354. data item is not allowed if the RECURSIVEMATCH selection option is
  355. not specified, such servers SHOULD use the "\NonExistent
  356. \HasChildren" attribute pair to signal to the client that there is a
  357. descendant mailbox that matches the selection criteria. See example
  358. 11 in Section 5.
  359. The returned selection criteria allow the client to distinguish a
  360. solicited response from an unsolicited one, as well as to distinguish
  361. among solicited responses caused by multiple pipelined LIST commands
  362. that specify different criteria.
  363. Servers SHOULD ONLY return a non-matching mailbox name along with
  364. CHILDINFO if at least one matching child is not also being returned.
  365. That is, servers SHOULD suppress redundant CHILDINFO responses.
  366. Examples 8 and 10 in Section 5 demonstrate the difference between
  367. present CHILDINFO extended data item and the "\HasChildren"
  368. attribute.
  369. Leiba & Melnikov Standards Track [Page 10]
  370. RFC 5258 IMAP4 LIST Command Extensions June 2008
  371. The following table summarizes interaction between the "\NonExistent"
  372. attribute and CHILDINFO (the first column indicates whether the
  373. parent mailbox exists):
  374. +--------+--------------+--------------------+----------------------+
  375. | exists | meets the | has a child that | returned |
  376. | | selection | meets the | LIST-EXTENDED |
  377. | | criteria | selection criteria | attributes and |
  378. | | | | CHILDINFO |
  379. +--------+--------------+--------------------+----------------------+
  380. | no | no | no | no LIST response |
  381. | | | | returned |
  382. | yes | no | no | no LIST response |
  383. | | | | returned |
  384. | no | yes | no | (\NonExistent |
  385. | | | | <attr>) |
  386. | yes | yes | no | (<attr>) |
  387. | no | no | yes | (\NonExistent) + |
  388. | | | | CHILDINFO |
  389. | yes | no | yes | () + CHILDINFO |
  390. | no | yes | yes | (\NonExistent |
  391. | | | | <attr>) + CHILDINFO |
  392. | yes | yes | yes | (<attr>) + CHILDINFO |
  393. +--------+--------------+--------------------+----------------------+
  394. where <attr> is one or more attributes that correspond to the
  395. selection criteria; for example, for the SUBSCRIBED option the <attr>
  396. is \Subscribed.
  397. 4. The CHILDREN Return Option
  398. The CHILDREN return option implements the Child Mailbox Extension,
  399. originally proposed by Mike Gahrns and Raymond Cheng, of Microsoft
  400. Corporation. Most of the information in this section is taken
  401. directly from their original specification [CMbox]. The CHILDREN
  402. return option is simply an indication that the client wants this
  403. information; a server MAY provide it even if the option is not
  404. specified.
  405. Many IMAP4 [IMAP4] clients present to the user a hierarchical view of
  406. the mailboxes that a user has access to. Rather than initially
  407. presenting to the user the entire mailbox hierarchy, it is often
  408. preferable to show to the user a collapsed outline list of the
  409. mailbox hierarchy (particularly if there is a large number of
  410. mailboxes). The user can then expand the collapsed outline hierarchy
  411. as needed. It is common to include within the collapsed hierarchy a
  412. visual clue (such as a ''+'') to indicate that there are child
  413. mailboxes under a particular mailbox. When the visual clue is
  414. Leiba & Melnikov Standards Track [Page 11]
  415. RFC 5258 IMAP4 LIST Command Extensions June 2008
  416. clicked, the hierarchy list is expanded to show the child mailboxes.
  417. The CHILDREN return option provides a mechanism for a client to
  418. efficiently determine whether a particular mailbox has children,
  419. without issuing a LIST "" * or a LIST "" % for each mailbox name.
  420. The CHILDREN return option defines two new attributes that MUST be
  421. returned within a LIST response: \HasChildren and \HasNoChildren.
  422. Although these attributes MAY be returned in response to any LIST
  423. command, the CHILDREN return option is provided to indicate that the
  424. client particularly wants this information. If the CHILDREN return
  425. option is present, the server MUST return these attributes even if
  426. their computation is expensive.
  427. \HasChildren
  428. The presence of this attribute indicates that the mailbox has child
  429. mailboxes. A server SHOULD NOT set this attribute if there are
  430. child mailboxes and the user does not have permission to access
  431. any of them. In this case, \HasNoChildren SHOULD be used. In
  432. many cases, however, a server may not be able to efficiently
  433. compute whether a user has access to any child mailbox. Note
  434. that even though the \HasChildren attribute for a mailbox must
  435. be correct at the time of processing of the mailbox, a client
  436. must be prepared to deal with a situation when a mailbox is
  437. marked with the \HasChildren attribute, but no child mailbox
  438. appears in the response to the LIST command. This might happen,
  439. for example, due to children mailboxes being deleted or made
  440. inaccessible to the user (using access control) by another
  441. client before the server is able to list them.
  442. \HasNoChildren
  443. The presence of this attribute indicates that the mailbox has NO
  444. child mailboxes that are accessible to the currently
  445. authenticated user.
  446. It is an error for the server to return both a \HasChildren and a
  447. \HasNoChildren attribute in the same LIST response.
  448. Note: the \HasNoChildren attribute should not be confused with the
  449. IMAP4 [IMAP4] defined attribute \NoInferiors, which indicates that no
  450. child mailboxes exist now and none can be created in the future.
  451. Leiba & Melnikov Standards Track [Page 12]
  452. RFC 5258 IMAP4 LIST Command Extensions June 2008
  453. 5. Examples
  454. 1: The first example shows the complete local hierarchy that will
  455. be used for the other examples.
  456. C: A01 LIST "" "*"
  457. S: * LIST (\Marked \NoInferiors) "/" "inbox"
  458. S: * LIST () "/" "Fruit"
  459. S: * LIST () "/" "Fruit/Apple"
  460. S: * LIST () "/" "Fruit/Banana"
  461. S: * LIST () "/" "Tofu"
  462. S: * LIST () "/" "Vegetable"
  463. S: * LIST () "/" "Vegetable/Broccoli"
  464. S: * LIST () "/" "Vegetable/Corn"
  465. S: A01 OK done
  466. 2: In the next example, we will see the subscribed mailboxes. This
  467. is similar to, but not equivalent with, <LSUB "" "*">. Note
  468. that the mailbox called "Fruit/Peach" is subscribed to, but does
  469. not actually exist (perhaps it was deleted while still
  470. subscribed). The "Fruit" mailbox is not subscribed to, but it
  471. has two subscribed children. The "Vegetable" mailbox is
  472. subscribed and has two children; one of them is subscribed as
  473. well.
  474. C: A02 LIST (SUBSCRIBED) "" "*"
  475. S: * LIST (\Marked \NoInferiors \Subscribed) "/" "inbox"
  476. S: * LIST (\Subscribed) "/" "Fruit/Banana"
  477. S: * LIST (\Subscribed \NonExistent) "/" "Fruit/Peach"
  478. S: * LIST (\Subscribed) "/" "Vegetable"
  479. S: * LIST (\Subscribed) "/" "Vegetable/Broccoli"
  480. S: A02 OK done
  481. 3: The next example shows the use of the CHILDREN option. The
  482. client, without having to list the second level of hierarchy,
  483. now knows which of the top-level mailboxes have submailboxes
  484. (children) and which do not. Note that it's not necessary for
  485. the server to return the \HasNoChildren attribute for the inbox,
  486. because the \NoInferiors attribute already implies that, and has
  487. a stronger meaning.
  488. C: A03 LIST () "" "%" RETURN (CHILDREN)
  489. S: * LIST (\Marked \NoInferiors) "/" "inbox"
  490. S: * LIST (\HasChildren) "/" "Fruit"
  491. S: * LIST (\HasNoChildren) "/" "Tofu"
  492. S: * LIST (\HasChildren) "/" "Vegetable"
  493. S: A03 OK done
  494. Leiba & Melnikov Standards Track [Page 13]
  495. RFC 5258 IMAP4 LIST Command Extensions June 2008
  496. 4: In this example, we see more mailboxes that reside on another
  497. server. This is similar to the command <RLIST "" "%">.
  498. C: A04 LIST (REMOTE) "" "%" RETURN (CHILDREN)
  499. S: * LIST (\Marked \NoInferiors) "/" "inbox"
  500. S: * LIST (\HasChildren) "/" "Fruit"
  501. S: * LIST (\HasNoChildren) "/" "Tofu"
  502. S: * LIST (\HasChildren) "/" "Vegetable"
  503. S: * LIST (\Remote) "/" "Bread"
  504. S: * LIST (\HasChildren \Remote) "/" "Meat"
  505. S: A04 OK done
  506. 5: The following example also requests the server to include
  507. mailboxes that reside on another server. The server returns
  508. information about all mailboxes that are subscribed. This is
  509. similar to the command <RLSUB "" "*">. We also see the use of
  510. two selection options.
  511. C: A05 LIST (REMOTE SUBSCRIBED) "" "*"
  512. S: * LIST (\Marked \NoInferiors \Subscribed) "/" "inbox"
  513. S: * LIST (\Subscribed) "/" "Fruit/Banana"
  514. S: * LIST (\Subscribed \NonExistent) "/" "Fruit/Peach"
  515. S: * LIST (\Subscribed) "/" "Vegetable"
  516. S: * LIST (\Subscribed) "/" "Vegetable/Broccoli"
  517. S: * LIST (\Remote \Subscribed) "/" "Bread"
  518. S: A05 OK done
  519. 6: The following example requests the server to include mailboxes
  520. that reside on another server. The server is asked to return
  521. subscription information for all returned mailboxes. This is
  522. different from the example above.
  523. Note that the output of this command is not a superset of the
  524. output in the previous example, as it doesn't include LIST
  525. response for the non-existent "Fruit/Peach".
  526. C: A06 LIST (REMOTE) "" "*" RETURN (SUBSCRIBED)
  527. S: * LIST (\Marked \NoInferiors \Subscribed) "/" "inbox"
  528. S: * LIST () "/" "Fruit"
  529. S: * LIST () "/" "Fruit/Apple"
  530. S: * LIST (\Subscribed) "/" "Fruit/Banana"
  531. S: * LIST () "/" "Tofu"
  532. S: * LIST (\Subscribed) "/" "Vegetable"
  533. S: * LIST (\Subscribed) "/" "Vegetable/Broccoli"
  534. S: * LIST () "/" "Vegetable/Corn"
  535. S: * LIST (\Remote \Subscribed) "/" "Bread"
  536. S: * LIST (\Remote) "/" "Meat"
  537. S: A06 OK done
  538. Leiba & Melnikov Standards Track [Page 14]
  539. RFC 5258 IMAP4 LIST Command Extensions June 2008
  540. 7: In the following example, the client has specified multiple
  541. mailbox patterns. Note that this example does not use the
  542. mailbox hierarchy used in the previous examples.
  543. C: BBB LIST "" ("INBOX" "Drafts" "Sent/%")
  544. S: * LIST () "/" "INBOX"
  545. S: * LIST (\NoInferiors) "/" "Drafts"
  546. S: * LIST () "/" "Sent/March2004"
  547. S: * LIST (\Marked) "/" "Sent/December2003"
  548. S: * LIST () "/" "Sent/August2004"
  549. S: BBB OK done
  550. 8: The following example demonstrates the difference between the
  551. \HasChildren attribute and the CHILDINFO extended data item.
  552. Let's assume there is the following hierarchy:
  553. C: C01 LIST "" "*"
  554. S: * LIST (\Marked \NoInferiors) "/" "inbox"
  555. S: * LIST () "/" "Foo"
  556. S: * LIST () "/" "Foo/Bar"
  557. S: * LIST () "/" "Foo/Baz"
  558. S: * LIST () "/" "Moo"
  559. S: C01 OK done
  560. If the client asks RETURN (CHILDREN), it will get this:
  561. C: CA3 LIST "" "%" RETURN (CHILDREN)
  562. S: * LIST (\Marked \NoInferiors) "/" "inbox"
  563. S: * LIST (\HasChildren) "/" "Foo"
  564. S: * LIST (\HasNoChildren) "/" "Moo"
  565. S: CA3 OK done
  566. A) Let's also assume that the mailbox "Foo/Baz" is the only
  567. subscribed mailbox. Then we get this result:
  568. C: C02 LIST (SUBSCRIBED) "" "*"
  569. S: * LIST (\Subscribed) "/" "Foo/Baz"
  570. S: C02 OK done
  571. Now, if the client issues <LIST (SUBSCRIBED) "" "%">, the server will
  572. return no mailboxes (as the mailboxes "Moo", "Foo", and "Inbox" are
  573. NOT subscribed). However, if the client issues this:
  574. C: C04 LIST (SUBSCRIBED RECURSIVEMATCH) "" "%"
  575. S: * LIST () "/" "Foo" ("CHILDINFO" ("SUBSCRIBED"))
  576. S: C04 OK done
  577. Leiba & Melnikov Standards Track [Page 15]
  578. RFC 5258 IMAP4 LIST Command Extensions June 2008
  579. (i.e., the mailbox "Foo" is not subscribed, but it has a child that
  580. is.)
  581. A1) If the mailbox "Foo" had also been subscribed, the last command
  582. would return this:
  583. C: C04 LIST (SUBSCRIBED RECURSIVEMATCH) "" "%"
  584. S: * LIST (\Subscribed) "/" "Foo" ("CHILDINFO" ("SUBSCRIBED"))
  585. S: C04 OK done
  586. or even this:
  587. C: C04 LIST (SUBSCRIBED RECURSIVEMATCH) "" "%"
  588. S: * LIST (\Subscribed \HasChildren) "/" "Foo" ("CHILDINFO"
  589. ("SUBSCRIBED"))
  590. S: C04 OK done
  591. A2) If we assume instead that the mailbox "Foo" is not part of the
  592. original hierarchy and is not subscribed, the last command will give
  593. this result:
  594. C: C04 LIST (SUBSCRIBED RECURSIVEMATCH) "" "%"
  595. S: * LIST (\NonExistent) "/" "Foo" ("CHILDINFO" ("SUBSCRIBED"))
  596. S: C04 OK done
  597. B) Now, let's assume that no mailbox is subscribed. In this case,
  598. the command <LIST (SUBSCRIBED RECURSIVEMATCH) "" "%"> will return no
  599. responses, as there are no subscribed children (even though "Foo" has
  600. children).
  601. C) And finally, suppose that only the mailboxes "Foo" and "Moo" are
  602. subscribed. In that case, we see this result:
  603. C: C04 LIST (SUBSCRIBED RECURSIVEMATCH) "" "%" RETURN (CHILDREN)
  604. S: * LIST (\HasChildren \Subscribed) "/" "Foo"
  605. S: * LIST (\HasNoChildren \Subscribed) "/" "Moo"
  606. S: C04 OK done
  607. (which means that the mailbox "Foo" has children, but none of them is
  608. subscribed).
  609. 9: The following example demonstrates that the CHILDINFO extended
  610. data item is returned whether or not children mailboxes match
  611. the canonical LIST pattern.
  612. Leiba & Melnikov Standards Track [Page 16]
  613. RFC 5258 IMAP4 LIST Command Extensions June 2008
  614. Let's assume there is the following hierarchy:
  615. C: D01 LIST "" "*"
  616. S: * LIST (\Marked \NoInferiors) "/" "inbox"
  617. S: * LIST () "/" "foo2"
  618. S: * LIST () "/" "foo2/bar1"
  619. S: * LIST () "/" "foo2/bar2"
  620. S: * LIST () "/" "baz2"
  621. S: * LIST () "/" "baz2/bar2"
  622. S: * LIST () "/" "baz2/bar22"
  623. S: * LIST () "/" "baz2/bar222"
  624. S: * LIST () "/" "eps2"
  625. S: * LIST () "/" "eps2/mamba"
  626. S: * LIST () "/" "qux2/bar2"
  627. S: D01 OK done
  628. And that the following mailboxes are subscribed:
  629. C: D02 LIST (SUBSCRIBED) "" "*"
  630. S: * LIST (\Subscribed) "/" "foo2/bar1"
  631. S: * LIST (\Subscribed) "/" "foo2/bar2"
  632. S: * LIST (\Subscribed) "/" "baz2/bar2"
  633. S: * LIST (\Subscribed) "/" "baz2/bar22"
  634. S: * LIST (\Subscribed) "/" "baz2/bar222"
  635. S: * LIST (\Subscribed) "/" "eps2"
  636. S: * LIST (\Subscribed) "/" "eps2/mamba"
  637. S: * LIST (\Subscribed) "/" "qux2/bar2"
  638. S: D02 OK done
  639. The client issues the following command first:
  640. C: D03 LIST (RECURSIVEMATCH SUBSCRIBED) "" "*2"
  641. S: * LIST () "/" "foo2" ("CHILDINFO" ("SUBSCRIBED"))
  642. S: * LIST (\Subscribed) "/" "foo2/bar2"
  643. S: * LIST (\Subscribed) "/" "baz2/bar2"
  644. S: * LIST (\Subscribed) "/" "baz2/bar22"
  645. S: * LIST (\Subscribed) "/" "baz2/bar222"
  646. S: * LIST (\Subscribed) "/" "eps2" ("CHILDINFO" ("SUBSCRIBED"))
  647. S: * LIST (\Subscribed) "/" "qux2/bar2"
  648. S: D03 OK done
  649. and the server may also include (but this would violate a SHOULD NOT
  650. in Section 3.5, because CHILDINFO is redundant)
  651. S: * LIST () "/" "baz2" ("CHILDINFO" ("SUBSCRIBED"))
  652. S: * LIST (\NonExistent) "/" "qux2" ("CHILDINFO" ("SUBSCRIBED"))
  653. Leiba & Melnikov Standards Track [Page 17]
  654. RFC 5258 IMAP4 LIST Command Extensions June 2008
  655. The CHILDINFO extended data item is returned for mailboxes "foo2",
  656. "baz2", and "eps2", because all of them have subscribed children,
  657. even though for the mailbox "foo2" only one of the two subscribed
  658. children matches the pattern, for the mailbox "baz2" all the
  659. subscribed children match the pattern, and for the mailbox "eps2"
  660. none of the subscribed children matches the pattern.
  661. Note that if the client issues
  662. C: D03 LIST (RECURSIVEMATCH SUBSCRIBED) "" "*"
  663. S: * LIST () "/" "foo2" ("CHILDINFO" ("SUBSCRIBED"))
  664. S: * LIST (\Subscribed) "/" "foo2/bar1"
  665. S: * LIST (\Subscribed) "/" "foo2/bar2"
  666. S: * LIST () "/" "baz2" ("CHILDINFO" ("SUBSCRIBED"))
  667. S: * LIST (\Subscribed) "/" "baz2/bar2"
  668. S: * LIST (\Subscribed) "/" "baz2/bar22"
  669. S: * LIST (\Subscribed) "/" "baz2/bar222"
  670. S: * LIST (\Subscribed) "/" "eps2" ("CHILDINFO" ("SUBSCRIBED"))
  671. S: * LIST (\Subscribed) "/" "eps2/mamba"
  672. S: * LIST (\Subscribed) "/" "qux2/bar2"
  673. S: D03 OK done
  674. The LIST responses for mailboxes "foo2", "baz2", and "eps2" still
  675. have the CHILDINFO extended data item, even though this information
  676. is redundant and the client can determine it by itself.
  677. 10: The following example shows usage of multiple mailbox patterns.
  678. It also demonstrates that the presence of the CHILDINFO extended
  679. data item doesn't necessarily imply \HasChildren.
  680. C: a1 LIST "" ("foo" "foo/*")
  681. S: * LIST () "/" foo
  682. S: a1 OK done
  683. C: a2 LIST (SUBSCRIBED) "" "foo/*"
  684. S: * LIST (\Subscribed \NonExistent) "/" foo/bar
  685. S: a2 OK done
  686. C: a3 LIST (SUBSCRIBED RECURSIVEMATCH) "" foo RETURN (CHILDREN)
  687. S: * LIST (\HasNoChildren) "/" foo ("CHILDINFO" ("SUBSCRIBED"))
  688. S: a3 OK done
  689. 11: The following example shows how a server that supports missing
  690. mailbox hierarchy elements can signal to a client that didn't
  691. specify the RECURSIVEMATCH selection option that there is a
  692. child mailbox that matches the selection criteria.
  693. Leiba & Melnikov Standards Track [Page 18]
  694. RFC 5258 IMAP4 LIST Command Extensions June 2008
  695. C: a1 LIST (REMOTE) "" *
  696. S: * LIST () "/" music/rock
  697. S: * LIST (\Remote) "/" also/jazz
  698. S: a1 OK done
  699. C: a2 LIST () "" %
  700. S: * LIST (\NonExistent \HasChildren) "/" music
  701. S: a2 OK done
  702. C: a3 LIST (REMOTE) "" %
  703. S: * LIST (\NonExistent \HasChildren) "/" music
  704. S: * LIST (\NonExistent \HasChildren) "/" also
  705. S: a3 OK done
  706. C: a3.1 LIST "" (% music/rock)
  707. S: * LIST () "/" music/rock
  708. S: a3.1 OK done
  709. Because "music/rock" is the only mailbox under "music", there's no
  710. need for the server to also return "music". However clients must
  711. handle both cases.
  712. 6. Formal Syntax
  713. The following syntax specification uses the Augmented Backus-Naur
  714. Form (ABNF) as described in [ABNF]. Terms not defined here are taken
  715. from [IMAP4]. In particular, note that the version of "mailbox-list"
  716. below, which defines the payload of the LIST response, updates the
  717. version defined in the IMAP specification. It is pointed to by
  718. "mailbox-data", which is defined in [IMAP4].
  719. "vendor-token" is defined in [ACAP]. Note that this normative
  720. reference to ACAP will be an issue in moving this spec forward, since
  721. it introduces a dependency on ACAP. The definitions of
  722. "vendor-token" and of the IANA registry must eventually go somewhere
  723. else, in a document that can be moved forward on the standards track
  724. independently of ACAP.
  725. Leiba & Melnikov Standards Track [Page 19]
  726. RFC 5258 IMAP4 LIST Command Extensions June 2008
  727. childinfo-extended-item = "CHILDINFO" SP "("
  728. list-select-base-opt-quoted
  729. *(SP list-select-base-opt-quoted) ")"
  730. ; Extended data item (mbox-list-extended-item)
  731. ; returned when the RECURSIVEMATCH
  732. ; selection option is specified.
  733. ; Note 1: the CHILDINFO tag can be returned
  734. ; with and without surrounding quotes, as per
  735. ; mbox-list-extended-item-tag production.
  736. ; Note 2: The selection options are always returned
  737. ; quoted, unlike their specification in
  738. ; the extended LIST command.
  739. child-mbox-flag = "\HasChildren" / "\HasNoChildren"
  740. ; attributes for CHILDREN return option, at most one
  741. ; possible per LIST response
  742. eitem-standard-tag = atom
  743. ; a tag for extended list data defined in a Standard
  744. ; Track or Experimental RFC.
  745. eitem-vendor-tag = vendor-token "-" atom
  746. ; a vendor-specific tag for extended list data
  747. list = "LIST" [SP list-select-opts] SP mailbox SP mbox-or-pat
  748. [SP list-return-opts]
  749. list-return-opts = "RETURN" SP
  750. "(" [return-option *(SP return-option)] ")"
  751. ; list return options, e.g., CHILDREN
  752. list-select-base-opt = "SUBSCRIBED" / option-extension
  753. ; options that can be used by themselves
  754. list-select-base-opt-quoted = DQUOTE list-select-base-opt DQUOTE
  755. list-select-independent-opt = "REMOTE" / option-extension
  756. ; options that do not syntactically interact with
  757. ; other options
  758. list-select-mod-opt = "RECURSIVEMATCH" / option-extension
  759. ; options that require a list-select-base-opt
  760. ; to also be present
  761. list-select-opt = list-select-base-opt / list-select-independent-opt
  762. / list-select-mod-opt
  763. ; An option registration template is described in
  764. ; Section 9.3 of this document.
  765. Leiba & Melnikov Standards Track [Page 20]
  766. RFC 5258 IMAP4 LIST Command Extensions June 2008
  767. list-select-opts = "(" [
  768. (*(list-select-opt SP) list-select-base-opt
  769. *(SP list-select-opt))
  770. / (list-select-independent-opt
  771. *(SP list-select-independent-opt))
  772. ] ")"
  773. ; Any number of options may be in any order.
  774. ; If a list-select-mod-opt appears, then a
  775. ; list-select-base-opt must also appear.
  776. ; This allows these:
  777. ; ()
  778. ; (REMOTE)
  779. ; (SUBSCRIBED)
  780. ; (SUBSCRIBED REMOTE)
  781. ; (SUBSCRIBED RECURSIVEMATCH)
  782. ; (SUBSCRIBED REMOTE RECURSIVEMATCH)
  783. ; But does NOT allow these:
  784. ; (RECURSIVEMATCH)
  785. ; (REMOTE RECURSIVEMATCH)
  786. mailbox-list = "(" [mbx-list-flags] ")" SP
  787. (DQUOTE QUOTED-CHAR DQUOTE / nil) SP mailbox
  788. [SP mbox-list-extended]
  789. ; This is the list information pointed to by the ABNF
  790. ; item "mailbox-data", which is defined in [IMAP4]
  791. mbox-list-extended = "(" [mbox-list-extended-item
  792. *(SP mbox-list-extended-item)] ")"
  793. mbox-list-extended-item = mbox-list-extended-item-tag SP
  794. tagged-ext-val
  795. mbox-list-extended-item-tag = astring
  796. ; The content MUST conform to either "eitem-vendor-tag"
  797. ; or "eitem-standard-tag" ABNF productions.
  798. ; A tag registration template is described in this
  799. ; document in Section 9.5.
  800. mbx-list-oflag =/ child-mbox-flag / "\Subscribed" / "\Remote"
  801. mbx-list-sflag =/ "\NonExistent"
  802. mbox-or-pat = list-mailbox / patterns
  803. option-extension = (option-standard-tag / option-vendor-tag)
  804. [SP option-value]
  805. Leiba & Melnikov Standards Track [Page 21]
  806. RFC 5258 IMAP4 LIST Command Extensions June 2008
  807. option-standard-tag = atom
  808. ; an option defined in a Standards Track or
  809. ; Experimental RFC
  810. option-val-comp = astring /
  811. option-val-comp *(SP option-val-comp) /
  812. "(" option-val-comp ")"
  813. option-value = "(" option-val-comp ")"
  814. option-vendor-tag = vendor-token "-" atom
  815. ; a vendor-specific option, non-standard
  816. patterns = "(" list-mailbox *(SP list-mailbox) ")"
  817. return-option = "SUBSCRIBED" / "CHILDREN" / option-extension
  818. tagged-ext-comp = astring /
  819. tagged-ext-comp *(SP tagged-ext-comp) /
  820. "(" tagged-ext-comp ")"
  821. ; Extensions that follow this general
  822. ; syntax should use nstring instead of
  823. ; astring when appropriate in the context
  824. ; of the extension.
  825. ; Note that a message set or a "number"
  826. ; can always be represented as an "atom".
  827. ; A URL should be represented as
  828. ; a "quoted" string.
  829. tagged-ext-simple = sequence-set / number
  830. tagged-ext-val = tagged-ext-simple /
  831. "(" [tagged-ext-comp] ")"
  832. 7. Internationalization Considerations
  833. The LIST command selection option types defined in this specification
  834. involve simple tests of mailbox properties. However, future
  835. extensions to LIST-EXTENDED may define selection options that do more
  836. sophisticated tests. In the case of a test that requires matching
  837. text, in the presence of the COMPARATOR [I18N] extension, the active
  838. comparator must be used to do comparisons. Such LIST-EXTENDED
  839. extensions MUST indicate in their specification the interaction with
  840. the COMPARATOR [I18N] extension.
  841. Leiba & Melnikov Standards Track [Page 22]
  842. RFC 5258 IMAP4 LIST Command Extensions June 2008
  843. 8. Security Considerations
  844. This document describes syntactic changes to the specification of the
  845. IMAP4 commands LIST, LSUB, RLIST, and RLSUB, and the modified LIST
  846. command has the same security considerations as those commands. They
  847. are described in [IMAP4] and [MBRef].
  848. The Child Mailbox Extension provides a client a more efficient means
  849. of determining whether a particular mailbox has children. If a
  850. mailbox has children, but the currently authenticated user does not
  851. have access to any of them, the server SHOULD respond with a
  852. \HasNoChildren attribute. In many cases, however, a server may not
  853. be able to efficiently compute whether a user has access to any child
  854. mailbox. If such a server responds with a \HasChildren attribute,
  855. when in fact the currently authenticated user does not have access to
  856. any child mailboxes, potentially more information is conveyed about
  857. the mailbox than intended. In most situations, this will not be a
  858. security concern, because if information regarding whether a mailbox
  859. has children is considered sensitive, a user would not be granted
  860. access to that mailbox in the first place.
  861. The CHILDINFO extended data item has the same security considerations
  862. as the \HasChildren attribute described above.
  863. 9. IANA Considerations
  864. 9.1. Guidelines for IANA
  865. IANA has created two new registries for LIST-EXTENDED options and
  866. LIST-EXTENDED response data. The templates and the initial
  867. registrations are detailed below.
  868. 9.2. Registration Procedure and Change Control
  869. Registration of a LIST-EXTENDED option is done by filling in the
  870. template in Section 9.3 and sending it via electronic mail to
  871. iana@iana.org. Registration of a LIST-EXTENDED extended data item is
  872. done by filling in the template in Section 9.5 and sending it via
  873. electronic mail to iana@iana.org. IANA has the right to reject
  874. obviously bogus registrations, but will perform no review of claims
  875. made in the registration form.
  876. A LIST-EXTENDED option/extended data item name that starts with "V-"
  877. is reserved for vendor-specific options/extended data items. All
  878. options, whether they are vendor specific or global, should be
  879. registered with IANA. If a LIST-EXTENDED extended data item is
  880. returned as a result of requesting a particular LIST-EXTENDED option,
  881. Leiba & Melnikov Standards Track [Page 23]
  882. RFC 5258 IMAP4 LIST Command Extensions June 2008
  883. the name of the option SHOULD be used as the name of the
  884. LIST-EXTENDED extended data item.
  885. Each vendor-specific option/extended data item MUST start with its
  886. vendor-token ("vendor prefix"). The vendor-token MUST be registered
  887. with IANA, using the [ACAP] vendor subtree registry.
  888. Standard LIST-EXTENDED option/extended data item names are case
  889. insensitive. If the vendor prefix is omitted from a vendor-specific
  890. LIST-EXTENDED option/extended data item name, the rest is case
  891. insensitive. The vendor prefix itself is not case sensitive, as it
  892. might contain non-ASCII characters. While the registration
  893. procedures do not require it, authors of
  894. LIST-EXTENDED options/extended data items are encouraged to seek
  895. community review and comment whenever that is feasible. Authors may
  896. seek community review by posting a specification of their proposed
  897. mechanism as an
  898. Internet-Draft. LIST-EXTENDED option/extended data items intended
  899. for widespread use should be standardized through the normal IETF
  900. process, when appropriate.
  901. Comments on registered LIST-EXTENDED options/extended response data
  902. should first be sent to the "owner" of the mechanism and/or to the
  903. IMAPEXT WG mailing list. Submitters of comments may, after a
  904. reasonable attempt to contact the owner, request IANA to attach their
  905. comment to the registration itself. If IANA approves of this, the
  906. comment will be made accessible in conjunction with the registration
  907. LIST-EXTENDED options/extended response data itself.
  908. Once a LIST-EXTENDED registration has been published by IANA, the
  909. author may request a change to its definition. The change request
  910. follows the same procedure as the registration request.
  911. The owner of a LIST-EXTENDED registration may pass responsibility for
  912. the registered option/extended data item to another person or agency
  913. by informing IANA; this can be done without discussion or review.
  914. The IESG may reassign responsibility for a LIST-EXTENDED
  915. option/extended data item. The most common case of this will be to
  916. enable changes to be made to mechanisms where the author of the
  917. registration has died, has moved out of contact, or is otherwise
  918. unable to make changes that are important to the community.
  919. LIST-EXTENDED registrations may not be deleted; mechanisms that are
  920. no longer believed appropriate for use can be declared OBSOLETE by a
  921. change to their "intended use" field. Such LIST-EXTENDED
  922. options/extended data items will be clearly marked in the lists
  923. published by IANA.
  924. Leiba & Melnikov Standards Track [Page 24]
  925. RFC 5258 IMAP4 LIST Command Extensions June 2008
  926. The IESG is considered to be the owner of all LIST-EXTENDED
  927. options/extended data items that are on the IETF standards track.
  928. 9.3. Registration Template for LIST-EXTENDED Options
  929. To: iana@iana.org
  930. Subject: Registration of LIST-EXTENDED option X
  931. LIST-EXTENDED option name:
  932. LIST-EXTENDED option type: (One of SELECTION or RETURN)
  933. Implied return options(s), if the option type is SELECTION: (zero or
  934. more)
  935. LIST-EXTENDED option description:
  936. Published specification (optional, recommended):
  937. Security considerations:
  938. Intended usage:
  939. (One of COMMON, LIMITED USE, or OBSOLETE)
  940. Person and email address to contact for further information:
  941. Owner/Change controller:
  942. (Any other information that the author deems interesting may be added
  943. below this line.)
  944. 9.4. Initial LIST-EXTENDED Option Registrations
  945. The LIST-EXTENDED option registry has been populated with the
  946. following entries:
  947. 1. To: iana@iana.org
  948. Subject: Registration of LIST-EXTENDED option SUBSCRIBED
  949. LIST-EXTENDED option name: SUBSCRIBED
  950. LIST-EXTENDED option type: SELECTION
  951. Implied return options(s): SUBSCRIBED
  952. LIST-EXTENDED option description: Causes the LIST command to list
  953. subscribed mailboxes, rather than the actual mailboxes.
  954. Leiba & Melnikov Standards Track [Page 25]
  955. RFC 5258 IMAP4 LIST Command Extensions June 2008
  956. Published specification: RFC 5258, Section 3.
  957. Security considerations: RFC 5258, Section 8.
  958. Intended usage: COMMON
  959. Person and email address to contact for further information:
  960. Alexey Melnikov <Alexey.Melnikov@isode.com>
  961. Owner/Change controller: iesg@ietf.org
  962. 2. To: iana@iana.org
  963. Subject: Registration of LIST-EXTENDED option REMOTE
  964. LIST-EXTENDED option name: REMOTE
  965. LIST-EXTENDED option type: SELECTION
  966. Implied return options(s): (none)
  967. LIST-EXTENDED option description: Causes the LIST command to
  968. return remote mailboxes as well as local ones, as described in
  969. RFC 2193.
  970. Published specification: RFC 5258, Section 3.
  971. Security considerations: RFC 5258, Section 8.
  972. Intended usage: COMMON
  973. Person and email address to contact for further information:
  974. Alexey Melnikov <Alexey.Melnikov@isode.com>
  975. Owner/Change controller: iesg@ietf.org
  976. 3. To: iana@iana.org
  977. Subject: Registration of LIST-EXTENDED option SUBSCRIBED
  978. LIST-EXTENDED option name: SUBSCRIBED
  979. LIST-EXTENDED option type: RETURN
  980. LIST-EXTENDED option description: Causes the LIST command to
  981. return subscription state.
  982. Published specification: RFC 5258, Section 3.
  983. Security considerations: RFC 5258, Section 8.
  984. Leiba & Melnikov Standards Track [Page 26]
  985. RFC 5258 IMAP4 LIST Command Extensions June 2008
  986. Intended usage: COMMON
  987. Person and email address to contact for further information:
  988. Alexey Melnikov <Alexey.Melnikov@isode.com>
  989. Owner/Change controller: iesg@ietf.org
  990. 4. To: iana@iana.org
  991. Subject: Registration of LIST-EXTENDED option RECURSIVEMATCH
  992. LIST-EXTENDED option name: RECURSIVEMATCH
  993. LIST-EXTENDED option type: SELECTION
  994. Implied return options(s): (none)
  995. LIST-EXTENDED option description: Requests that CHILDINFO
  996. extended data item (childinfo-extended-item) is to be returned.
  997. Published specification: RFC 5258, Section 3.
  998. Security considerations: RFC 5258, Section 8.
  999. Intended usage: COMMON
  1000. Person and email address to contact for further information:
  1001. Alexey Melnikov <Alexey.Melnikov@isode.com>
  1002. Owner/Change controller: iesg@ietf.org
  1003. 5. To: iana@iana.org
  1004. Subject: Registration of LIST-EXTENDED option CHILDREN
  1005. LIST-EXTENDED option name: CHILDREN
  1006. LIST-EXTENDED option type: RETURN
  1007. LIST-EXTENDED option description: Requests mailbox child
  1008. information.
  1009. Published specification: RFC 5258, Section 3 and Section 4.
  1010. Security considerations: RFC 5258, Section 8.
  1011. Intended usage: COMMON
  1012. Person and email address to contact for further information:
  1013. Alexey Melnikov <Alexey.Melnikov@isode.com>
  1014. Leiba & Melnikov Standards Track [Page 27]
  1015. RFC 5258 IMAP4 LIST Command Extensions June 2008
  1016. Owner/Change controller: iesg@ietf.org
  1017. 9.5. Registration Template for LIST-EXTENDED Extended Data Item
  1018. To: iana@iana.org
  1019. Subject: Registration of X LIST-EXTENDED extended data item
  1020. LIST-EXTENDED extended data item tag:
  1021. LIST-EXTENDED extended data item description:
  1022. Which LIST-EXTENDED option(s) (and their types) causes this extended
  1023. data item to be returned (if any):
  1024. Published specification (optional, recommended):
  1025. Security considerations:
  1026. Intended usage:
  1027. (One of COMMON, LIMITED USE, or OBSOLETE)
  1028. Person and email address to contact for further information:
  1029. Owner/Change controller:
  1030. (Any other information that the author deems interesting may be added
  1031. below this line.)
  1032. 9.6. Initial LIST-EXTENDED Extended Data Item Registrations
  1033. The LIST-EXTENDED extended data item registry has been populated with
  1034. the following entries:
  1035. 1. To: iana@iana.org
  1036. Subject: Registration of CHILDINFO LIST-EXTENDED extended data
  1037. item
  1038. LIST-EXTENDED extended data item tag: CHILDINFO
  1039. LIST-EXTENDED extended data item description: The CHILDINFO
  1040. extended data item describes the selection criteria that has
  1041. caused it to be returned and indicates that the mailbox has one
  1042. or more child mailboxes that match the selection criteria.
  1043. Which LIST-EXTENDED option(s) (and their types) causes this
  1044. extended data item to be returned (if any): RECURSIVEMATCH
  1045. selection option
  1046. Leiba & Melnikov Standards Track [Page 28]
  1047. RFC 5258 IMAP4 LIST Command Extensions June 2008
  1048. Published specification: RFC 5258, Section 3.5.
  1049. Security considerations: RFC 5258, Section 8.
  1050. Intended usage: COMMON
  1051. Person and email address to contact for further information:
  1052. Alexey Melnikov <Alexey.Melnikov@isode.com>
  1053. Owner/Change controller: iesg@ietf.org
  1054. 10. Acknowledgements
  1055. Mike Gahrns and Raymond Cheng of Microsoft Corporation originally
  1056. devised the Child Mailbox Extension and proposed it in 1997; the
  1057. idea, as well as most of the text in Section 4, is theirs.
  1058. This document is the result of discussions on the IMAP4 and IMAPEXT
  1059. mailing lists and is meant to reflect consensus of those groups. In
  1060. particular, Mark Crispin, Philip Guenther, Cyrus Daboo, Timo
  1061. Sirainen, Ken Murchison, Rob Siemborski, Steve Hole, Arnt
  1062. Gulbrandsen, Larry Greenfield, Dave Cridland, and Pete Maclean were
  1063. active participants in those discussions or made suggestions to this
  1064. document.
  1065. 11. References
  1066. 11.1. Normative References
  1067. [ABNF] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax
  1068. Specifications: ABNF", STD 68, RFC 5234, January 2008.
  1069. [ACAP] Newman, C. and J. Myers, "ACAP -- Application Configuration
  1070. Access Protocol", RFC 2244, November 1997.
  1071. [I18N] Newman, C., Gulbrandsen, A., and A. Melnikov, "Internet
  1072. Message Access Protocol Internationalization", RFC 5255,
  1073. June 2008.
  1074. [IMAP4] Crispin, M., "Internet Message Access Protocol - Version
  1075. 4rev1", RFC 3501, March 2003.
  1076. [Kwds] Bradner, S., "Key words for use in RFCs to Indicate
  1077. Requirement Levels", RFC 2119, March 1997.
  1078. [MBRef] Gahrns, M., "IMAP4 Mailbox Referrals", RFC 2193,
  1079. September 1997.
  1080. Leiba & Melnikov Standards Track [Page 29]
  1081. RFC 5258 IMAP4 LIST Command Extensions June 2008
  1082. 11.2. Informative References
  1083. [CMbox] Gahrns, M. and R. Cheng, "The Internet Message Action
  1084. Protocol (IMAP4) Child Mailbox Extension", RFC 3348,
  1085. July 2002.
  1086. Authors' Addresses
  1087. Barry Leiba
  1088. IBM T.J. Watson Research Center
  1089. 19 Skyline Drive
  1090. Hawthorne, NY 10532
  1091. US
  1092. Phone: +1 914 784 7941
  1093. EMail: leiba@watson.ibm.com
  1094. Alexey Melnikov
  1095. Isode Limited
  1096. 5 Castle Business Village
  1097. 36 Station Road
  1098. Hampton, Middlesex TW12 2BX
  1099. UK
  1100. EMail: Alexey.Melnikov@isode.com
  1101. URI: http://www.melnikov.ca/
  1102. Leiba & Melnikov Standards Track [Page 30]
  1103. RFC 5258 IMAP4 LIST Command Extensions June 2008
  1104. Full Copyright Statement
  1105. Copyright (C) The IETF Trust (2008).
  1106. This document is subject to the rights, licenses and restrictions
  1107. contained in BCP 78, and except as set forth therein, the authors
  1108. retain all their rights.
  1109. This document and the information contained herein are provided on an
  1110. "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
  1111. OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND
  1112. THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS
  1113. OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF
  1114. THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
  1115. WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  1116. Intellectual Property
  1117. The IETF takes no position regarding the validity or scope of any
  1118. Intellectual Property Rights or other rights that might be claimed to
  1119. pertain to the implementation or use of the technology described in
  1120. this document or the extent to which any license under such rights
  1121. might or might not be available; nor does it represent that it has
  1122. made any independent effort to identify any such rights. Information
  1123. on the procedures with respect to rights in RFC documents can be
  1124. found in BCP 78 and BCP 79.
  1125. Copies of IPR disclosures made to the IETF Secretariat and any
  1126. assurances of licenses to be made available, or the result of an
  1127. attempt made to obtain a general license or permission for the use of
  1128. such proprietary rights by implementers or users of this
  1129. specification can be obtained from the IETF on-line IPR repository at
  1130. http://www.ietf.org/ipr.
  1131. The IETF invites any interested party to bring to its attention any
  1132. copyrights, patents or patent applications, or other proprietary
  1133. rights that may cover technology that may be required to implement
  1134. this standard. Please address the information to the IETF at
  1135. ietf-ipr@ietf.org.
  1136. Leiba & Melnikov Standards Track [Page 31]