rfc4549.Sync_operations_for_disconnected_IMAP4_Clients.txt 74 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963
  1. Network Working Group A. Melnikov, Ed.
  2. Request for Comments: 4549 Isode Ltd.
  3. Category: Informational June 2006
  4. Synchronization Operations for Disconnected IMAP4 Clients
  5. Status of This Memo
  6. This memo provides information for the Internet community. It does
  7. not specify an Internet standard of any kind. Distribution of this
  8. memo is unlimited.
  9. Copyright Notice
  10. Copyright (C) The Internet Society (2006).
  11. Abstract
  12. This document attempts to address some of the issues involved in
  13. building a disconnected IMAP4 client. In particular, it deals with
  14. the issues of what might be called the "driver" portion of the
  15. synchronization tool: the portion of the code responsible for issuing
  16. the correct set of IMAP4 commands to synchronize the disconnected
  17. client in the way that is most likely to make the human who uses the
  18. disconnected client happy.
  19. This note describes different strategies that can be used by
  20. disconnected clients and shows how to use IMAP protocol in order to
  21. minimize the time of the synchronization process.
  22. This note also lists IMAP extensions that a server should implement
  23. in order to provide better synchronization facilities to disconnected
  24. clients.
  25. Melnikov Informational [Page 1]
  26. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  27. Table of Contents
  28. 1. Introduction ....................................................3
  29. 1.1. Conventions Used in This Document ..........................3
  30. 2. Design Principles ...............................................3
  31. 3. Overall Picture of Synchronization ..............................4
  32. 4. Mailbox Synchronization Steps and Strategies ....................7
  33. 4.1. Checking UID Validity ......................................7
  34. 4.2. Synchronizing Local Changes with the Server ................8
  35. 4.2.1. Uploading Messages to the Mailbox ...................8
  36. 4.2.2. Optimizing "move" and "copy" Operations .............9
  37. 4.2.3. Replaying Local Flag Changes .......................14
  38. 4.2.4. Processing Mailbox Compression (EXPUNGE) Requests ..15
  39. 4.2.5. Closing a Mailbox ..................................17
  40. 4.3. Details of "Normal" Synchronization of a Single Mailbox ...18
  41. 4.3.1. Discovering New Messages and Changes to Old
  42. Messages ...........................................18
  43. 4.3.2. Searching for "Interesting" Messages. ..............20
  44. 4.3.3. Populating Cache with "Interesting" Messages. ......21
  45. 4.3.4. User-Initiated Synchronization .....................22
  46. 4.4. Special Case: Descriptor-Only Synchronization .............22
  47. 4.5. Special Case: Fast New-Only Synchronization ...............23
  48. 4.6. Special Case: Blind FETCH .................................23
  49. 5. Implementation Considerations ..................................24
  50. 5.1. Error Recovery during Playback ............................26
  51. 5.2. Quality of Implementation Issues ..........................28
  52. 5.3. Optimizations .............................................28
  53. 6. IMAP Extensions That May Help ..................................30
  54. 6.1. CONDSTORE Extension .......................................30
  55. 7. Security Considerations ........................................33
  56. 8. References .....................................................33
  57. 8.1. Normative References ......................................33
  58. 8.2. Informative References ....................................34
  59. 9. Acknowledgements ...............................................34
  60. Melnikov Informational [Page 2]
  61. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  62. 1. Introduction
  63. Several recommendations presented in this document are generally
  64. applicable to all types of IMAP clients. However, this document
  65. tries to concentrate on disconnected mail clients [IMAP-MODEL]. It
  66. also suggests some IMAP extensions* that should be implemented by
  67. IMAP servers in order to make the life of disconnected clients
  68. easier. In particular, the [UIDPLUS] extension was specifically
  69. designed to streamline certain disconnected operations, like
  70. expunging, uploading, and copying messages (see Sections 4.2.1,
  71. 4.2.2.1, and 4.2.4).
  72. Readers of this document are also strongly advised to read RFC 2683
  73. [RFC2683].
  74. * Note that the functionality provided by the base IMAP protocol
  75. [IMAP4] is sufficient to perform basic synchronization.
  76. 1.1. Conventions Used in This Document
  77. In examples, "C:" and "S:" indicate lines sent by the client and
  78. server, respectively. Long lines in examples are broken for
  79. editorial clarity.
  80. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
  81. "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
  82. document are to be interpreted as described in RFC 2119 [KEYWORDS].
  83. Let's call an IMAP command idempotent if the result of executing the
  84. command twice sequentially is the same as the result of executing the
  85. command just once.
  86. 2. Design Principles
  87. All mailbox state or content information stored on the disconnected
  88. client should be viewed strictly as a cache of the state of the
  89. server. The "master" state remains on the server, just as it would
  90. with an interactive IMAP4 client. The one exception to this rule is
  91. that information about the state of the disconnected client's cache
  92. (the state includes flag changes while offline and during scheduled
  93. message uploads) remains on the disconnected client: that is, the
  94. IMAP4 server is not responsible for remembering the state of the
  95. disconnected IMAP4 client.
  96. We assume that a disconnected client is a client that, for whatever
  97. reason, wants to minimize the length of time that it is "on the
  98. phone" to the IMAP4 server. Often this will be because the client is
  99. using a dialup connection, possibly with very low bandwidth, but
  100. Melnikov Informational [Page 3]
  101. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  102. sometimes it might just be that the human is in a hurry to catch an
  103. airplane, or some other event beyond our control. Whatever the
  104. reason, we assume that we must make efficient use of the network
  105. connection, both in the usual sense (not generating spurious traffic)
  106. and in the sense that we would prefer not to have the connection
  107. sitting idle while the client and/or the server is performing
  108. strictly local computation or I/O. Another, perhaps simpler way of
  109. stating this is that we assume that network connections are
  110. "expensive".
  111. Practical experience with disconnected mail systems has shown that
  112. there is no single synchronization strategy that is appropriate for
  113. all cases. Different humans have different preferences, and the same
  114. human's preference will vary depending both on external circumstance
  115. (how much of a hurry the human is in today) and on the value that the
  116. human places on the messages being transferred. The point here is
  117. that there is no way that the synchronization program can guess
  118. exactly what the human wants to do, so the human will have to provide
  119. some guidance.
  120. Taken together, the preceding two principles lead to the conclusion
  121. that the synchronization program must make its decisions based on
  122. some kind of guidance provided by the human, by selecting the
  123. appropriate options in the user interface or through some sort of
  124. configuration file. Almost certainly, it should not pause for I/O
  125. with the human in the middle of the synchronization process. The
  126. human will almost certainly have several different configurations for
  127. the synchronization program, for different circumstances.
  128. Since a disconnected client has no way of knowing what changes might
  129. have occurred to the mailbox while it was disconnected, message
  130. numbers are not useful to a disconnected client. All disconnected
  131. client operations should be performed using UIDs, so that the client
  132. can be sure that it and the server are talking about the same
  133. messages during the synchronization process.
  134. 3. Overall Picture of Synchronization
  135. The basic strategy for synchronization is outlined below. Note that
  136. the real strategy may vary from one application to another or may
  137. depend on a synchronization mode.
  138. a) Process any "actions" that were pending on the client that were
  139. not associated with any mailbox. (In particular sending messages
  140. composed offline with SMTP. This is not part of IMAP
  141. synchronization, but it is mentioned here for completeness.)
  142. Melnikov Informational [Page 4]
  143. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  144. b) Fetch the current list of "interesting" mailboxes. (The
  145. disconnected client should allow the user to skip this step
  146. completely.)
  147. c) "Client-to-server synchronization": for each IMAP "action" that
  148. was pending on the client, do the following:
  149. 1) If the action implies opening a new mailbox (any operation that
  150. operates on messages), open the mailbox. Check its UID
  151. validity value (see Section 4.1 for more details) returned in
  152. the UIDVALIDITY response code. If the UIDVALIDITY value
  153. returned by the server differs, the client MUST empty the local
  154. cache of the mailbox and remove any pending "actions" that
  155. refer to UIDs in that mailbox (and consider them failed). Note
  156. that this doesn't affect actions performed on client-generated
  157. fake UIDs (see Section 5).
  158. 2) Perform the action. If the action is to delete a mailbox
  159. (DELETE), make sure that the mailbox is closed first (see also
  160. Section 3.4.12 of [RFC2683]).
  161. d) "Server-to-client synchronization": for each mailbox that requires
  162. synchronization, do the following:
  163. 1) Check the mailbox UIDVALIDITY (see Section 4.1 for more
  164. details) with SELECT/EXAMINE/STATUS.
  165. If UIDVALIDITY value returned by the server differs, the client
  166. MUST
  167. * empty the local cache of that mailbox;
  168. * remove any pending "actions" that refer to UIDs in that
  169. mailbox and consider them failed; and
  170. * skip step 2-II.
  171. 2) Fetch the current "descriptors";
  172. I) Discover new messages.
  173. II) Discover changes to old messages.
  174. 3) Fetch the bodies of any "interesting" messages that the client
  175. doesn't already have.
  176. e) Close all open mailboxes not required for further operations (if
  177. staying online) or disconnect all open connections (if going
  178. offline).
  179. Melnikov Informational [Page 5]
  180. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  181. Terms used:
  182. "Actions" are queued requests that were made by the human to the
  183. client's Mail User Agent (MUA) software while the client was
  184. disconnected.
  185. We define "descriptors" as a set of IMAP4 FETCH data items.
  186. Conceptually, a message's descriptor is that set of information that
  187. allows the synchronization program to decide what protocol actions
  188. are necessary to bring the local cache to the desired state for this
  189. message; since this decision is really up to the human, this
  190. information probably includes at least a few header fields intended
  191. for human consumption. Exactly what will constitute a descriptor
  192. depends on the client implementation. At a minimum, the descriptor
  193. contains the message's UID and FLAGS. Other likely candidates are
  194. the RFC822.SIZE, RFC822.HEADER, BODYSTRUCTURE, or ENVELOPE data
  195. items.
  196. Comments:
  197. 1) The list of actions should be ordered. For example, if the human
  198. deletes message A1 in mailbox A, then expunges mailbox A, and then
  199. deletes message A2 in mailbox A, the human will expect that
  200. message A1 is gone and that message A2 is still present but is now
  201. deleted.
  202. By processing all the actions before proceeding with
  203. synchronization, we avoid having to compensate for the local MUA's
  204. changes to the server's state. That is, once we have processed
  205. all the pending actions, the steps that the client must take to
  206. synchronize itself will be the same no matter where the changes to
  207. the server's state originated.
  208. 2) Steps a and b can be performed in parallel. Alternatively, step a
  209. can be performed after d.
  210. 3) On step b, the set of "interesting" mailboxes pretty much has to
  211. be determined by the human. What mailboxes belong to this set may
  212. vary between different IMAP4 sessions with the same server,
  213. client, and human. An interesting mailbox can be a mailbox
  214. returned by LSUB command (see Section 6.3.9 of [IMAP4]). The
  215. special mailbox "INBOX" SHOULD be in the default set of mailboxes
  216. that the client considers interesting. However, providing the
  217. ability to ignore INBOX for a particular session or client may be
  218. valuable for some mail filtering strategies.
  219. Melnikov Informational [Page 6]
  220. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  221. 4) On step d-2-II, the client also finds out about changes to the
  222. flags of messages that the client already has in its local cache,
  223. and about messages in the local cache that no longer exist on the
  224. server (i.e., messages that have been expunged).
  225. 5) "Interesting" messages are those messages that the synchronization
  226. program thinks the human wants to have cached locally, based on
  227. the configuration and the data retrieved in step b.
  228. 6) A disconnected IMAP client is a special case of an IMAP client, so
  229. it MUST be able to handle any "unexpected" unsolicited responses,
  230. like EXISTS and EXPUNGE, at any time. The disconnected client MAY
  231. ignore EXPUNGE response during "client-to-server" synchronization
  232. phase (step c).
  233. The rest of this discussion will focus primarily on the
  234. synchronization issues for a single mailbox.
  235. 4. Mailbox Synchronization Steps and Strategies
  236. 4.1. Checking UID Validity
  237. The "UID validity" of a mailbox is a number returned in an
  238. UIDVALIDITY response code in an OK untagged response at mailbox
  239. selection time. The UID validity value changes between sessions when
  240. UIDs fail to persist between sessions.
  241. Whenever the client selects a mailbox, the client must compare the
  242. returned UID validity value with the value stored in the local cache.
  243. If the UID validity values differ, the UIDs in the client's cache are
  244. no longer valid. The client MUST then empty the local cache of that
  245. mailbox and remove any pending "actions" that refer to UIDs in that
  246. mailbox. The client MAY also issue a warning to the human. The
  247. client MUST NOT cancel any scheduled uploads (i.e., APPENDs) for the
  248. mailbox.
  249. Note that UIDVALIDITY is not only returned on a mailbox selection.
  250. The COPYUID and APPENDUID response codes defined in the [UIDPLUS]
  251. extension (see also 4.2.2) and the UIDVALIDITY STATUS response data
  252. item also contain a UIDVALIDITY value for some other mailbox. The
  253. client SHOULD behave as described in the previous paragraph (but it
  254. should act on the other mailbox's cache), no matter how it obtained
  255. the UIDVALIDITY value.
  256. Melnikov Informational [Page 7]
  257. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  258. 4.2. Synchronizing Local Changes with the Server
  259. 4.2.1. Uploading Messages to the Mailbox
  260. Two of the most common examples of operations resulting in message
  261. uploads are:
  262. 1) Saving a draft message
  263. 2) Copying a message between remote mailboxes on two different IMAP
  264. servers or a local mailbox and a remote mailbox.
  265. Message upload is performed with the APPEND command. A message
  266. scheduled to be uploaded has no UID associated with it, as all UIDs
  267. are assigned by the server. The APPEND command will effectively
  268. associate a UID with the uploaded message that can be stored in the
  269. local cache for future reference. However, [IMAP4] doesn't describe
  270. a simple mechanism to discover the message UID by just performing the
  271. APPEND command. In order to discover the UID, the client can do one
  272. of the following:
  273. 1) Remove the uploaded message from cache. Then, use the mechanism
  274. described in 4.3 to fetch the information about the uploaded
  275. message as if it had been uploaded by some other client.
  276. 2) Try to fetch header information as described in 4.2.2 in order to
  277. find a message that corresponds to the uploaded message. One
  278. strategy for doing this is described in 4.2.2.
  279. Case 1 describes a not particularly smart client.
  280. C: A003 APPEND Drafts (\Seen $MDNSent) {310}
  281. S: + Ready for literal data
  282. C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
  283. C: From: Fred Foobar <foobar@blt.example.COM>
  284. C: Subject: afternoon meeting
  285. C: To: mooch@owatagu.siam.edu
  286. C: Message-Id: <B27397-0100000@blt.example.COM>
  287. C: MIME-Version: 1.0
  288. C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
  289. C:
  290. C: Hello Joe, do you think we can meet at 3:30 tomorrow?
  291. C:
  292. S: A003 OK APPEND Completed
  293. Fortunately, there is a simpler way to discover the message UID in
  294. the presence of the [UIDPLUS] extension:
  295. Melnikov Informational [Page 8]
  296. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  297. C: A003 APPEND Drafts (\Seen $MDNSent) {310}
  298. S: + Ready for literal data
  299. C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
  300. C: From: Fred Foobar <foobar@blt.example.COM>
  301. C: Subject: afternoon meeting
  302. C: To: mooch@owatagu.siam.edu
  303. C: Message-Id: <B27397-0100000@blt.example.COM>
  304. C: MIME-Version: 1.0
  305. C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
  306. C:
  307. C: Hello Joe, do you think we can meet at 3:30 tomorrow?
  308. C:
  309. S: A003 OK [APPENDUID 1022843275 77712] APPEND completed
  310. The UID of the appended message is the second parameter of APPENDUID
  311. response code.
  312. 4.2.2. Optimizing "move" and "copy" Operations
  313. Practical experience with IMAP and other mailbox access protocols
  314. that support multiple mailboxes suggests that moving a message from
  315. one mailbox to another is an extremely common operation.
  316. 4.2.2.1. Moving a Message between Two Mailboxes on the Same Server
  317. In IMAP4, a "move" operation between two mailboxes on the same server
  318. is really a combination of a COPY operation and a STORE +FLAGS
  319. (\Deleted) operation. This makes good protocol sense for IMAP, but
  320. it leaves a simple-minded disconnected client in the silly position
  321. of deleting and possibly expunging its cached copy of a message, then
  322. fetching an identical copy via the network.
  323. However, the presence of the UIDPLUS extension in the server can
  324. help:
  325. C: A001 UID COPY 567,414 "Interesting Messages"
  326. S: A001 OK [COPYUID 1022843275 414,567 5:6] Completed
  327. This tells the client that the message with UID 414 in the current
  328. mailbox was successfully copied to the mailbox "Interesting Messages"
  329. and was given the UID 5, and that the message with UID 567 was given
  330. the UID 6.
  331. In the absence of UIDPLUS extension support in the server, the
  332. following trick can be used. By including the Message-ID: header and
  333. the INTERNALDATE data item as part of the descriptor, the client can
  334. check the descriptor of a "new" message against messages that are
  335. already in its cache and avoid fetching the extra copy. Of course,
  336. Melnikov Informational [Page 9]
  337. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  338. it's possible that the cost of checking to see if the message is
  339. already in the local cache may exceed the cost of just fetching it,
  340. so this technique should not be used blindly. If the MUA implements
  341. a "move" command, it makes special provisions to use this technique
  342. when it knows that a copy/delete sequence is the result of a "move"
  343. command.
  344. Note that servers are not required (although they are strongly
  345. encouraged with "SHOULD language") to preserve INTERNALDATE when
  346. copying messages.
  347. Also note that since it's theoretically possible for this algorithm
  348. to find the wrong message (given sufficiently malignant Message-ID
  349. headers), implementers should provide a way to disable this
  350. optimization, both permanently and on a message-by-message basis.
  351. Example 1: Copying a message in the absence of UIDPLUS extension.
  352. At some point in time the client has fetched the source message and
  353. some information was cached:
  354. C: C021 UID FETCH <uids> (BODY.PEEK[] INTERNALDATE FLAGS)
  355. ...
  356. S: * 27 FETCH (UID 123 INTERNALDATE "31-May-2002 05:26:59 -0600"
  357. FLAGS (\Draft $MDNSent) BODY[] {1036}
  358. S: ...
  359. S: Message-Id: <20040903110856.22a127cd@chardonnay>
  360. S: ...
  361. S: ...message body...
  362. S: )
  363. ...
  364. S: C021 OK fetch completed
  365. Later on, the client decides to copy the message:
  366. C: C035 UID COPY 123 "Interesting Messages"
  367. S: C035 OK Completed
  368. As the server hasn't provided the COPYUID response code, the client
  369. tries the optimization described above:
  370. C: C036 SELECT "Interesting Messages"
  371. ...
  372. C: C037 UID SEARCH ON 31-May-2002 HEADER
  373. "Message-Id" "20040903110856.22a127cd@chardonnay"
  374. S: SEARCH 12368
  375. S: C037 OK completed
  376. Melnikov Informational [Page 10]
  377. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  378. Note that if the server has returned multiple UIDs in the SEARCH
  379. response, the client MUST NOT use any of the returned UID.
  380. 4.2.2.2. Moving a Message from a Remote Mailbox to a Local
  381. Moving a message from a remote mailbox to a local is done with FETCH
  382. (that includes FLAGS and INTERNALDATE) followed by UID STORE <uid>
  383. +FLAGS.SILENT (\Deleted):
  384. C: A003 UID FETCH 123 (BODY.PEEK[] INTERNALDATE FLAGS)
  385. S: * 27 FETCH (UID 123 INTERNALDATE "31-May-2002 05:26:59 -0600"
  386. FLAGS (\Seen $MDNSent) BODY[]
  387. S: ...message body...
  388. S: )
  389. S: A003 OK UID FETCH completed
  390. C: A004 UID STORE <uid> +FLAGS.SILENT (\Deleted)
  391. S: A004 STORE completed
  392. Note that there is no reason to fetch the message during
  393. synchronization if it's already in the client's cache. Also, the
  394. client SHOULD preserve delivery date in the local cache.
  395. 4.2.2.3. Moving a Message from a Local Mailbox to a Remote
  396. Moving a message from a local mailbox to a remote is done with
  397. APPEND:
  398. C: A003 APPEND Drafts (\Seen $MDNSent) "31-May-2002 05:26:59 -0600"
  399. {310}
  400. S: + Ready for literal data
  401. C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
  402. C: From: Fred Foobar <foobar@blt.example.COM>
  403. C: Subject: afternoon meeting
  404. C: To: mooch@owatagu.siam.edu
  405. C: Message-Id: <B27397-0100000@blt.example.COM>
  406. C: MIME-Version: 1.0
  407. C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
  408. C:
  409. C: Hello Joe, do you think we can meet at 3:30 tomorrow?
  410. C:
  411. S: A003 OK [APPENDUID 1022843275 77712] completed
  412. The client SHOULD specify the delivery date from the local cache in
  413. the APPEND.
  414. If the [LITERAL+] extension is available, the client can save a
  415. round-trip*:
  416. Melnikov Informational [Page 11]
  417. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  418. C: A003 APPEND Drafts (\Seen $MDNSent) "31-May-2002 05:26:59 -0600"
  419. {310+}
  420. C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
  421. C: From: Fred Foobar <foobar@blt.example.COM>
  422. C: Subject: afternoon meeting
  423. C: To: mooch@owatagu.siam.edu
  424. C: Message-Id: <B27397-0100000@blt.example.COM>
  425. C: MIME-Version: 1.0
  426. C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
  427. C:
  428. C: Hello Joe, do you think we can meet at 3:30 tomorrow?
  429. C:
  430. S: A003 OK [APPENDUID 1022843275 77712] completed
  431. * Note that there is a risk that the server will reject the message
  432. due to its size. If this happens, the client will waste bandwidth
  433. transferring the whole message. If the client wouldn't have used
  434. the LITERAL+, this could have been avoided:
  435. C: A003 APPEND Drafts (\Seen $MDNSent) "31-May-2004 05:26:59 -0600"
  436. {16777215}
  437. S: A003 NO Sorry, message is too big
  438. 4.2.2.4. Moving a Message between Two Mailboxes on Different Servers
  439. Moving a message between two mailbox on two different servers is a
  440. combination of the operations described in 4.2.2.2 followed by the
  441. operations described in 4.2.2.3.
  442. 4.2.2.5. Uploading Multiple Messages to a Remote Mailbox with
  443. MULTIAPPEND
  444. When there is a need to upload multiple messages to a remote mailbox
  445. (e.g., as per 4.2.2.3), the presence of certain IMAP extensions may
  446. significantly improve performance. One of them is [MULTIAPPEND].
  447. For some mail stores, opening a mailbox for appending might be
  448. expensive. [MULTIAPPEND] tells the server to open the mailbox once
  449. (instead of opening and closing it "n" times per "n" messages to be
  450. uploaded) and to keep it open while a group of messages is being
  451. uploaded to the server.
  452. Also, if the server supports both [MULTIAPPEND] and [LITERAL+]
  453. extensions, the entire upload is accomplished in a single
  454. command/response round-trip.
  455. Melnikov Informational [Page 12]
  456. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  457. Note: Client implementers should be aware that [MULTIAPPEND] performs
  458. append of multiple messages atomically. This means, for example, if
  459. there is not enough space to save "n"-th message (or the message has
  460. invalid structure and is rejected by the server) after successful
  461. upload of "n-1" messages, the whole upload operation fails, and no
  462. message will be saved in the mailbox. Although this behavior might
  463. be desirable in certain situations, it might not be what you want.
  464. Otherwise, the client should use the regular APPEND command (Section
  465. 4.2.2.3), possibly utilizing the [LITERAL+] extension. See also
  466. Section 5.1 for discussions about error recovery.
  467. Note: MULTIAPPEND can be used together with the UIDPLUS extension in
  468. a way similar to what was described in Section 4.2.1. [MULTIAPPEND]
  469. extends the syntax of the APPENDUID response code to allow for
  470. multiple message UIDs in the second parameter.
  471. Example 2:
  472. This example demonstrates the use of MULTIAPPEND together with
  473. UIDPLUS (synchronization points where the client waits for
  474. confirmations from the server are marked with "<--->"):
  475. C: A003 APPEND Jan-2002 (\Seen $MDNSent) "31-May-2002 05:26:59 -0600"
  476. {310}
  477. <--->
  478. S: + Ready for literal data
  479. C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
  480. C: From: Fred Foobar <foobar@blt.example.COM>
  481. C: Subject: afternoon meeting
  482. C: To: mooch@owatagu.siam.edu
  483. C: Message-Id: <B27397-0100000@blt.example.COM>
  484. C: MIME-Version: 1.0
  485. C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
  486. C:
  487. C: Hello Joe, do you think we can meet at 3:30 tomorrow?
  488. C: (\Seen) " 1-Jun-2002 22:43:04 -0800" {286}
  489. <--->
  490. S: + Ready for literal data
  491. C: Date: Mon, 7 Feb 1994 22:43:04 -0800 (PST)
  492. C: From: Joe Mooch <mooch@OWaTaGu.siam.EDU>
  493. C: Subject: Re: afternoon meeting
  494. C: To: foobar@blt.example.com
  495. C: Message-Id: <a0434793874930@OWaTaGu.siam.EDU>
  496. C: MIME-Version: 1.0
  497. C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
  498. C:
  499. C: 3:30 is fine with me.
  500. C:
  501. Melnikov Informational [Page 13]
  502. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  503. S: A003 OK [APPENDUID 1022843275 77712,77713] completed
  504. The upload takes 3 round-trips.
  505. Example 3:
  506. In this example, Example 2 was modified for the case when the server
  507. supports MULTIAPPEND, LITERAL+, and UIDPLUS. The upload takes only 1
  508. round-trip.
  509. C: A003 APPEND Jan-2002 (\Seen $MDNSent) "31-May-2002 05:26:59 -0600"
  510. {310+}
  511. C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
  512. C: From: Fred Foobar <foobar@blt.example.COM>
  513. C: Subject: afternoon meeting
  514. C: To: mooch@owatagu.siam.edu
  515. C: Message-Id: <B27397-0100000@blt.example.COM>
  516. C: MIME-Version: 1.0
  517. C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
  518. C:
  519. C: Hello Joe, do you think we can meet at 3:30 tomorrow?
  520. C: (\Seen) " 1-Jun-2002 22:43:04 -0800" {286+}
  521. C: Date: Mon, 7 Feb 1994 22:43:04 -0800 (PST)
  522. C: From: Joe Mooch <mooch@OWaTaGu.siam.EDU>
  523. C: Subject: Re: afternoon meeting
  524. C: To: foobar@blt.example.com
  525. C: Message-Id: <a0434793874930@OWaTaGu.siam.EDU>
  526. C: MIME-Version: 1.0
  527. C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
  528. C:
  529. C: 3:30 is fine with me.
  530. C:
  531. S: A003 OK [APPENDUID 1022843275 77712,77713] completed
  532. 4.2.3. Replaying Local Flag Changes
  533. The disconnected client uses the STORE command to synchronize local
  534. flag state with the server. The disconnected client SHOULD use
  535. +FLAGS.SILENT or -FLAGS.SILENT in order to set or unset flags
  536. modified by the user while offline. The FLAGS form MUST NOT be used,
  537. as there is a risk that this will overwrite flags on the server that
  538. have been changed by some other client.
  539. Example 4:
  540. For the message with UID 15, the disconnected client stores the
  541. following flags \Seen and $Highest. The flags were modified on the
  542. server by some other client: \Seen, \Answered, and $Highest. While
  543. Melnikov Informational [Page 14]
  544. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  545. offline, the user requested that the $Highest flags be removed and
  546. that the \Deleted flag be added. The flag synchronization sequence
  547. for the message should look like:
  548. C: A001 UID STORE 15 +FLAGS.SILENT (\Deleted)
  549. S: A001 STORE completed
  550. C: A002 UID STORE 15 -FLAGS.SILENT ($Highest)
  551. S: A002 STORE completed
  552. If the disconnected client is able to store an additional binary
  553. state information (or a piece of information that can take a value
  554. from a predefined set of values) in the local cache of an IMAP
  555. mailbox or in a local mailbox (e.g., message priority), and if the
  556. server supports storing of arbitrary keywords, the client MUST use
  557. keywords to store this state on the server.
  558. Example 5:
  559. Imagine a speculative mail client that can mark a message as one of
  560. work-related ($Work), personal ($Personal), or spam ($Spam). In
  561. order to mark a message as personal, the client issues:
  562. C: A001 UID STORE 15 +FLAGS.SILENT ($Personal)
  563. S: A001 STORE completed
  564. C: A002 UID STORE 15 -FLAGS.SILENT ($Work $Spam)
  565. S: A002 STORE completed
  566. In order to mark the message as not work, not personal and not spam,
  567. the client issues:
  568. C: A003 UID STORE 15 -FLAGS.SILENT ($Personal $Work $Spam)
  569. S: A003 STORE completed
  570. 4.2.4. Processing Mailbox Compression (EXPUNGE) Requests
  571. A naive disconnected client implementation that supports compressing
  572. a mailbox while offline may decide to issue an EXPUNGE command to the
  573. server in order to expunge messages marked \Deleted. The problem
  574. with this command during synchronization is that it permanently
  575. erases all messages with the \Deleted flag set, i.e., even those
  576. messages that were marked as \Deleted on the server while the user
  577. was offline. Doing this might result in an unpleasant surprise for
  578. the user.
  579. Fortunately the [UIDPLUS] extension can help in this case as well.
  580. The extension introduces UID EXPUNGE command, that, unlike EXPUNGE,
  581. takes a UID set parameter, that lists UIDs of all messages that can
  582. be expunged. When processing this command the server erases only
  583. Melnikov Informational [Page 15]
  584. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  585. messages with \Deleted flag listed in the UID list. Thus, messages
  586. not listed in the UID set will not be expunged even if they have the
  587. \Deleted flag set.
  588. Example 6:
  589. While the user was offline, 3 messages with UIDs 7, 27, and 65 were
  590. marked \Deleted when the user requested to compress the open mailbox.
  591. Another client marked a message \Deleted on the server (UID 34).
  592. During synchronization, the disconnected client issues:
  593. C: A001 UID EXPUNGE 7,27,65
  594. S: * ... EXPUNGE
  595. S: * ... EXPUNGE
  596. S: * ... EXPUNGE
  597. S: A001 UID EXPUNGE completed
  598. If another client issues UID SEARCH DELETED command (to find all
  599. messages with the \Deleted flag) before and after the UID EXPUNGE, it
  600. will get:
  601. Before:
  602. C: B001 UID SEARCH DELETED
  603. S: * SEARCH 65 34 27 7
  604. S: B001 UID SEARCH completed
  605. After:
  606. C: B002 UID SEARCH DELETED
  607. S: * SEARCH 34
  608. S: B002 UID SEARCH completed
  609. In the absence of the [UIDPLUS] extension, the following sequence of
  610. commands can be used as an approximation. Note: It's possible for
  611. another client to mark additional messages as deleted while this
  612. sequence is being performed. In this case, these additional messages
  613. will be expunged as well.
  614. 1) Find all messages marked \Deleted on the server.
  615. C: A001 UID SEARCH DELETED
  616. S: * SEARCH 65 34 27 7
  617. S: A001 UID SEARCH completed
  618. 2) Find all messages that must not be erased (for the previous
  619. example the list will consist of the message with UID 34).
  620. Melnikov Informational [Page 16]
  621. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  622. 3) Temporarily remove \Deleted flag on all messages found in step 2.
  623. C: A002 UID STORE 34 -FLAGS.SILENT (\Deleted)
  624. S: A002 UID STORE completed
  625. 4) Expunge the mailbox.
  626. C: A003 EXPUNGE
  627. S: * 20 EXPUNGE
  628. S: * 7 EXPUNGE
  629. S: * 1 EXPUNGE
  630. S: A003 EXPUNGE completed
  631. Here, the message with UID 7 has message number 1, with UID 27 has
  632. message number 7, and with UID 65 has message number 20.
  633. 5) Restore \Deleted flag on all messages found when performing step
  634. 2.
  635. C: A004 UID STORE 34 +FLAGS.SILENT (\Deleted)
  636. S: A004 UID STORE completed
  637. 4.2.5. Closing a Mailbox
  638. When the disconnected client has to close a mailbox, it should not
  639. use the CLOSE command, because CLOSE does a silent EXPUNGE. (Section
  640. 4.2.4 explains why EXPUNGE should not be used by a disconnected
  641. client.) It is safe to use CLOSE only if the mailbox was opened with
  642. EXAMINE.
  643. If the mailbox was opened with SELECT, the client can use one of the
  644. following commands to implicitly close the mailbox and prevent the
  645. silent expunge:
  646. 1) UNSELECT - This is a command described in [UNSELECT] that works as
  647. CLOSE, but doesn't cause the silent EXPUNGE. This command is
  648. supported by the server if it reports UNSELECT in its CAPABILITY
  649. list.
  650. 2) SELECT <another_mailbox> - SELECT causes implicit CLOSE without
  651. EXPUNGE.
  652. 3) If the client intends to issue LOGOUT after closing the mailbox,
  653. it may just issue LOGOUT, because LOGOUT causes implicit CLOSE
  654. without EXPUNGE as well.
  655. 4) SELECT <non_existing_mailbox> - If the client knows a mailbox that
  656. doesn't exist or can't be selected, it MAY SELECT it.
  657. Melnikov Informational [Page 17]
  658. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  659. If the client opened the mailbox with SELECT and just wants to avoid
  660. implicit EXPUNGE without closing the mailbox, it may also use the
  661. following:
  662. 5) EXAMINE <mailbox> - Reselect the same mailbox in read-only mode.
  663. 4.3. Details of "Normal" Synchronization of a Single Mailbox
  664. The most common form of synchronization is where the human trusts the
  665. integrity of the client's copy of the state of a particular mailbox
  666. and simply wants to bring the client's cache up to date so that it
  667. accurately reflects the mailbox's current state on the server.
  668. 4.3.1. Discovering New Messages and Changes to Old Messages
  669. Let <lastseenuid> represent the highest UID that the client knows
  670. about in this mailbox. Since UIDs are allocated in strictly
  671. ascending order, this is simply the UID of the last message in the
  672. mailbox that the client knows about. Let <lastseenuid+1> represent
  673. <lastseenuid>'s UID plus one. Let <descriptors> represent a list
  674. consisting of all the FETCH data item items that the implementation
  675. considers part of the descriptor; at a minimum this is just the FLAGS
  676. data item, but it usually also includes BODYSTRUCTURE and
  677. RFC822.SIZE. At this step, <descriptors> SHOULD NOT include RFC822.
  678. With no further information, the client can issue the following two
  679. commands:
  680. tag1 UID FETCH <lastseenuid+1>:* <descriptors>
  681. tag2 UID FETCH 1:<lastseenuid> FLAGS
  682. The first command will request some information about "new" messages
  683. (i.e., messages received by the server since the last
  684. synchronization). It will also allow the client to build a message
  685. number to UID map (only for new messages). The second command allows
  686. the client to
  687. 1) update cached flags for old messages;
  688. 2) find out which old messages got expunged; and
  689. 3) build a mapping between message numbers and UIDs (for old
  690. messages).
  691. The order here is significant. We want the server to start returning
  692. the list of new message descriptors as fast as it can, so that the
  693. client can start issuing more FETCH commands, so we start out by
  694. asking for the descriptors of all the messages we know the client
  695. Melnikov Informational [Page 18]
  696. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  697. cannot possibly have cached yet. The second command fetches the
  698. information we need to determine what changes may have occurred to
  699. messages that the client already has cached. Note that the former
  700. command should only be issued if the UIDNEXT value cached by the
  701. client differs from the one returned by the server. Once the client
  702. has issued these two commands, there's nothing more the client can do
  703. with this mailbox until the responses to the first command start
  704. arriving. A clever synchronization program might use this time to
  705. fetch its local cache state from disk or to start the process of
  706. synchronizing another mailbox.
  707. The following is an example of the first FETCH:
  708. C: A011 UID fetch 131:* (FLAGS BODYSTRUCTURE INTERNALDATE
  709. RFC822.SIZE)
  710. Note 1: The first FETCH may result in the server's sending a huge
  711. volume of data. A smart disconnected client should use message
  712. ranges (see also Section 3.2.1.2 of [RFC2683]), so that the user is
  713. able to execute a different operation between fetching information
  714. for a group of new messages.
  715. Example 7:
  716. Knowing the new UIDNEXT returned by the server on SELECT or EXAMINE
  717. (<uidnext>), the client can split the UID range
  718. <lastseenuid+1>:<uidnext> into groups, e.g., 100 messages. After
  719. that, the client can issue:
  720. C: A011 UID fetch <lastseenuid+1>:<lastseenuid+100>
  721. (FLAGS BODYSTRUCTURE INTERNALDATE RFC822.SIZE)
  722. ...
  723. C: A012 UID fetch <lastseenuid+101>:<lastseenuid+200>
  724. (FLAGS BODYSTRUCTURE INTERNALDATE RFC822.SIZE)
  725. ...
  726. ...
  727. C: A0FF UID fetch <lastseenuid+901>:<uidnext>
  728. (FLAGS BODYSTRUCTURE INTERNALDATE RFC822.SIZE)
  729. Note that unless a SEARCH command is issued, it is impossible to
  730. determine how many messages will fall into a subrange, as UIDs are
  731. not necessarily contiguous.
  732. Note 2: The client SHOULD ignore any unsolicited EXPUNGE responses
  733. received during the first FETCH command. EXPUNGE responses contain
  734. message numbers that are useless to a client that doesn't have the
  735. message-number-to-UID translation table.
  736. Melnikov Informational [Page 19]
  737. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  738. The second FETCH command will result in zero or more untagged fetch
  739. responses. Each response will have a corresponding UID FETCH data
  740. item. All messages that didn't have a matching untagged FETCH
  741. response MUST be removed from the local cache.
  742. For example, if the <lastseenuid> had a value 15000 and the local
  743. cache contained 3 messages with the UIDs 12, 777, and 14999,
  744. respectively, then after receiving the following responses from the
  745. server, the client must remove the message with UID 14999 from its
  746. local cache.
  747. S: * 1 FETCH (UID 12 FLAGS (\Seen))
  748. S: * 2 FETCH (UID 777 FLAGS (\Answered \Deleted))
  749. Note 3: If the client is not interested in flag changes (i.e., the
  750. client only wants to know which old messages are still on the
  751. server), the second FETCH command can be substituted with:
  752. tag2 UID SEARCH UID 1:<lastseenuid>
  753. This command will generate less traffic. However, an implementor
  754. should be aware that in order to build the mapping table from message
  755. numbers to UIDs, the output of the SEARCH command MUST be sorted
  756. first, because there is no requirement for a server to return UIDs in
  757. SEARCH response in any particular order.
  758. 4.3.2. Searching for "Interesting" Messages.
  759. This step is performed entirely on the client (from the information
  760. received in the step described in 4.3.1), entirely on the server, or
  761. on some combination of both. The decision on what is an
  762. "interesting" message is up to the client software and the human.
  763. One easy criterion that should probably be implemented in any client
  764. is whether the message is "too big" for automatic retrieval, where
  765. "too big" is a parameter defined in the client's configuration.
  766. Another commonly used criterion is the age of a message. For
  767. example, the client may choose to download only messages received in
  768. the last week (in this case, <date> would be today's date minus 7
  769. days):
  770. tag3 UID SEARCH UID <uidset> SINCE <date>
  771. Keep in mind that a date search disregards time and time zone. The
  772. client can avoid doing this search if it specified INTERNALDATE in
  773. <descriptors> on the step described in 4.3.1. If the client did, it
  774. can perform the local search on its message cache.
  775. Melnikov Informational [Page 20]
  776. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  777. At this step, the client also decides what kind of information about
  778. a particular message to fetch from the server. In particular, even
  779. for a message that is considered "too big", the client MAY choose to
  780. fetch some part(s) of it. For example, if the message is a
  781. multipart/mixed containing a text part and a MPEG attachment, there
  782. is no reason for the client not to fetch the text part. The decision
  783. of which part should or should not be fetched can be based on the
  784. information received in the BODYSTRUCTURE FETCH response data item
  785. (i.e., if BODYSTRUCTURE was included in <descriptors> on the step
  786. described in 4.3.1).
  787. 4.3.3. Populating Cache with "Interesting" Messages.
  788. Once the client has found out which messages are "interesting", it
  789. can start issuing appropriate FETCH commands for "interesting"
  790. messages or parts thereof.
  791. Note that fetching a message into the disconnected client's local
  792. cache does NOT imply that the human has (or even will) read the
  793. message. Thus, the synchronization program for a disconnected client
  794. should always be careful to use the .PEEK variants of the FETCH data
  795. items that implicitly set the \Seen flag.
  796. Once the last descriptor has arrived and the last FETCH command has
  797. been issued, the client simply needs to process the incoming fetch
  798. items and use them to update the local message cache.
  799. In order to avoid deadlock problems, the client must give processing
  800. of received messages priority over issuing new FETCH commands during
  801. this synchronization process. This may necessitate temporary local
  802. queuing of FETCH requests that cannot be issued without causing a
  803. deadlock. In order to achieve the best use of the "expensive"
  804. network connection, the client will almost certainly need to pay
  805. careful attention to any flow-control information that it can obtain
  806. from the underlying transport connection (usually a TCP connection).
  807. Note: The requirement stated in the previous paragraph might result
  808. in an unpleasant user experience, if followed blindly. For example,
  809. the user might be unwilling to wait for the client to finish
  810. synchronization before starting to process the user's requests. A
  811. smart disconnected client should allow the user to perform requested
  812. operations in between IMAP commands that are part of the
  813. synchronization process. See also Note 1 in Section 4.3.1.
  814. Melnikov Informational [Page 21]
  815. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  816. Example 8:
  817. After fetching a message BODYSTRUCTURE, the client discovers a
  818. complex MIME message. Then, it decides to fetch MIME headers of the
  819. nested MIME messages and some body parts.
  820. C: A011 UID fetch 11 (BODYSTRUCTURE)
  821. S: ...
  822. C: A012 UID fetch 11 (BODY[HEADER] BODY[1.MIME] BODY[1.1.MIME]
  823. BODY[1.2.MIME] BODY[2.MIME] BODY[3.MIME] BODY[4.MIME]
  824. BODY[5.MIME] BODY[6.MIME] BODY[7.MIME] BODY[8.MIME] BODY[9.MIME]
  825. BODY[10.MIME] BODY[11.MIME] BODY[12.MIME] BODY[13.MIME]
  826. BODY[14.MIME] BODY[15.MIME] BODY[16.MIME] BODY[17.MIME]
  827. BODY[18.MIME] BODY[19.MIME] BODY[20.MIME] BODY[21.MIME])
  828. S: ...
  829. C: A013 UID fetch 11 (BODY[1.1] BODY[1.2])
  830. S: ...
  831. C: A014 UID fetch 11 (BODY[3] BODY[4] BODY[5] BODY[6] BODY[7] BODY[8]
  832. BODY[9] BODY[10] BODY[11] BODY[13] BODY[14] BODY[15] BODY[16]
  833. BODY[21])
  834. S: ...
  835. 4.3.4. User-Initiated Synchronization
  836. After the client has finished the main synchronization process as
  837. described in Sections 4.3.1-4.3.3, the user may optionally request
  838. additional synchronization steps while the client is still online.
  839. This is not any different from the process described in Sections
  840. 4.3.2 and 4.3.3.
  841. Typical examples are:
  842. 1) fetch all messages selected in UI.
  843. 2) fetch all messages marked as \Flagged on the server.
  844. 4.4. Special Case: Descriptor-Only Synchronization
  845. For some mailboxes, fetching the descriptors might be the entire
  846. synchronization step. Practical experience with IMAP has shown that
  847. a certain class of mailboxes (e.g., "archival" mailboxes) are used
  848. primarily for long-term storage of important messages that the human
  849. wants to have instantly available on demand but does not want
  850. cluttering up the disconnected client's cache at any other time.
  851. Messages in this kind of mailbox would be fetched exclusively by
  852. explicit actions queued by the local MUA. Thus, the only
  853. synchronization desirable on this kind of mailbox is fetching enough
  854. descriptor information for the user to be able to identify messages
  855. for subsequent download.
  856. Melnikov Informational [Page 22]
  857. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  858. Special mailboxes that receive messages from a high volume, low
  859. priority mailing list might also be in this category, at least when
  860. the human is in a hurry.
  861. 4.5. Special Case: Fast New-Only Synchronization
  862. In some cases, the human might be in such a hurry that he or she
  863. doesn't care about changes to old messages, just about new messages.
  864. In this case, the client can skip the UID FETCH command that obtains
  865. the flags and UIDs for old messages (1:<lastseenuid>).
  866. 4.6. Special Case: Blind FETCH
  867. In some cases, the human may know (for whatever reason) that he or
  868. she always wants to fetch any new messages in a particular mailbox,
  869. unconditionally. In this case, the client can just fetch the
  870. messages themselves, rather than just the descriptors, by using a
  871. command like:
  872. tag1 UID FETCH <lastseenuid+1>:* (FLAGS BODY.PEEK[])
  873. Note that this example ignores the fact that the messages can be
  874. arbitrary long. The disconnected client MUST always check for
  875. message size before downloading, unless explicitly told otherwise. A
  876. well-behaved client should instead use something like the following:
  877. 1) Issue "tag1 UID FETCH <lastseenuid+1>:* (FLAGS RFC822.SIZE)".
  878. 2) From the message sizes returned in step 1, construct UID set
  879. <required_messages>.
  880. 3) Issue "tag2 UID FETCH <required_messages> (BODY.PEEK[])".
  881. or
  882. 1) Issue "tag1 UID FETCH <lastseenuid+1>:* (FLAGS)".
  883. 2) Construct UID set <old_uids> from the responses of step 1.
  884. 3) Issue "tag2 SEARCH UID <old_uids> SMALLER <message_limit>".
  885. Construct UID set <required_messages> from the result of the
  886. SEARCH command.
  887. 4) Issue "tag3 UID FETCH <required_messages> (BODY.PEEK[])".
  888. Melnikov Informational [Page 23]
  889. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  890. or
  891. 1) Issue "tag1 UID FETCH <lastseenuid+1>:* (FLAGS
  892. BODY.PEEK[]<0.<length>>)", where <length> should be replaced with
  893. the maximal message size the client is willing to download.
  894. Note: In response to such a command, the server will only return
  895. partial data if the message is longer than <length>. It will
  896. return the full message data for any message whose size is smaller
  897. than or equal to <length>. In the former case, the client will
  898. not be able to extract the full MIME structure of the message from
  899. the truncated data, so the client should include BODYSTRUCTURE in
  900. the UID FETCH command as well.
  901. 5. Implementation Considerations
  902. Below are listed some common implementation pitfalls that should be
  903. considered when implementing a disconnected client.
  904. 1) Implementing fake UIDs on the client.
  905. A message scheduled to be uploaded has no UID, as UIDs are
  906. selected by the server. The client may implement fake UIDs
  907. internally in order to reference not-yet-uploaded messages in
  908. further operations. (For example, a message could be scheduled to
  909. be uploaded, but subsequently marked as deleted or copied to
  910. another mailbox). Here, the client MUST NOT under any
  911. circumstances send these fake UIDs to the server. Also, client
  912. implementers should be reminded that according to [IMAP4] a UID is
  913. a 32-bit unsigned integer excluding 0. So, both 4294967295 and
  914. 2147483648 are valid UIDs, and 0 and -1 are both invalid. Some
  915. disconnected mail clients have been known to send negative numbers
  916. (e.g., "-1") as message UIDs to servers during synchronization.
  917. Situation 1: The user starts composing a new message, edits it,
  918. saves it, continues to edit it, and saves it again.
  919. A disconnected client may record in its replay log (log of
  920. operations to be replayed on the server during synchronization)
  921. the sequence of operations as shown below. For the purpose of
  922. this situation, we assume that all draft messages are stored in
  923. the mailbox called Drafts on an IMAP server. We will also use the
  924. following conventions: <old_uid> is the UID of the intermediate
  925. version of the draft when it was saved for the first time. This
  926. is a fake UID generated on the client. <new_uid> is the UID of
  927. the final version of the draft. This is another fake UID
  928. generated on the client.
  929. Melnikov Informational [Page 24]
  930. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  931. 1) APPEND Drafts (\Seen $MDNSent \Drafts) {<nnn>}
  932. ...first version of the message follows...
  933. 2) APPEND Drafts (\Seen $MDNSent \Drafts) {<mmm>}
  934. ...final version of the message follows...
  935. 3) STORE <old_uid> +FLAGS (\Deleted)
  936. Step 1 corresponds to the first attempt to save the draft message,
  937. step 2 corresponds to the second attempt to save the draft
  938. message, and step 3 deletes the first version of the draft message
  939. saved in step 1.
  940. A naive disconnected client may send the command in step 3 without
  941. replacing the fake client generated <old_uid> with the value
  942. returned by the server in step 1. A server will probably reject
  943. this command, which will make the client believe that the
  944. synchronization sequence has failed.
  945. 2) Section 5.1 discusses common implementation errors related to
  946. error recovery during playback.
  947. 3) Don't assume that the disconnected client is the only client used
  948. by the user.
  949. Situation 2: Some clients may use the \Deleted flag as an
  950. indicator that the message should not appear in the user's view.
  951. Usage of the \Deleted flag for this purpose is not safe, as other
  952. clients (e.g., online clients) might EXPUNGE the mailbox at any
  953. time.
  954. 4) Beware of data dependencies between synchronization operations.
  955. It might be very tempting for a client writer to perform some
  956. optimizations on the playback log. Such optimizations might
  957. include removing redundant operations (for example, see
  958. optimization 2 in Section 5.3), or their reordering.
  959. It is not always safe to reorder or remove redundant operations
  960. during synchronization because some operations may have
  961. dependencies (as Situation 3 demonstrates). So, if in doubt,
  962. don't do this.
  963. Situation 3: The user copies a message out of a mailbox and then
  964. deletes the mailbox.
  965. Melnikov Informational [Page 25]
  966. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  967. C: A001 SELECT Old-Mail
  968. S: ...
  969. C: A002 UID COPY 111 ToDo
  970. S: A002 OK [COPYUID 1022843345 111 94] Copy completed
  971. ...
  972. C: A015 CLOSE
  973. S: A015 OK Completed
  974. C: A016 DELETE Old-Mail
  975. S: A016 OK Mailbox deletion completed successfully
  976. If the client performs DELETE (tag A016) first and COPY (tag A002)
  977. second, then the COPY fails. Also, the message that the user so
  978. carefully copied into another mailbox has been lost.
  979. 5.1. Error Recovery during Playback
  980. Error recovery during synchronization is one of the trickiest parts
  981. to get right. Below, we will discuss certain error conditions and
  982. suggest possible choices for handling them.
  983. 1) Lost connection to the server.
  984. The client MUST remember the current position in the playback
  985. (replay) log and replay it starting from the interrupted operation
  986. (the last command issued by the client, but not acknowledged by
  987. the server) the next time it successfully connects to the same
  988. server. If the connection was lost while executing a non-
  989. idempotent IMAP command (see the definition in Section 1), then
  990. when the client is reconnected, it MUST make sure that the
  991. interrupted command was indeed not executed. If it wasn't
  992. executed, the client must restart playback from the interrupted
  993. command, otherwise from the following command.
  994. Upon reconnect, care must be taken in order to properly reapply
  995. logical operations that are represented by multiple IMAP commands,
  996. e.g., UID EXPUNGE emulation when UID EXPUNGE is not supported by
  997. the server (see Section 4.2.4).
  998. Once the client detects that the connection to the server was
  999. lost, it MUST stop replaying its log. There are existing
  1000. disconnected clients that, to the great annoyance of users, pop up
  1001. an error dialog for each and every playback operation that fails.
  1002. 2) Copying/appending messages to a mailbox that doesn't exist. (The
  1003. server advertises this condition by sending the TRYCREATE response
  1004. code in the tagged NO response to the APPEND or COPY command.)
  1005. Melnikov Informational [Page 26]
  1006. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  1007. The user should be advised about the situation and be given one of
  1008. the following choices:
  1009. a) Try to recreate a mailbox.
  1010. b) Copy/upload messages to another mailbox.
  1011. c) Skip copy/upload.
  1012. d) Abort replay.
  1013. 3) Copying messages from a mailbox that doesn't exist, or renaming or
  1014. getting/changing ACLs [ACL] on a mailbox that doesn't exist:
  1015. a) Skip operation.
  1016. b) Abort replay.
  1017. 4) Deleting mailboxes or deleting/expunging messages that no longer
  1018. exist.
  1019. This is actually is not an error and should be ignored by the
  1020. client.
  1021. 5) Performing operations on messages that no longer exist.
  1022. a) Skip operation.
  1023. b) Abort replay.
  1024. In the case of changing flags on an expunged message, the client
  1025. should silently ignore the error.
  1026. Note 1: Several synchronization operations map to multiple IMAP
  1027. commands (for example, "move" described in 4.2.2). The client must
  1028. guarantee atomicity of each such multistep operation. For example,
  1029. when performing a "move" between two mailboxes on the same server, if
  1030. the server is unable to copy messages, the client MUST NOT attempt to
  1031. set the \Deleted flag on the messages being copied, let alone expunge
  1032. them. However, the client MAY consider that move operation to have
  1033. succeeded even if the server was unable to set the \Deleted flag on
  1034. copied messages.
  1035. Note 2: Many synchronization operations have data dependencies. A
  1036. failed operation must cause all dependent operations to fail as well.
  1037. The client should check this and MUST NOT try to perform all
  1038. dependent operations blindly (unless the user corrected the original
  1039. problem). For example, a message may be scheduled to be appended to
  1040. a mailbox on the server and later on the appended message may be
  1041. copied to another mailbox. If the APPEND operation fails, the client
  1042. must not attempt to COPY the failed message later on. (See also
  1043. Section 5, Situation 3).
  1044. Melnikov Informational [Page 27]
  1045. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  1046. 5.2. Quality of Implementation Issues
  1047. Below, some quality of implementation issues are listed for
  1048. disconnected clients. They will help to write a disconnected client
  1049. that works correctly, performs synchronization as quickly as possible
  1050. (and thus can make the user happier as well as save her some money),
  1051. and minimizes the server load:
  1052. 1) Don't lose information.
  1053. No matter how smart your client is in other areas, if it loses
  1054. information, users will get very upset.
  1055. 2) Don't do work unless explicitly asked. Be flexible. Ask all
  1056. questions BEFORE starting synchronization, if possible.
  1057. 3) Minimize traffic.
  1058. The client MUST NOT issue a command if the client already received
  1059. the required information from the server.
  1060. The client MUST make use of UIDPLUS extension if it is supported
  1061. by the server.
  1062. See also optimization 1 in Section 5.3.
  1063. 4) Minimize the number of round-trips.
  1064. Round-trips kill performance, especially on links with high
  1065. latency. Sections 4.2.2.5 and 5.2 give some advice on how to
  1066. minimize the number of round-trips.
  1067. See also optimization 1 in Section 5.3.
  1068. 5.3. Optimizations
  1069. Some useful optimizations are described in this section. A
  1070. disconnected client that supports the recommendations listed below
  1071. will give the user a more pleasant experience.
  1072. 1) The initial OK or PREAUTH responses may contain the CAPABILITY
  1073. response code as described in Section 7.1 of [IMAP4]. This
  1074. response code gives the same information as returned by the
  1075. CAPABILITY command*. A disconnected client that pays attention to
  1076. this response code can avoid sending CAPABILITY command and will
  1077. save a round-trip.
  1078. Melnikov Informational [Page 28]
  1079. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  1080. * Note: Some servers report in the CAPABILITY response code
  1081. extensions that are only relevant in unauthenticated state or in
  1082. all states. Such servers usually send another CAPABILITY
  1083. response code upon successful authentication using LOGIN or
  1084. AUTHENTICATE command (that negotiates no security layer; see
  1085. Section 6.2.2 of [IMAP4]). The CAPABILITY response code sent
  1086. upon successful LOGIN/AUTHENTICATE might be different from the
  1087. CAPABILITY response code in the initial OK response, as
  1088. extensions only relevant for unauthenticated state will not be
  1089. advertised, and some additional extensions available only in
  1090. authenticated and/or selected state will be.
  1091. Example 9:
  1092. S: * OK [CAPABILITY IMAP4REV1 LOGIN-REFERRALS STARTTLS
  1093. AUTH=DIGEST-MD5 AUTH=SRP] imap.example.com ready
  1094. C: 2 authenticate DIGEST-MD5
  1095. S: 2 OK [CAPABILITY IMAP4REV1 IDLE NAMESPACE MAILBOX-REFERRALS SCAN
  1096. SORT THREAD=REFERENCES THREAD=ORDEREDSUBJECT MULTIAPPEND]
  1097. User authenticated (no layer)
  1098. 2) An advanced disconnected client may choose to optimize its replay
  1099. log. For example, there might be some operations that are
  1100. redundant (the list is not complete):
  1101. a) an EXPUNGE followed by another EXPUNGE or CLOSE;
  1102. b) changing flags (other than the \Deleted flag) on a message that
  1103. gets immediately expunged;
  1104. c) opening and closing the same mailbox.
  1105. When optimizing, be careful about data dependencies between commands.
  1106. For example, if the client is wishing to optimize (see case b, above)
  1107. tag1 UID STORE <uid1> +FLAGS (\Deleted)
  1108. ...
  1109. tag2 UID STORE <uid1> +FLAGS (\Flagged)
  1110. ...
  1111. tag3 UID COPY <uid1> "Backup"
  1112. ...
  1113. tag4 UID EXPUNGE <uid1>
  1114. it can't remove the second UID STORE command because the message is
  1115. being copied before it gets expunged.
  1116. In general, it might be a good idea to keep mailboxes open during
  1117. synchronization (see case c above), if possible. This can be more
  1118. easily achieved in conjunction with optimization 3 described below.
  1119. Melnikov Informational [Page 29]
  1120. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  1121. 3) Perform some synchronization steps in parallel, if possible.
  1122. Several synchronization steps don't depend on each other and thus
  1123. can be performed in parallel. Because the server machine is
  1124. usually more powerful than the client machine and can perform some
  1125. operations in parallel, this may speed up the total time of
  1126. synchronization.
  1127. In order to achieve such parallelization, the client will have to
  1128. open more than one connection to the same server. Client writers
  1129. should not forget about non-trivial cost associated with
  1130. establishing a TCP connection and performing an authentication.
  1131. The disconnected client MUST NOT use one connection per mailbox.
  1132. In most cases, it is sufficient to have two connections. The
  1133. disconnected client SHOULD avoid selecting the same mailbox in
  1134. more than one connection; see Section 3.1.1 of [RFC2683] for more
  1135. details.
  1136. Any mailbox synchronization MUST start with checking the
  1137. UIDVALIDITY as described in Section 4.1 of this document. The
  1138. client MAY use STATUS command to check UID Validity of a non-
  1139. selected mailbox. This is preferable to opening many connections
  1140. to the same server to perform synchronization of multiple
  1141. mailboxes simultaneously. As described in Section 5.3.10 of
  1142. [IMAP4], this SHOULD NOT be used on the selected mailbox.
  1143. 6. IMAP Extensions That May Help
  1144. The following extensions can save traffic and/or the number of
  1145. round-trips:
  1146. 1) The use of [UIDPLUS] is discussed in Sections 4.1, 4.2.1, 4.2.2.1
  1147. and 4.2.4.
  1148. 2) The use of the MULTIAPPEND and LITERAL+ extensions for uploading
  1149. messages is discussed in Section 4.2.2.5.
  1150. 3) Use the CONDSTORE extension (see Section 6.1) for quick flag
  1151. resynchronization.
  1152. 6.1. CONDSTORE Extension
  1153. An advanced disconnected mail client should use the [CONDSTORE]
  1154. extension when it is supported by the server. The client must cache
  1155. the value from HIGHESTMODSEQ OK response code received on mailbox
  1156. opening and update it whenever the server sends MODSEQ FETCH data
  1157. items.
  1158. Melnikov Informational [Page 30]
  1159. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  1160. If the client receives NOMODSEQ OK untagged response instead of
  1161. HIGHESTMODSEQ, it MUST remove the last known HIGHESTMODSEQ value from
  1162. its cache and follow the more general instructions in Section 3.
  1163. When the client opens the mailbox for synchronization, it first
  1164. compares UIDVALIDITY as described in step d-1 in Section 3. If the
  1165. cached UIDVALIDITY value matches the one returned by the server, the
  1166. client MUST compare the cached value of HIGHESTMODSEQ with the one
  1167. returned by the server. If the cached HIGHESTMODSEQ value also
  1168. matches the one returned by the server, then the client MUST NOT
  1169. fetch flags for cached messages, as they hasn't changed. If the
  1170. value on the server is higher than the cached one, the client MAY use
  1171. "SEARCH MODSEQ <cached-value>" to find all messages with flags
  1172. changed since the last time the client was online and had the mailbox
  1173. opened. Alternatively, the client MAY use "FETCH 1:* (FLAGS)
  1174. (CHANGEDSINCE <cached-value>)". The latter operation combines
  1175. searching for changed messages and fetching new information.
  1176. In all cases, the client still needs to fetch information about new
  1177. messages (if requested by the user) as well as discover which
  1178. messages have been expunged.
  1179. Step d ("Server-to-client synchronization") in Section 4 in the
  1180. presence of the CONDSTORE extension is amended as follows:
  1181. d) "Server-to-client synchronization" - For each mailbox that
  1182. requires synchronization, do the following:
  1183. 1a) Check the mailbox UIDVALIDITY (see section 4.1 for more
  1184. details) with SELECT/EXAMINE/STATUS.
  1185. If the UIDVALIDITY value returned by the server differs, the
  1186. client MUST
  1187. * empty the local cache of that mailbox;
  1188. * "forget" the cached HIGHESTMODSEQ value for the mailbox;
  1189. * remove any pending "actions" that refer to UIDs in that
  1190. mailbox (note that this doesn't affect actions performed on
  1191. client-generated fake UIDs; see Section 5); and
  1192. * skip steps 1b and 2-II;
  1193. 1b) Check the mailbox HIGHESTMODSEQ. If the cached value is the
  1194. same as the one returned by the server, skip fetching message
  1195. flags on step 2-II, i.e., the client only has to find out
  1196. which messages got expunged.
  1197. Melnikov Informational [Page 31]
  1198. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  1199. 2) Fetch the current "descriptors".
  1200. I) Discover new messages.
  1201. II) Discover changes to old messages and flags for new messages
  1202. using
  1203. "FETCH 1:* (FLAGS) (CHANGEDSINCE <cached-value>)" or
  1204. "SEARCH MODSEQ <cached-value>".
  1205. Discover expunged messages; for example, using
  1206. "UID SEARCH 1:<lastseenuid>". (All messages not returned
  1207. in this command are expunged.)
  1208. 3) Fetch the bodies of any "interesting" messages that the client
  1209. doesn't already have.
  1210. Example 10:
  1211. The UIDVALIDITY value is the same, but the HIGHESTMODSEQ value
  1212. has changed on the server while the client was offline.
  1213. C: A142 SELECT INBOX
  1214. S: * 172 EXISTS
  1215. S: * 1 RECENT
  1216. S: * OK [UNSEEN 12] Message 12 is first unseen
  1217. S: * OK [UIDVALIDITY 3857529045] UIDs valid
  1218. S: * OK [UIDNEXT 201] Predicted next UID
  1219. S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
  1220. S: * OK [PERMANENTFLAGS (\Deleted \Seen \*)] Limited
  1221. S: * OK [HIGHESTMODSEQ 20010715194045007]
  1222. S: A142 OK [READ-WRITE] SELECT completed
  1223. After that, either:
  1224. C: A143 UID FETCH 1:* (FLAGS) (CHANGEDSINCE 20010715194032001)
  1225. S: * 2 FETCH (UID 6 MODSEQ (20010715205008000) FLAGS (\Deleted))
  1226. S: * 5 FETCH (UID 9 MODSEQ (20010715195517000) FLAGS ($NoJunk
  1227. $AutoJunk $MDNSent))
  1228. ...
  1229. S: A143 OK FETCH completed
  1230. or:
  1231. Melnikov Informational [Page 32]
  1232. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  1233. C: A143 UID SEARCH MODSEQ 20010715194032001 UID 1:20
  1234. S: * SEARCH 6 9 11 12 18 19 20 23 (MODSEQ 20010917162500)
  1235. S: A143 OK Search complete
  1236. C: A144 UID SEARCH 1:20
  1237. S: * SEARCH 6 9 ...
  1238. S: A144 OK FETCH completed
  1239. 7. Security Considerations
  1240. It is believed that this document does not raise any new security
  1241. concerns that are not already present in the base [IMAP4] protocol,
  1242. and these issues are discussed in [IMAP4]. Additional security
  1243. considerations may be found in different extensions mentioned in this
  1244. document; in particular, in [UIDPLUS], [LITERAL+], [CONDSTORE],
  1245. [MULTIAPPEND], and [UNSELECT].
  1246. Implementers are also reminded about the importance of thorough
  1247. testing.
  1248. 8. References
  1249. 8.1. Normative References
  1250. [KEYWORDS] Bradner, S., "Key words for use in RFCs to Indicate
  1251. Requirement Levels", BCP 14, RFC 2119, March 1997.
  1252. [IMAP4] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL -
  1253. VERSION 4rev1", RFC 3501, March 2003.
  1254. [UIDPLUS] Crispin, M., "Internet Message Access Protocol (IMAP) -
  1255. UIDPLUS extension", RFC 4315, December 2005.
  1256. [LITERAL+] Myers, J., "IMAP4 non-synchronizing literals", RFC
  1257. 2088, January 1997.
  1258. [CONDSTORE] Melnikov, A. and S. Hole, "IMAP Extension for
  1259. Conditional STORE Operation or Quick Flag Changes
  1260. Resynchronization", RFC 4551, June 2006.
  1261. [MULTIAPPEND] Crispin, M., "Internet Message Access Protocol (IMAP) -
  1262. MULTIAPPEND Extension", RFC 3502, March 2003.
  1263. [UNSELECT] Melnikov, A., "Internet Message Access Protocol (IMAP)
  1264. UNSELECT command", RFC 3691, February 2004.
  1265. [RFC2683] Leiba, B., "IMAP4 Implementation Recommendations", RFC
  1266. 2683, September 1999.
  1267. Melnikov Informational [Page 33]
  1268. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  1269. 8.2. Informative References
  1270. [ACL] Melnikov, A., "IMAP4 Access Control List (ACL)
  1271. Extension", RFC 4314, December 2005.
  1272. [IMAP-MODEL] Crispin, M., "Distributed Electronic Mail Models in
  1273. IMAP4", RFC 1733, December 1994.
  1274. 9. Acknowledgements
  1275. This document is based on version 01 of the text written by Rob
  1276. Austein in November 1994.
  1277. The editor appreciates comments posted by Mark Crispin to the IMAP
  1278. mailing list and the comments/corrections/ideas received from Grant
  1279. Baillie, Cyrus Daboo, John G. Myers, Chris Newman, and Timo Sirainen.
  1280. The editor would also like to thank the developers of Netscape
  1281. Messenger and Mozilla mail clients for providing examples of
  1282. disconnected mail clients that served as a base for many
  1283. recommendations in this document.
  1284. Editor's Address
  1285. Alexey Melnikov
  1286. Isode Limited
  1287. 5 Castle Business Village
  1288. 36 Station Road
  1289. Hampton, Middlesex
  1290. TW12 2BX
  1291. United Kingdom
  1292. Phone: +44 77 53759732
  1293. EMail: alexey.melnikov@isode.com
  1294. Melnikov Informational [Page 34]
  1295. RFC 4549 Synch Ops for Disconnected IMAP4 Clients June 2006
  1296. Full Copyright Statement
  1297. Copyright (C) The Internet Society (2006).
  1298. This document is subject to the rights, licenses and restrictions
  1299. contained in BCP 78, and except as set forth therein, the authors
  1300. retain all their rights.
  1301. This document and the information contained herein are provided on an
  1302. "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
  1303. OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
  1304. ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
  1305. INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
  1306. INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
  1307. WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  1308. Intellectual Property
  1309. The IETF takes no position regarding the validity or scope of any
  1310. Intellectual Property Rights or other rights that might be claimed to
  1311. pertain to the implementation or use of the technology described in
  1312. this document or the extent to which any license under such rights
  1313. might or might not be available; nor does it represent that it has
  1314. made any independent effort to identify any such rights. Information
  1315. on the procedures with respect to rights in RFC documents can be
  1316. found in BCP 78 and BCP 79.
  1317. Copies of IPR disclosures made to the IETF Secretariat and any
  1318. assurances of licenses to be made available, or the result of an
  1319. attempt made to obtain a general license or permission for the use of
  1320. such proprietary rights by implementers or users of this
  1321. specification can be obtained from the IETF on-line IPR repository at
  1322. http://www.ietf.org/ipr.
  1323. The IETF invites any interested party to bring to its attention any
  1324. copyrights, patents or patent applications, or other proprietary
  1325. rights that may cover technology that may be required to implement
  1326. this standard. Please address the information to the IETF at
  1327. ietf-ipr@ietf.org.
  1328. Acknowledgement
  1329. Funding for the RFC Editor function is provided by the IETF
  1330. Administrative Support Activity (IASA).
  1331. Melnikov Informational [Page 35]