diff options
author | root <root@jellyfish> | 2012-08-28 08:13:53 +0200 |
---|---|---|
committer | root <root@jellyfish> | 2012-08-28 08:13:53 +0200 |
commit | cb200d81d694de06fe4a6b0eea164f8b8dfb7f14 (patch) | |
tree | ad2206cbda2ad8b3301e59e70bff32cac0e08ea9 | |
parent | 9476656f209150e3d687650e24ef210b14f0d953 (diff) |
Improve skeleton offlineimap user config.
-rw-r--r-- | offlineimap/offlineimap.py | 19 | ||||
-rw-r--r-- | offlineimap/offlineimaprc.example | 24 |
2 files changed, 29 insertions, 14 deletions
diff --git a/offlineimap/offlineimap.py b/offlineimap/offlineimap.py index 6171a65..623a4d9 100644 --- a/offlineimap/offlineimap.py +++ b/offlineimap/offlineimap.py @@ -1,5 +1,16 @@ -# Frequently used mailboxes (the rest is only sync'ed in *_all targets) -inboxes = ['INBOX', 'Drafts', 'Templates', 'Sent', 'Sendt post', 'done'] +import re -# mbox is INBOX showing up double on UW-imap servers... -imapnoise = ['mbox', 'spam', 'Junk', 'Trash'] +# Mailboxes to check often +main = re.compile('^(INBOX.*|Sent.*|Drafts.*|Templates)$') + +# Mailboxes to never check +noise = re.compile('^(Junk.*|Spam|spam|Trash|Deleted.*)$') + +def common( foldername ): + return (main.search(foldername) and not noise.search(foldername)) + +def uncommon( foldername ): + return (not main.search(foldername) and not noise.search(foldername)) + +def most( foldername ): + return (not noise.search(foldername)) diff --git a/offlineimap/offlineimaprc.example b/offlineimap/offlineimaprc.example index 0c5ed5e..9133516 100644 --- a/offlineimap/offlineimaprc.example +++ b/offlineimap/offlineimaprc.example @@ -3,19 +3,23 @@ accounts = Main pythonfile=/etc/local-COMMON/offlineimap/offlineimap.py [Account Main] -localrepository = Local -remoterepository = Remote +localrepository = Main-here +remoterepository = Main-there -[Repository Local] -type = Maildir -localfolders = ~/Maildir +#[Repository Main-here] +#type = Maildir +#localfolders = ~/Maildir +[Repository Main-here] +type = IMAP +preauthtunnel = /usr/lib/dovecot/imap 2>/dev/null +holdconnectionopen = yes -[Repository Remote] +[Repository Main-there] type = IMAP -preauthtunnel = ssh -C -q jonas@mail.jones.dk '/usr/local/bin/localimap' +preauthtunnel = ssh -C -q jonas@mail.jones.dk /usr/lib/dovecot/imap 2>/dev/null # Mimic dovecot Maildir setup: Add leading dot to all folders but INBOX -nametrans = lambda foldername: re.sub('^\.INBOX$', '.', '.' + foldername) +#nametrans = lambda foldername: re.sub('^\.INBOX$', '.', '.' + foldername) -# Avoid Trash, Junk and other non-important folders -folderfilter = lambda foldername: foldername not in imapnoise +# Ignore odd folders +folderfilter = most |