From cb200d81d694de06fe4a6b0eea164f8b8dfb7f14 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 28 Aug 2012 08:13:53 +0200 Subject: Improve skeleton offlineimap user config. --- offlineimap/offlineimap.py | 19 +++++++++++++++---- offlineimap/offlineimaprc.example | 24 ++++++++++++++---------- 2 files changed, 29 insertions(+), 14 deletions(-) (limited to 'offlineimap') 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 -- cgit v1.2.3