rfc2342.IMAP4_Namespace.txt 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. Network Working Group M. Gahrns
  2. Request for Comments: 2342 Microsoft
  3. Category: Standards Track C. Newman
  4. Innosoft
  5. May 1998
  6. IMAP4 Namespace
  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. Copyright Notice
  14. Copyright (C) The Internet Society (1998). All Rights Reserved.
  15. 1. Abstract
  16. IMAP4 [RFC-2060] does not define a default server namespace. As a
  17. result, two common namespace models have evolved:
  18. The "Personal Mailbox" model, in which the default namespace that is
  19. presented consists of only the user's personal mailboxes. To access
  20. shared mailboxes, the user must use an escape mechanism to reach
  21. another namespace.
  22. The "Complete Hierarchy" model, in which the default namespace that
  23. is presented includes the user's personal mailboxes along with any
  24. other mailboxes they have access to.
  25. These two models, create difficulties for certain client operations.
  26. This document defines a NAMESPACE command that allows a client to
  27. discover the prefixes of namespaces used by a server for personal
  28. mailboxes, other users' mailboxes, and shared mailboxes. This allows
  29. a client to avoid much of the manual user configuration that is now
  30. necessary when mixing and matching IMAP4 clients and servers.
  31. 2. Conventions used in this document
  32. In examples, "C:" and "S:" indicate lines sent by the client and
  33. server respectively. If such lines are wrapped without a new "C:" or
  34. "S:" label, then the wrapping is for editorial clarity and is not
  35. part of the command.
  36. Gahrns & Newman Standards Track [Page 1]
  37. RFC 2342 IMAP4 Namespace May 1998
  38. Personal Namespace: A namespace that the server considers within the
  39. personal scope of the authenticated user on a particular connection.
  40. Typically, only the authenticated user has access to mailboxes in
  41. their Personal Namespace. It is the part of the namespace that
  42. belongs to the user that is allocated for mailboxes. If an INBOX
  43. exists for a user, it MUST appear within the user's personal
  44. namespace. In the typical case, there SHOULD be only one Personal
  45. Namespace on a server.
  46. Other Users' Namespace: A namespace that consists of mailboxes from
  47. the Personal Namespaces of other users. To access mailboxes in the
  48. Other Users' Namespace, the currently authenticated user MUST be
  49. explicitly granted access rights. For example, it is common for a
  50. manager to grant to their secretary access rights to their mailbox.
  51. In the typical case, there SHOULD be only one Other Users' Namespace
  52. on a server.
  53. Shared Namespace: A namespace that consists of mailboxes that are
  54. intended to be shared amongst users and do not exist within a user's
  55. Personal Namespace.
  56. The namespaces a server uses MAY differ on a per-user basis.
  57. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
  58. "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
  59. document are to be interpreted as described in [RFC-2119].
  60. 3. Introduction and Overview
  61. Clients often attempt to create mailboxes for such purposes as
  62. maintaining a record of sent messages (e.g. "Sent Mail") or
  63. temporarily saving messages being composed (e.g. "Drafts"). For
  64. these clients to inter-operate correctly with the variety of IMAP4
  65. servers available, the user must enter the prefix of the Personal
  66. Namespace used by the server. Using the NAMESPACE command, a client
  67. is able to automatically discover this prefix without manual user
  68. configuration.
  69. In addition, users are often required to manually enter the prefixes
  70. of various namespaces in order to view the mailboxes located there.
  71. For example, they might be required to enter the prefix of #shared to
  72. view the shared mailboxes namespace. The NAMESPACE command allows a
  73. client to automatically discover the namespaces that are available on
  74. a server. This allows a client to present the available namespaces to
  75. the user in what ever manner it deems appropriate. For example, a
  76. Gahrns & Newman Standards Track [Page 2]
  77. RFC 2342 IMAP4 Namespace May 1998
  78. client could choose to initially display only personal mailboxes, or
  79. it may choose to display the complete list of mailboxes available,
  80. and initially position the user at the root of their Personal
  81. Namespace.
  82. A server MAY choose to make available to the NAMESPACE command only a
  83. subset of the complete set of namespaces the server supports. To
  84. provide the ability to access these namespaces, a client SHOULD allow
  85. the user the ability to manually enter a namespace prefix.
  86. 4. Requirements
  87. IMAP4 servers that support this extension MUST list the keyword
  88. NAMESPACE in their CAPABILITY response.
  89. The NAMESPACE command is valid in the Authenticated and Selected
  90. state.
  91. 5. NAMESPACE Command
  92. Arguments: none
  93. Response: an untagged NAMESPACE response that contains the prefix
  94. and hierarchy delimiter to the server's Personal
  95. Namespace(s), Other Users' Namespace(s), and Shared
  96. Namespace(s) that the server wishes to expose. The
  97. response will contain a NIL for any namespace class
  98. that is not available. Namespace_Response_Extensions
  99. MAY be included in the response.
  100. Namespace_Response_Extensions which are not on the IETF
  101. standards track, MUST be prefixed with an "X-".
  102. Result: OK - Command completed
  103. NO - Error: Can't complete command
  104. BAD - argument invalid
  105. Example 5.1:
  106. ===========
  107. < A server that supports a single personal namespace. No leading
  108. prefix is used on personal mailboxes and "/" is the hierarchy
  109. delimiter.>
  110. C: A001 NAMESPACE
  111. S: * NAMESPACE (("" "/")) NIL NIL
  112. S: A001 OK NAMESPACE command completed
  113. Gahrns & Newman Standards Track [Page 3]
  114. RFC 2342 IMAP4 Namespace May 1998
  115. Example 5.2:
  116. ===========
  117. < A user logged on anonymously to a server. No personal mailboxes
  118. are associated with the anonymous user and the user does not have
  119. access to the Other Users' Namespace. No prefix is required to
  120. access shared mailboxes and the hierarchy delimiter is "." >
  121. C: A001 NAMESPACE
  122. S: * NAMESPACE NIL NIL (("" "."))
  123. S: A001 OK NAMESPACE command completed
  124. Example 5.3:
  125. ===========
  126. < A server that contains a Personal Namespace and a single Shared
  127. Namespace. >
  128. C: A001 NAMESPACE
  129. S: * NAMESPACE (("" "/")) NIL (("Public Folders/" "/"))
  130. S: A001 OK NAMESPACE command completed
  131. Example 5.4:
  132. ===========
  133. < A server that contains a Personal Namespace, Other Users'
  134. Namespace and multiple Shared Namespaces. Note that the hierarchy
  135. delimiter used within each namespace can be different. >
  136. C: A001 NAMESPACE
  137. S: * NAMESPACE (("" "/")) (("~" "/")) (("#shared/" "/")
  138. ("#public/" "/")("#ftp/" "/")("#news." "."))
  139. S: A001 OK NAMESPACE command completed
  140. The prefix string allows a client to do things such as automatically
  141. creating personal mailboxes or LISTing all available mailboxes within
  142. a namespace.
  143. Example 5.5:
  144. ===========
  145. < A server that supports only the Personal Namespace, with a
  146. leading prefix of INBOX to personal mailboxes and a hierarchy
  147. delimiter of ".">
  148. C: A001 NAMESPACE
  149. S: * NAMESPACE (("INBOX." ".")) NIL NIL
  150. S: A001 OK NAMESPACE command completed
  151. Gahrns & Newman Standards Track [Page 4]
  152. RFC 2342 IMAP4 Namespace May 1998
  153. < Automatically create a mailbox to store sent items.>
  154. C: A002 CREATE "INBOX.Sent Mail"
  155. S: A002 OK CREATE command completed
  156. Although typically a server will support only a single Personal
  157. Namespace, and a single Other User's Namespace, circumstances exist
  158. where there MAY be multiples of these, and a client MUST be prepared
  159. for them. If a client is configured such that it is required to
  160. create a certain mailbox, there can be circumstances where it is
  161. unclear which Personal Namespaces it should create the mailbox in.
  162. In these situations a client SHOULD let the user select which
  163. namespaces to create the mailbox in.
  164. Example 5.6:
  165. ===========
  166. < In this example, a server supports 2 Personal Namespaces. In
  167. addition to the regular Personal Namespace, the user has an
  168. additional personal namespace to allow access to mailboxes in an
  169. MH format mailstore. >
  170. < The client is configured to save a copy of all mail sent by the
  171. user into a mailbox called 'Sent Mail'. Furthermore, after a
  172. message is deleted from a mailbox, the client is configured to
  173. move that message to a mailbox called 'Deleted Items'.>
  174. < Note that this example demonstrates how some extension flags can
  175. be passed to further describe the #mh namespace. >
  176. C: A001 NAMESPACE
  177. S: * NAMESPACE (("" "/")("#mh/" "/" "X-PARAM" ("FLAG1" "FLAG2")))
  178. NIL NIL
  179. S: A001 OK NAMESPACE command completed
  180. < It is desired to keep only one copy of sent mail. It is unclear
  181. which Personal Namespace the client should use to create the 'Sent
  182. Mail' mailbox. The user is prompted to select a namespace and
  183. only one 'Sent Mail' mailbox is created. >
  184. C: A002 CREATE "Sent Mail"
  185. S: A002 OK CREATE command completed
  186. < The client is designed so that it keeps two 'Deleted Items'
  187. mailboxes, one for each namespace. >
  188. C: A003 CREATE "Delete Items"
  189. S: A003 OK CREATE command completed
  190. Gahrns & Newman Standards Track [Page 5]
  191. RFC 2342 IMAP4 Namespace May 1998
  192. C: A004 CREATE "#mh/Deleted Items"
  193. S: A004 OK CREATE command completed
  194. The next level of hierarchy following the Other Users' Namespace
  195. prefix SHOULD consist of <username>, where <username> is a user name
  196. as per the IMAP4 LOGIN or AUTHENTICATE command.
  197. A client can construct a LIST command by appending a "%" to the Other
  198. Users' Namespace prefix to discover the Personal Namespaces of other
  199. users that are available to the currently authenticated user.
  200. In response to such a LIST command, a server SHOULD NOT return user
  201. names that have not granted access to their personal mailboxes to the
  202. user in question.
  203. A server MAY return a LIST response containing only the names of
  204. users that have explicitly granted access to the user in question.
  205. Alternatively, a server MAY return NO to such a LIST command,
  206. requiring that a user name be included with the Other Users'
  207. Namespace prefix before listing any other user's mailboxes.
  208. Example 5.7:
  209. ===========
  210. < A server that supports providing a list of other user's
  211. mailboxes that are accessible to the currently logged on user. >
  212. C: A001 NAMESPACE
  213. S: * NAMESPACE (("" "/")) (("Other Users/" "/")) NIL
  214. S: A001 OK NAMESPACE command completed
  215. C: A002 LIST "" "Other Users/%"
  216. S: * LIST () "/" "Other Users/Mike"
  217. S: * LIST () "/" "Other Users/Karen"
  218. S: * LIST () "/" "Other Users/Matthew"
  219. S: * LIST () "/" "Other Users/Tesa"
  220. S: A002 OK LIST command completed
  221. Example 5.8:
  222. ===========
  223. < A server that does not support providing a list of other user's
  224. mailboxes that are accessible to the currently logged on user.
  225. The mailboxes are listable if the client includes the name of the
  226. other user with the Other Users' Namespace prefix. >
  227. Gahrns & Newman Standards Track [Page 6]
  228. RFC 2342 IMAP4 Namespace May 1998
  229. C: A001 NAMESPACE
  230. S: * NAMESPACE (("" "/")) (("#Users/" "/")) NIL
  231. S: A001 OK NAMESPACE command completed
  232. < In this example, the currently logged on user has access to the
  233. Personal Namespace of user Mike, but the server chose to suppress
  234. this information in the LIST response. However, by appending the
  235. user name Mike (received through user input) to the Other Users'
  236. Namespace prefix, the client is able to get a listing of the
  237. personal mailboxes of user Mike. >
  238. C: A002 LIST "" "#Users/%"
  239. S: A002 NO The requested item could not be found.
  240. C: A003 LIST "" "#Users/Mike/%"
  241. S: * LIST () "/" "#Users/Mike/INBOX"
  242. S: * LIST () "/" "#Users/Mike/Foo"
  243. S: A003 OK LIST command completed.
  244. A prefix string might not contain a hierarchy delimiter, because
  245. in some cases it is not needed as part of the prefix.
  246. Example 5.9:
  247. ===========
  248. < A server that allows access to the Other Users' Namespace by
  249. prefixing the others' mailboxes with a '~' followed by <username>,
  250. where <username> is a user name as per the IMAP4 LOGIN or
  251. AUTHENTICATE command.>
  252. C: A001 NAMESPACE
  253. S: * NAMESPACE (("" "/")) (("~" "/")) NIL
  254. S: A001 OK NAMESPACE command completed
  255. < List the mailboxes for user mark >
  256. C: A002 LIST "" "~mark/%"
  257. S: * LIST () "/" "~mark/INBOX"
  258. S: * LIST () "/" "~mark/foo"
  259. S: A002 OK LIST command completed
  260. Historical convention has been to start all namespaces with the "#"
  261. character. Namespaces that include the "#" character are not IMAP
  262. URL [IMAP-URL] friendly requiring the "#" character to be represented
  263. as %23 when within URLs. As such, server implementers MAY instead
  264. consider using namespace prefixes that do not contain the "#"
  265. character.
  266. Gahrns & Newman Standards Track [Page 7]
  267. RFC 2342 IMAP4 Namespace May 1998
  268. 6. Formal Syntax
  269. The following syntax specification uses the augmented Backus-Naur
  270. Form (BNF) as described in [ABNF].
  271. atom = <atom>
  272. ; <atom> as defined in [RFC-2060]
  273. Namespace = nil / "(" 1*( "(" string SP (<"> QUOTED_CHAR <"> /
  274. nil) *(Namespace_Response_Extension) ")" ) ")"
  275. Namespace_Command = "NAMESPACE"
  276. Namespace_Response_Extension = SP string SP "(" string *(SP string)
  277. ")"
  278. Namespace_Response = "*" SP "NAMESPACE" SP Namespace SP Namespace SP
  279. Namespace
  280. ; The first Namespace is the Personal Namespace(s)
  281. ; The second Namespace is the Other Users' Namespace(s)
  282. ; The third Namespace is the Shared Namespace(s)
  283. nil = <nil>
  284. ; <nil> as defined in [RFC-2060]
  285. QUOTED_CHAR = <QUOTED_CHAR>
  286. ; <QUOTED_CHAR> as defined in [RFC-2060]
  287. string = <string>
  288. ; <string> as defined in [RFC-2060]
  289. ; Note that the namespace prefix is to a mailbox and following
  290. ; IMAP4 convention, any international string in the NAMESPACE
  291. ; response MUST be of modified UTF-7 format as described in
  292. ; [RFC-2060].
  293. 7. Security Considerations
  294. In response to a LIST command containing an argument of the Other
  295. Users' Namespace prefix, a server SHOULD NOT list users that have not
  296. granted list access to their personal mailboxes to the currently
  297. authenticated user. Providing such a list, could compromise security
  298. by potentially disclosing confidential information of who is located
  299. on the server, or providing a starting point of a list of user
  300. accounts to attack.
  301. Gahrns & Newman Standards Track [Page 8]
  302. RFC 2342 IMAP4 Namespace May 1998
  303. 8. References
  304. [RFC-2060], Crispin, M., "Internet Message Access Protocol Version
  305. 4rev1", RFC 2060, December 1996.
  306. [RFC-2119], Bradner, S., "Key words for use in RFCs to Indicate
  307. Requirement Levels", BCP 14, RFC 2119, March 1997.
  308. [ABNF] Crocker, D., Editor, and P. Overell, "Augmented BNF for Syntax
  309. Specifications: ABNF", RFC 2234, November 1997.
  310. [IMAP-URL], Newman, C., "IMAP URL Scheme", RFC 2192, September 1997.
  311. 9. Acknowledgments
  312. Many people have participated in the discussion of IMAP namespaces on
  313. the IMAP mailing list. In particular, the authors would like to
  314. thank Mark Crispin for many of the concepts relating to the Personal
  315. Namespace and accessing the Personal Namespace of other users, Steve
  316. Hole for summarizing the two namespace models, John Myers and Jack De
  317. Winter for their work in a preceding effort trying to define a
  318. standardized personal namespace, and Larry Osterman for his review
  319. and collaboration on this document.
  320. 11. Authors' Addresses
  321. Mike Gahrns
  322. Microsoft
  323. One Microsoft Way
  324. Redmond, WA, 98072, USA
  325. Phone: (425) 936-9833
  326. EMail: mikega@microsoft.com
  327. Chris Newman
  328. Innosoft International, Inc.
  329. 1050 East Garvey Ave. South
  330. West Covina, CA, 91790, USA
  331. EMail: chris.newman@innosoft.com
  332. Gahrns & Newman Standards Track [Page 9]
  333. RFC 2342 IMAP4 Namespace May 1998
  334. 12. Full Copyright Statement
  335. Copyright (C) The Internet Society (1998). All Rights Reserved.
  336. This document and translations of it may be copied and furnished to
  337. others, and derivative works that comment on or otherwise explain it
  338. or assist in its implementation may be prepared, copied, published
  339. and distributed, in whole or in part, without restriction of any
  340. kind, provided that the above copyright notice and this paragraph are
  341. included on all such copies and derivative works. However, this
  342. document itself may not be modified in any way, such as by removing
  343. the copyright notice or references to the Internet Society or other
  344. Internet organizations, except as needed for the purpose of
  345. developing Internet standards in which case the procedures for
  346. copyrights defined in the Internet Standards process must be
  347. followed, or as required to translate it into languages other than
  348. English.
  349. The limited permissions granted above are perpetual and will not be
  350. revoked by the Internet Society or its successors or assigns.
  351. This document and the information contained herein is provided on an
  352. "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
  353. TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
  354. BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
  355. HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
  356. MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  357. Gahrns & Newman Standards Track [Page 10]