Gmail with nested labels

Alexander alex1452 at gmx.net
Thu Aug 4 20:08:45 BST 2011


I have "nested labels" in my Gmail account (e.g. "Receipts Travel" and 
"Receipts Work" under the label "Receipts")

Unfortunately they sync as the folders
Receipts
Receipts.Travel
Receipts.Work
in the Maildir directory.

Instead I would love to have real subfolders
Receipts
Receipts/Travel
Receipts/Work
Can anybody help me with the syntax for nametrans?

Below my .offlineimaprc

[general]
metadata = ~/.offlineimap
accounts = test
maxsyncaccounts = 1
ui = Noninteractive.Basic
socktimeout = 120

[Account test]
localrepository = LocalTest
remoterepository = GmailChuck

[Repository LocalTest]
type = Maildir
localfolders = ~/test/Maildir

[Repository GmailChuck]
holdconnectionopen = no
#sep = /
type = Gmail
remoteuser = xxx
remotepass = xxx
realdelete = yes
nametrans = lambda foldername: re.sub('^\[Google Mail\].','', 
re.sub('Spam','Junk-E-Mail', foldername))
folderfilter = lambda foldername: foldername not in ['[Google Mail]/All 
Mail','[Google Mail]/Starred','[Google Mail]/Important']





More information about the OfflineIMAP-project mailing list