Hi Horacio, FWIW, you may use -- or even just take a look at -- the 'gmail' gem. It works pretty well for back syncing and is built on RFCs too (if I'm not mistaken). For maildir backsyncing, the 'maildir' gem also do the job, both are using the great 'mail' gem (which I hope, Heliotrope & co will use soon). Vivien. On Mon, May 23, 2011 at 10:42 AM, Horacio Sanson wrote: > Now that I have GMail to Heliotrope initial synchronization (first > time) and incremental (new messages) synchronization working in my > script I started working on Heliotrope to GMail synchronization. > Unfortunately I found some difficulties to achieve this. > > I am following rfc4549.txt and the client-to-server synchronization > says verbatim: > > c) "Client-to-server synchronization": for each IMAP "action" that > was pending on the client, do the following: > > 1) If the action implies opening a new mailbox (any operation that > operates on messages), open the mailbox. Check its UID > validity value (see Section 4.1 for more details) returned in > the UIDVALIDITY response code. If the UIDVALIDITY value > returned by the server differs, the client MUST empty the local > cache of the mailbox and remove any pending "actions" that > refer to UIDs in that mailbox (and consider them failed). Note > that this doesn't affect actions performed on client-generated > fake UIDs (see Section 5). > > 2) Perform the action. If the action is to delete a mailbox > (DELETE), make sure that the mailbox is closed first (see also > Section 3.4.12 of [RFC2683]). > > > Seems simple to do but Heliotrope currently does not store/provide > enough information to implement this like: > > 1) Account and Mailbox information of messages. > 2) Heliotrope msg_id to GMail UID map. > 3) Per mailbox action FIFO queues. > > > Each action performed via Heliotrope (add label, remove label, state > change, delete) should be stored in some kind of FIFO associated to > the an account/mailbox pair. For example adding a label to a message > in my personal account's inbox would add an action like: > > label_add