Archive of RubyForge sup-devel mailing list
 help / color / mirror / Atom feed
* [sup-devel] Gmail source sync back.
@ 2013-07-03  9:44 Horacio Sanson
  2013-07-04 20:38 ` Matthieu Rakotojaona
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Horacio Sanson @ 2013-07-03  9:44 UTC (permalink / raw)
  To: Sup developer discussion


[-- Attachment #1.1: Type: text/plain, Size: 1285 bytes --]

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.

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.

Testing and feedback is greatly appreciated.

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.

- 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?

- 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?

regards,
Horacio Sanson

[-- Attachment #1.2: Type: text/html, Size: 1728 bytes --]

[-- Attachment #2: Type: text/plain, Size: 143 bytes --]

_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [sup-devel] Gmail source sync back.
  2013-07-03  9:44 [sup-devel] Gmail source sync back Horacio Sanson
@ 2013-07-04 20:38 ` Matthieu Rakotojaona
  2013-07-29 19:37 ` Gaute Hope
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Matthieu Rakotojaona @ 2013-07-04 20:38 UTC (permalink / raw)
  To: sup-devel


[-- Attachment #1.1: Type: text/plain, Size: 1396 bytes --]

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:
>
> [...]
> 
> - 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?

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

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 143 bytes --]

_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [sup-devel] Gmail source sync back.
  2013-07-03  9:44 [sup-devel] Gmail source sync back Horacio Sanson
  2013-07-04 20:38 ` Matthieu Rakotojaona
@ 2013-07-29 19:37 ` Gaute Hope
  2013-07-29 19:48 ` Gaute Hope
  2013-07-29 20:01 ` Gaute Hope
  3 siblings, 0 replies; 6+ messages in thread
From: Gaute Hope @ 2013-07-29 19:37 UTC (permalink / raw)
  To: Sup developer discussion; +Cc: Horacio Sanson

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [sup-devel] Gmail source sync back.
  2013-07-03  9:44 [sup-devel] Gmail source sync back Horacio Sanson
  2013-07-04 20:38 ` Matthieu Rakotojaona
  2013-07-29 19:37 ` Gaute Hope
@ 2013-07-29 19:48 ` Gaute Hope
  2013-07-29 20:01 ` Gaute Hope
  3 siblings, 0 replies; 6+ messages in thread
From: Gaute Hope @ 2013-07-29 19:48 UTC (permalink / raw)
  To: Sup developer discussion; +Cc: Horacio Sanson

On 03. juli 2013 11:44, Horacio Sanson wrote:
> - 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?

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [sup-devel] Gmail source sync back.
  2013-07-03  9:44 [sup-devel] Gmail source sync back Horacio Sanson
                   ` (2 preceding siblings ...)
  2013-07-29 19:48 ` Gaute Hope
@ 2013-07-29 20:01 ` Gaute Hope
  2013-08-22 12:35   ` Gaute Hope
  3 siblings, 1 reply; 6+ messages in thread
From: Gaute Hope @ 2013-07-29 20:01 UTC (permalink / raw)
  To: Sup developer discussion; +Cc: Horacio Sanson



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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [sup-devel] Gmail source sync back.
  2013-07-29 20:01 ` Gaute Hope
@ 2013-08-22 12:35   ` Gaute Hope
  0 siblings, 0 replies; 6+ messages in thread
From: Gaute Hope @ 2013-08-22 12:35 UTC (permalink / raw)
  To: Sup developer discussion; +Cc: Horacio Sanson

On 03. juli 2013 11:44, Horacio Sanson wrote:

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



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-08-22 12:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-03  9:44 [sup-devel] Gmail source sync back Horacio Sanson
2013-07-04 20:38 ` Matthieu Rakotojaona
2013-07-29 19:37 ` Gaute Hope
2013-07-29 19:48 ` Gaute Hope
2013-07-29 20:01 ` Gaute Hope
2013-08-22 12:35   ` Gaute Hope

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox