feature: IMAP-GMail

Nicolas Sebrecht nicolas.s-dev at laposte.net
Mon Apr 6 11:28:55 BST 2015


On Mon, Apr 06, 2015 at 12:31:51AM -0700, Janna Martl wrote:
> On Fri, Mar 27, 2015 at 02:38:02AM -0400, Janna Martl wrote:

> My previous attempt at this was very wrong. Try #2.
> 
> The one thing that's still not done with this is the unceremoniously
> commented out bit about mtimes.
> 
> def syncmessagesto_labels(self, dstfolder, statusfolder):
> <...>	
>    for i, uid in enumerate(uidlist):
>    <...>
> #       mtime = dstfolder.getmessagemtime(uid)
> #       mtimes[uid] = mtime
>        labels[uid] = selflabels
> 
> #            statusfolder.savemessagesmtimebulk(mtimes)
> 
> If dstfolder is another IMAP folder, then getmessagemtime isn't
> implemented, so this throws an error. What should this be, if anything?

mtimes was introduced by Abdó in 0e4afa913253c43409e6. By chance, Abdó
is still there and active (cc'ed). ,-)

The purpose of mtimes is to quickly detect labels changes and propagate
them back to Gmail.

You aim to support (3) and (4).

        local              remote         mtimes
---------------------------------------------------------------
1.   GmailMaildir          Gmail          yes
2.   GmailMaildir          IMAP           invalid configuration
3.     IMAP                Gmail          ignored
4.     Gmail               Gmail          no


If the local is IMAP (3), mtimes don't make sense. it should not be
computed.

If the local is Gmail (4), mtimes still don't make sense but labels
changes should be propagated. Though, I have no idea how label changes
are handled on Gmail (do they get a new UID?). I'm afraid there's no
simple way to cleanly support it.


I think both (3) and (4) would worth the trouble. Each can be
implemented in different patches. So, if (4) is not trivial, just
postpone or ignore it for now.

Since we are late in rc, I can merge (3) if it is marked experimental
stuff.  Notice that once the v6.5.7 stable will be out, I intend to make
a deep refactoring and ignore any feature request until v6.6.0 will be
out.

> Add MappedGmailFolder class extending MappedIMAPFolder and Gmail to
> allow Gmail to be used as the local folder in an IMAP-IMAP sync.
> ---
>  offlineimap/folder/Gmail.py        | 45 +++++++++++++++++++++++++++++++++-----
>  offlineimap/folder/UIDMaps.py      |  3 ++-
>  offlineimap/repository/Gmail.py    |  5 +++++
>  offlineimap/repository/__init__.py |  3 ++-
>  4 files changed, 49 insertions(+), 7 deletions(-)

I didn't review this much. I would ask Abdó to work with you on this if
he agrees.

-- 
Nicolas Sebrecht




More information about the OfflineIMAP-project mailing list