From 78104d802f238d2a666ce546947e60512484a31e Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 18 Apr 2017 23:18:28 -0400 Subject: [PATCH] shell/mu: update .offlineimaprc + lib.py --- shell/mu/.offlineimaprc | 10 ++++++---- shell/mu/lib.py | 15 +++++---------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/shell/mu/.offlineimaprc b/shell/mu/.offlineimaprc index 23c27cd0..ead9431e 100644 --- a/shell/mu/.offlineimaprc +++ b/shell/mu/.offlineimaprc @@ -11,10 +11,11 @@ fsync = False localrepository = LocalGmail remoterepository = RepositoryGmail postsynchook = mu index --maildir ~/.mail -status_backend = sqlite +synclabels = yes +labelsheader = X-Keywords [Repository LocalGmail] -type = Maildir +type = GmailMaildir localfolders = ~/.mail/gmail.com nametrans = nametrans @@ -34,10 +35,11 @@ nametrans = nametrans_reverse localrepository = LocalLissner remoterepository = RepositoryLissner postsynchook = mu index --maildir ~/.mail -status_backend = sqlite +synclabels = yes +labelsheader = X-Keywords [Repository LocalLissner] -type = Maildir +type = GmailMaildir localfolders = ~/.mail/lissner.net nametrans = nametrans diff --git a/shell/mu/lib.py b/shell/mu/lib.py index db8fcffb..55184d3f 100755 --- a/shell/mu/lib.py +++ b/shell/mu/lib.py @@ -2,7 +2,6 @@ from subprocess import check_output from re import sub -import sys def get_pass(account): data = check_output("/usr/bin/pass email/" + account, shell=True).splitlines() @@ -15,18 +14,14 @@ def get_pass(account): return {"password": password, "user": user} def folder_filter(name): - return not (name in ['[Gmail]/Spam', + return not (name in ['INBOX', + '[Gmail]/Spam', '[Gmail]/Important', - '[Gmail]/Starred', - '[Gmail]/All Mail'] or + '[Gmail]/Starred'] or name.startswith('[Airmail]')) def nametrans(name): - return sub('^INBOX/(Starred|Sent Mail|Drafts|Trash|All Mail|Spam)$', '[Gmail]/\\1', name) + return sub('^(Starred|Sent Mail|Drafts|Trash|All Mail|Spam)$', '[Gmail]/\\1', name) def nametrans_reverse(name): - return sub('^(\[Gmail\])', 'INBOX.', name) - - -if __name__ == '__main__': - print(get_pass(sys.argv[1].strip())['password']) + return sub('^(\[Gmail\]/)', '', name)