[PATCH] Syncing gmail labels for gmail accounts

Abdó Roig-Maranges abdo.roig at gmail.com
Wed Nov 28 14:58:09 GMT 2012


Hi,

> Another question about this patch: how easy it to change it to use
> X-Label rather than X-Keywords?
> (There are minor differences in format between them).

You can change X-Keywords to whatever you like in offlineimaprc, but it
would not change the format, a comma-separated list.

If you want something different, like space separated list, you will
have to change some code in folder/Gmail.py and folder/GmailMaildir.py.
Just grep for "', '.join" and "split(',')" :)

I chose comma separated, because I have labels with spaces, and wanted
to avoid a string escaping hell. I'm aware that right now things go
wrong if a label contains a comma, oh well...

I'm not sure what would be the right way to support X-Label. mutt does
not recognize X-Keywords? I'll think about it...

> I also noticed that one still gets empty subdirectories corresponding
> to the gmail tags in the Maildir with your patch. Is it intentional?

I'm not sure what you mean. I only get directories for the folders I
sync. I'm filtering the folders I want to sync with a line like

folderfilter = lambda foldername: foldername in ['[Gmail]/All Mail', '[Gmail]/Drafts', '[Gmail]/Trash']

on my offlineimaprc (I posted my offlineimaprc on a previous mail in
this thread)

Abdó.





More information about the OfflineIMAP-project mailing list