rfc2193.IMAP4_Mailbox_referrals.txt 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507
  1. Network Working Group M. Gahrns
  2. Request for Comments: 2193 Microsoft
  3. Category: Standards Track September 1997
  4. IMAP4 Mailbox Referrals
  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. 1. Abstract
  12. When dealing with large amounts of users, messages and geographically
  13. dispersed IMAP4 [RFC-2060] servers, it is often desirable to
  14. distribute messages amongst different servers within an organization.
  15. For example an administrator may choose to store user's personal
  16. mailboxes on a local IMAP4 server, while storing shared mailboxes
  17. remotely on another server. This type of configuration is common
  18. when it is uneconomical to store all data centrally due to limited
  19. bandwidth or disk resources.
  20. Mailbox referrals allow clients to seamlessly access mailboxes that
  21. are distributed across several IMAP4 servers.
  22. A referral mechanism can provide efficiencies over the alternative
  23. "proxy method", in which the local IMAP4 server contacts the remote
  24. server on behalf of the client, and then transfers the data from the
  25. remote server to itself, and then on to the client. The referral
  26. mechanism's direct client connection to the remote server is often a
  27. more efficient use of bandwidth, and does not require the local
  28. server to impersonate the client when authenticating to the remote
  29. server.
  30. 2. Conventions used in this document
  31. In examples, "C:" and "S:" indicate lines sent by the client and
  32. server respectively.
  33. A home server, is an IMAP4 server that contains the user's inbox.
  34. A remote mailbox is a mailbox that is not hosted on the user's home
  35. server.
  36. Gahrns Standards Track [Page 1]
  37. RFC 2193 IMAP4 Mailbox Referrals September 1997
  38. A remote server is a server that contains remote mailboxes.
  39. A shared mailbox, is a mailbox that multiple users have access to.
  40. An IMAP mailbox referral is when the server directs the client to
  41. another IMAP mailbox.
  42. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
  43. "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
  44. document are to be interpreted as described in [RFC-2119].
  45. 3. Introduction and Overview
  46. IMAP4 servers that support this extension MUST list the keyword
  47. MAILBOX-REFERRALS in their CAPABILITY response. No client action is
  48. needed to invoke the MAILBOX-REFERRALS capability in a server.
  49. A MAILBOX-REFERRALS capable IMAP4 server MUST NOT return referrals
  50. that result in a referrals loop.
  51. A referral response consists of a tagged NO response and a REFERRAL
  52. response code. The REFERRAL response code MUST contain as an
  53. argument a one or more valid URLs separated by a space as defined in
  54. [RFC-1738]. If a server replies with multiple URLs for a particular
  55. object, they MUST all be of the same type. In this case, the URL MUST
  56. be an IMAP URL as defined in [RFC-2192]. A client that supports the
  57. REFERRALS extension MUST be prepared for a URL of any type, but it
  58. need only be able to process IMAP URLs.
  59. A server MAY respond with multiple IMAP mailbox referrals if there is
  60. more than one replica of the mailbox. This allows the implementation
  61. of a load balancing or failover scheme. How a server keeps multiple
  62. replicas of a mailbox in sync is not addressed by this document.
  63. If the server has a preferred order in which the client should
  64. attempt to access the URLs, the preferred URL SHOULD be listed in the
  65. first, with the remaining URLs presented in descending order of
  66. preference. If multiple referrals are given for a mailbox, a server
  67. should be aware that there are synchronization issues for a client if
  68. the UIDVALIDITY of the referred mailboxes are different.
  69. An IMAP mailbox referral may be given in response to an IMAP command
  70. that specifies a mailbox as an argument.
  71. Gahrns Standards Track [Page 2]
  72. RFC 2193 IMAP4 Mailbox Referrals September 1997
  73. Example:
  74. A001 NO [REFERRAL IMAP://user;AUTH=*@SERVER2/REMOTE]Remote Mailbox
  75. NOTE: user;AUTH=* is specified as required by [RFC-2192] to avoid a
  76. client falling back to anonymous login.
  77. Remote mailboxes and their inferiors, that are accessible only via
  78. referrals SHOULD NOT appear in LIST and LSUB responses issued against
  79. the user's home server. They MUST appear in RLIST and RLSUB
  80. responses issued against the user's home server. Hierarchy referrals,
  81. in which a client would be required to connect to the remote server
  82. to issue a LIST to discover the inferiors of a mailbox are not
  83. addressed in this document.
  84. For example, if shared mailboxes were only accessible via referrals
  85. on a remote server, a RLIST "" "#SHARED/%" command would return the
  86. same response if issued against the user's home server or the remote
  87. server.
  88. Note: Mailboxes that are available on the user's home server do not
  89. need to be available on the remote server. In addition, there may be
  90. additional mailboxes available on the remote server, but they will
  91. not accessible to the client via referrals unless they appear in the
  92. LIST response to the RLIST command against the user's home server.
  93. A MAILBOX-REFERRALS capable client will issue the RLIST and RLSUB
  94. commands in lieu of LIST and LSUB. The RLIST and RLSUB commands
  95. behave identically to their LIST and LSUB counterparts, except remote
  96. mailboxes are returned in addition to local mailboxes in the LIST and
  97. LSUB responses. This avoids displaying to a non MAILBOX-REFERRALS
  98. enabled client inaccessible remote mailboxes.
  99. 4.1. SELECT, EXAMINE, DELETE, SUBSCRIBE, UNSUBSCRIBE, STATUS and APPEND
  100. Referrals
  101. An IMAP4 server MAY respond to the SELECT, EXAMINE, DELETE,
  102. SUBSCRIBE, UNSUBSCRIBE, STATUS or APPEND command with one or more
  103. IMAP mailbox referrals to indicate to the client that the mailbox is
  104. hosted on a remote server.
  105. When a client processes an IMAP mailbox referral, it will open a new
  106. connection or use an existing connection to the remote server so that
  107. it is able to issue the commands necessary to process the remote
  108. mailbox.
  109. Gahrns Standards Track [Page 3]
  110. RFC 2193 IMAP4 Mailbox Referrals September 1997
  111. Example: <IMAP4 connection to home server>
  112. C: A001 DELETE "SHARED/FOO"
  113. S: A001 NO [REFERRAL IMAP://user;AUTH=*@SERVER2/SHARED/FOO]
  114. Remote mailbox. Try SERVER2.
  115. <Client established a second connection to SERVER2 and
  116. issues the DELETE command on the referred mailbox>
  117. S: * OK IMAP4rev1 server ready
  118. C: B001 AUTHENTICATE KERBEROS_V4
  119. <authentication exchange>
  120. S: B001 OK user is authenticated
  121. C: B002 DELETE "SHARED/FOO"
  122. S: B002 OK DELETE completed
  123. Example: <IMAP4 connection to home server>
  124. C: A001 SELECT REMOTE
  125. S: A001 NO [REFERRAL IMAP://user;AUTH=*@SERVER2/REMOTE
  126. IMAP://user;AUTH=*@SERVER3/REMOTE] Remote mailbox.
  127. Try SERVER2 or SERVER3.
  128. <Client opens second connection to remote server, and
  129. issues the commands needed to process the items in the
  130. remote mailbox>
  131. S: * OK IMAP4rev1 server ready
  132. C: B001 AUTHENTICATE KERBEROS_V4
  133. <authentication exchange>
  134. S: B001 OK user is authenticated
  135. C: B002 SELECT REMOTE
  136. S: * 12 EXISTS
  137. S: * 1 RECENT
  138. S: * OK [UNSEEN 10] Message 10 is first unseen
  139. S: * OK [UIDVALIDITY 123456789]
  140. S: * FLAGS (Answered Flagged Deleted Seen Draft)
  141. S: * OK [PERMANENTFLAGS (Answered Deleted Seen ]
  142. S: B002 OK [READ-WRITE] Selected completed
  143. C: B003 FETCH 10:12 RFC822
  144. S: * 10 FETCH . . .
  145. S: * 11 FETCH . . .
  146. S: * 12 FETCH . . .
  147. S: B003 OK FETCH Completed
  148. Gahrns Standards Track [Page 4]
  149. RFC 2193 IMAP4 Mailbox Referrals September 1997
  150. <Client is finished processing the REMOTE mailbox and
  151. wants to process a mailbox on its home server>
  152. C: B004 LOGOUT
  153. S: * BYE IMAP4rev1 server logging out
  154. S: B004 OK LOGOUT Completed
  155. <Client continues with first connection>
  156. C: A002 SELECT INBOX
  157. S: * 16 EXISTS
  158. S: * 2 RECENT
  159. S: * OK [UNSEEN 10] Message 10 is first unseen
  160. S: * OK [UIDVALIDITY 123456789]
  161. S: * FLAGS (Answered Flagged Deleted Seen Draft)
  162. S: * OK [PERMANENTFLAGS (Answered Deleted Seen ]
  163. S: A002 OK [READ-WRITE] Selected completed
  164. 4.2. CREATE Referrals
  165. An IMAP4 server MAY respond to the CREATE command with one or more
  166. IMAP mailbox referrals, if it wishes to direct the client to issue
  167. the CREATE against another server. The server can employ any means,
  168. such as examining the hierarchy of the specified mailbox name, in
  169. determining which server the mailbox should be created on.
  170. Example:
  171. C: A001 CREATE "SHARED/FOO"
  172. S: A001 NO [REFERRAL IMAP://user;AUTH=*@SERVER2/SHARED/FOO]
  173. Mailbox should be created on remote server
  174. Alternatively, because a home server is required to maintain a
  175. listing of referred remote mailboxes, a server MAY allow the creation
  176. of a mailbox that will ultimately reside on a remote server against
  177. the home server, and provide referrals on subsequent commands that
  178. manipulate the mailbox.
  179. Example:
  180. C: A001 CREATE "SHARED/FOO"
  181. S: A001 OK CREATE succeeded
  182. C: A002 SELECT "SHARED/FOO"
  183. S: A002 NO [REFERRAL IMAP://user;AUTH=*@SERVER2/SHARED/FOO]
  184. Remote mailbox. Try SERVER2
  185. Gahrns Standards Track [Page 5]
  186. RFC 2193 IMAP4 Mailbox Referrals September 1997
  187. 4.3. RENAME Referrals
  188. An IMAP4 server MAY respond to the RENAME command with one or more
  189. pairs of IMAP mailbox referrals. In each pair of IMAP mailbox
  190. referrals, the first one is an URL to the existing mailbox name and
  191. the second is an URL to the requested new mailbox name.
  192. If within an IMAP mailbox referral pair, the existing and new mailbox
  193. URLs are on different servers, the remote servers are unable to
  194. perform the RENAME operation. To achieve the same behavior of
  195. server RENAME, the client MAY issue the constituent CREATE, FETCH,
  196. APPEND, and DELETE commands against both servers.
  197. If within an IMAP mailbox referral pair, the existing and new mailbox
  198. URLs are on the same server it is an indication that the currently
  199. connected server is unable to perform the operation. The client can
  200. simply re-issue the RENAME command on the remote server.
  201. Example:
  202. C: A001 RENAME FOO BAR
  203. S: A001 NO [REFERRAL IMAP://user;AUTH=*@SERVER1/FOO
  204. IMAP://user;AUTH=*@SERVER2/BAR] Unable to rename mailbox
  205. across servers
  206. Since the existing and new mailbox names are on different servers,
  207. the client would be required to make a connection to both servers and
  208. issue the constituent commands require to achieve the RENAME.
  209. Example:
  210. C: A001 RENAME FOO BAR
  211. S: A001 NO [REFERRAL IMAP://user;AUTH=*@SERVER2/FOO
  212. IMAP://user;AUTH=*@SERVER2/BAR] Unable to rename mailbox
  213. located on SERVER2
  214. Since both the existing and new mailbox are on the same remote
  215. server, the client can simply make a connection to the remote server
  216. and re-issue the RENAME command.
  217. 4.4. COPY Referrals
  218. An IMAP4 server MAY respond to the COPY command with one or more IMAP
  219. mailbox referrals. This indicates that the destination mailbox is on
  220. a remote server. To achieve the same behavior of a server COPY, the
  221. client MAY issue the constituent FETCH and APPEND commands against
  222. both servers.
  223. Gahrns Standards Track [Page 6]
  224. RFC 2193 IMAP4 Mailbox Referrals September 1997
  225. Example:
  226. C: A001 COPY 1 "SHARED/STUFF"
  227. S: A001 NO [REFERRAL IMAP://user;AUTH=*@SERVER2/SHARED/STUFF]
  228. Unable to copy message(s) to SERVER2.
  229. 5.1 RLIST command
  230. Arguments: reference name
  231. mailbox name with possible wildcards
  232. Responses: untagged responses: LIST
  233. Result: OK - RLIST Completed
  234. NO - RLIST Failure
  235. BAD - command unknown or arguments invalid
  236. The RLIST command behaves identically to its LIST counterpart, except
  237. remote mailboxes are returned in addition to local mailboxes in the
  238. LIST responses.
  239. 5.2 RLSUB Command
  240. Arguments: reference name
  241. mailbox name with possible wildcards
  242. Responses: untagged responses: LSUB
  243. Result: OK - RLSUB Completed
  244. NO - RLSUB Failure
  245. BAD - command unknown or arguments invalid
  246. The RLSUB command behaves identically to its LSUB counterpart, except
  247. remote mailboxes are returned in addition to local mailboxes in the
  248. LSUB responses.
  249. 6. Formal Syntax
  250. The following syntax specification uses the augmented Backus-Naur
  251. Form (BNF) as described in [ABNF].
  252. list_mailbox = <list_mailbox> as defined in [RFC-2060]
  253. mailbox = <mailbox> as defined in [RFC-2060]
  254. mailbox_referral = <tag> SPACE "NO" SPACE
  255. <referral_response_code> (text / text_mime2)
  256. ; See [RFC-2060] for <tag>, text and text_mime2 definition
  257. Gahrns Standards Track [Page 7]
  258. RFC 2193 IMAP4 Mailbox Referrals September 1997
  259. referral_response_code = "[" "REFERRAL" 1*(SPACE <url>) "]"
  260. ; See [RFC-1738] for <url> definition
  261. rlist = "RLIST" SPACE mailbox SPACE list_mailbox
  262. rlsub = "RLSUB" SPACE mailbox SPACE list_mailbox
  263. 6. Security Considerations
  264. The IMAP4 referral mechanism makes use of IMAP URLs, and as such,
  265. have the same security considerations as general internet URLs [RFC-
  266. 1738], and in particular IMAP URLs [RFC-2192].
  267. With the MAILBOX-REFERRALS capability, it is potentially easier to
  268. write a rogue server that injects a bogus referral response that
  269. directs a user to an incorrect mailbox. Although referrals reduce
  270. the effort to write such a server, the referral response makes
  271. detection of the intrusion easier.
  272. 7. References
  273. [RFC-2060], Crispin, M., "Internet Message Access Protocol - Version
  274. 4rev1", RFC 2060, University of Washington, December 1996.
  275. [RFC-2192], Newman, C., "IMAP URL Scheme", RFC 2192, Innosoft,
  276. September 1997.
  277. [RFC-1738], Berners-Lee, T., Masinter, L., and M. McCahill, "Uniform
  278. Resource Locators (URL)", RFC 1738, CERN, Xerox Corporation,
  279. University of Minnesota, December 1994.
  280. [RFC-2119], Bradner, S., "Key words for use in RFCs to Indicate
  281. Requirement Levels", RFC 2119, Harvard University, March 1997.
  282. [ABNF], DRUMS working group, Dave Crocker Editor, "Augmented BNF for
  283. Syntax Specifications: ABNF", Work in Progress, Internet Mail
  284. Consortium, April 1997.
  285. 8. Acknowledgments
  286. Many valuable suggestions were received from private discussions and
  287. the IMAP4 mailing list. In particular, Raymond Cheng, Mark Crispin,
  288. Mark Keasling, Chris Newman and Larry Osterman made significant
  289. contributions to this document.
  290. Gahrns Standards Track [Page 8]
  291. RFC 2193 IMAP4 Mailbox Referrals September 1997
  292. 9. Author's Address
  293. Mike Gahrns
  294. Microsoft
  295. One Microsoft Way
  296. Redmond, WA, 98072
  297. Phone: (206) 936-9833
  298. EMail: mikega@microsoft.com
  299. Gahrns Standards Track [Page 9]