Subject: Re: [sup-devel] Gmail source sync back.

From: Gaute Hope <[email-masked]>
Date: Mon, 29 Jul 2013 21:37:30 +0200

On 03. juli 2013 11:44, Horacio Sanson wrote:
> - How to refresh the index after polling finishes? When new labels are
> synced from Gmail to Sup the index is not updated with the new labels until
> I reload sup or press "@" to refresh the index. Is there a callback to
> refresh the index when the polling finishes?

Check out pull request #2 towards your github repo, yielding the message
on update + some other modifications now updates the message on my setup.

> - Sync back iterates over all messages in the Gmail account checking for
> differences between message labels. This can take a long time and may not
> finish before the next polling starts. How to do this efficiently?

If this turns out not be solvable (e.g. being able to get a list of
changed messages since a given date), an option could be to allow the
user to configure remote-to-local syncing to only be manual.
Local-to-remote you can store locally whether it has been synced or not.

There's also a pull request #1 which allows arbitrary domains to be
entered for the gmail source (for google apps setups).

Regards, Gaute

---

From: Gaute Hope <[email-masked]>
Date: Mon, 29 Jul 2013 21:48:14 +0200

> finish before the next polling starts. How to do this efficiently?

By the way, with the source poll locking recently added no second poll
should be able to be initiated when there is one running already.

- gaute

---

From: Matthieu Rakotojaona <[email-masked]>
Date: Thu, 04 Jul 2013 22:38:30 +0200

Hello,

Excerpts from Horacio Sanson's message of 2013-07-03 11:44:49 +0200:
> I finally got the sync back feature of the Gmail source working. 

Awesome, thank you! I've been using your gmail source branch with
success for a while now. There are still a few quirks with the Inbox
tag, but overall I'm really pleased with it. Will try your branch.

> Issues to solve:
> [...]

Ah, that sounds bad. Reading the always-helpful Stack Overflow [0] says
that there is nothing for this, unfortunately. There is a IMAP RFC
extension, 4551, that is supposed to help such situations, but it is not
implemented by Gmail, although there is a beta-test for this, if you're
interested :

http://mailman2.u.washington.edu/pipermail/imap-protocol/2013-January/001962.html

Another way could be to use the search extension specific to gmail [1].
I don't think you would gain much more than bandwidth, though.

[0] http://stackoverflow.com/questions/10076690/ruby-imap-changes-since-last-check
[1] https://developers.google.com/gmail/imap_extensions#extension_of_the_search_command_x-gm-raw

> regards,
> Horacio Sanson

-- 
Matthieu Rakotojaona
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Gaute Hope <[email-masked]>
Date: Mon, 29 Jul 2013 22:01:15 +0200

On 03. juli 2013 11:44, Horacio Sanson wrote:
> I finally got the sync back feature of the Gmail source working. The sync
> code uses the offlineimap sync algorithm the Matthieu mentioned some emails
> ago.

> Testing and feedback is greatly appreciated.

Further testing; if I check a message to be important after it has
already been added I get an IMAP Invalid label error: Important.

Regards, gaute

---

From: Gaute Hope <[email-masked]>
Date: Thu, 22 Aug 2013 14:35:28 +0200

Hi,

You should use the :update flag like the maildir-sync branch does for
messages that have changed, that way it is easier to determine whether
the UpdateManager should emit a signal (even if the message already exists).

Cheers, Gaute

---

From: Horacio Sanson <[email-masked]>
Date: Wed, 3 Jul 2013 18:44:49 +0900

So far it works ok with my small tests but this code should be considered
alpha so do not test it with your work emails.

https://github.com/hsanson/sup/tree/gmail_source

I also added some fixes and the config option provided by Matthieu.

Issues to solve:

- Sync back flags: Not sure if this is needed or how it may work. All
messages I get from Gmail have the \Seen flag no matter if I have seen or
not the message on Gmail web interface. The \Flagged flag can be changed
using the \Starred label instead. The only flag that I really need to care
about is the \Deleted flag.

regards,
Horacio Sanson