Created
January 18, 2016 06:29
-
-
Save mturquette/60285865de706c5519fa to your computer and use it in GitHub Desktop.
OfflineIMAP nametrans and folderfilter example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Repository local-baylibre] | |
... | |
nametrans = lambda folder: { | |
'drafts': '[Gmail]/Drafts', | |
'flagged': '[Gmail]/Starred', | |
'important': '[Gmail]/Important', | |
'inbox': 'INBOX', | |
'spam': '[Gmail]/Spam', | |
'trash': '[Gmail]/Trash', | |
}.get(folder, folder) | |
[Repository remote-baylibre] | |
... | |
nametrans = lambda folder: re.sub('\[Gmail\]\/All Mail', 'archive', | |
re.sub('\[Gmail\]\/Drafts', 'drafts', | |
re.sub('\[Gmail\]\/Important', 'important', | |
re.sub('\[Gmail\]\/Sent Mail', 'sent', | |
re.sub('\[Gmail\]\/Spam', 'spam', | |
re.sub('\[Gmail\]\/Starred', 'flagged', | |
re.sub('\[Gmail\]\/Trash', 'trash', | |
re.sub('INBOX', 'inbox')))))))) | |
folderfilter = lambda folder: folder in ['[Gmail]/Drafts', | |
'[Gmail]/Important', | |
'[Gmail]/Starred', | |
'INBOX', | |
'needs-review'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment