More notmuch filter corrections. Cleaning up decrypting for offlineimap

master
Dustin Swan 11 years ago
parent 3c69b08ce5
commit fd42433b32

@ -10,6 +10,7 @@ notmuch tag +iocom +draft -- tag:new AND folder:iocom/INBOX.Drafts
notmuch tag +iocom +sent -- tag:new AND folder:iocom/INBOX.Sent
notmuch tag +iocom +spam -- tag:new AND folder:iocom/INBOX.Spam
notmuch tag +iocom +trash -- tag:new AND folder:iocom/INBOX.Trash
notmuch tag +iocom -- tag:new AND folder:iocom/INBOX.Archive
notmuch tag +iocom -inbox -- folder:iocom/INBOX.Archive AND tag:inbox
# Gmail
@ -18,6 +19,7 @@ notmuch tag +gmail +draft -- tag:new AND folder:gmail/drafts
notmuch tag +gmail +sent -- tag:new AND folder:gmail/sent
notmuch tag +gmail +spam -- tag:new AND folder:gmail/spam
notmuch tag +gmail +trash -- tag:new AND folder:gmail/trash
notmuch tag +gmail -- tag:new AND folder:gmail/archive
notmuch tag +gmail -inbox -- tag:inbox AND tag:gmail NOT folder:gmail/INBOX
# TODO gmail tags

@ -1,29 +1,11 @@
#import subprocess
import os
import gnupg
home = os.environ['HOME']
gpg = gnupg.GPG(gnupghome=home+"/.gnupg", use_agent=True)
def gmail_password():
path = os.environ['HOME'] + "/.gmail-password.gpg"
#args = ["gpg", "-d", path]
def decrypt_password(file):
path = home + "/" + file
f = open(path, 'rb')
decrypted = gpg.decrypt_file(f)
return decrypted.data.strip()
#try:
#return subprocess.check_output(args).rstrip()
#except subprocess.CalledProcessError:
#return "".strip()
def iocom_password():
path = os.environ['HOME'] + "/.iocom-password.gpg"
f = open(path, 'rb')
decrypted = gpg.decrypt_file(f)
return decrypted.data.strip()
#args = ["gpg", "-d", path]
#try:
#return subprocess.check_output(args).rstrip()
#except subprocess.CalledProcessError:
#return "".strip()

@ -16,7 +16,7 @@ localfolders = ~/.mail/iocom
type = IMAP
remotehost = secure.emailsrvr.com
remoteuser = dswan@insors.com
remotepasseval = iocom_password()
remotepasseval = decrypt_password(".iocom-password.gpg")
realdelete = no
@ -39,7 +39,7 @@ nametrans = lambda folder: re.sub('spam', '[Gmail].Spam',
[Repository GmailRemote]
type = Gmail
remoteuser = dustinswan@gmail.com
remotepasseval = gmail_password()
remotepasseval = decrypt_password(".gmail-password.gpg")
realdelete = no
sslcacertfile = /usr/local/opt/curl-ca-bundle/share/ca-bundle.crt
nametrans = lambda folder: re.sub('.*Spam$', 'spam',

Loading…
Cancel
Save