diff options
Diffstat (limited to 'credentials')
-rwxr-xr-x | credentials/getmuttpass | 4 | ||||
-rwxr-xr-x | credentials/imappwd.py | 11 |
2 files changed, 15 insertions, 0 deletions
diff --git a/credentials/getmuttpass b/credentials/getmuttpass new file mode 100755 index 0000000..c5ee8c2 --- /dev/null +++ b/credentials/getmuttpass @@ -0,0 +1,4 @@ +#!/bin/bash +pass=$(gpg -d -q ~/.config/mutt/credentials/$1.gpg) +echo set smtp_pass=\"$pass\" +echo set imap_pass=\"$pass\" diff --git a/credentials/imappwd.py b/credentials/imappwd.py new file mode 100755 index 0000000..8570a5f --- /dev/null +++ b/credentials/imappwd.py @@ -0,0 +1,11 @@ +import os.path +import subprocess +home = os.path.expanduser("~") +def mailpasswd(acct): + acct = os.path.basename(acct) + path = "%s/.config/mutt/credentials/%s.gpg" % (home,acct) + args = ["gpg", "--use-agent", "--quiet", "--batch", "-d", path] + try: + return subprocess.check_output(args).strip() + except subprocess.CalledProcessError: + return "" |