shell/mu: update .offlineimaprc + lib.py
This commit is contained in:
parent
30e7f6f9c9
commit
78104d802f
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue