From 2c86319c016519e3f4d0a3b5e176e5e4fbc8c64e Mon Sep 17 00:00:00 2001 From: maudin Date: Thu, 18 Sep 2014 00:47:20 +0200 Subject: [PATCH] fix gpg on debian, aliases trailing ..., improve mailboxes.py --- aliases | 1 - gpg.conf | 4 ++-- mailboxes.py | 21 +++++++++++++++------ 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/aliases b/aliases index 5d81501..2eee468 100644 --- a/aliases +++ b/aliases @@ -1,3 +1,2 @@ alias NICKNAME1 LASTNAME1 FIRSTNAME1 alias NICKNAME2 LASTNAME2 FIRSTNAME2 -... diff --git a/gpg.conf b/gpg.conf index 148a105..faf2ed0 100644 --- a/gpg.conf +++ b/gpg.conf @@ -4,8 +4,8 @@ set pgp_verify_command = "gpg --no-verbose --batch --output - --verify %s %f" set pgp_decrypt_command = "gpg --passphrase-fd 0 --no-verbose --batch --output - %f" set pgp_sign_command = "gpg --no-verbose --batch --output - --passphrase-fd 0 --armor --detach-sign --textmode %?a?-u %a? %f" set pgp_clearsign_command = "gpg --no-verbose --batch --output - --passphrase-fd 0 --armor --textmode --clearsign %?a?-u %a? %f" -set pgp_encrypt_only_command = "pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust --encrypt-to #MYKEY -- -r %r -- %f" -set pgp_encrypt_sign_command = "pgpewrap gpg --passphrase-fd 0 --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust --encrypt-to $pgp_sign_as -- -r %r -- %f" +set pgp_encrypt_only_command = "/usr/lib/mutt/pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust --encrypt-to #MYKEY -- -r %r -- %f" +set pgp_encrypt_sign_command = "/usr/lib/mutt/pgpewrap gpg --passphrase-fd 0 --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust --encrypt-to $pgp_sign_as -- -r %r -- %f" set pgp_import_command = "gpg --no-verbose --import -v %f" set pgp_export_command = "gpg --no-verbose --export --armor %r" set pgp_verify_key_command = "gpg --no-verbose --batch --fingerprint --check-sigs %r" diff --git a/mailboxes.py b/mailboxes.py index c182f14..f6abd4b 100755 --- a/mailboxes.py +++ b/mailboxes.py @@ -1,17 +1,23 @@ #! /usr/bin/env python import os +import sys mail_location = os.path.expanduser("~/Mail/") +types = { + # dictionary: "mail -> list of directories" + # relative paths from mail_location +} filters = [ - # Directory not list in mutt - # relative paths from 'mail_location' - ] + # mailboxes to hide, relative paths from mail_location +] -def get_addresses(): - return sorted(os.listdir(mail_location)) +def get_addresses(instance): + if not instance: + return sorted(os.listdir(mail_location)) + return sorted(list(set(os.listdir(mail_location)) & set(types[instance]))) def get_maildirs(addresses): @@ -31,4 +37,7 @@ def format(maildirs): if __name__ == "__main__": - print format(get_maildirs(get_addresses())) + inst = None + if len(sys.argv) > 1: + inst = sys.argv[1] + print format(get_maildirs(get_addresses(inst)))