From 914a1bf4d895a986adaa240e857b95c7f49fed4c Mon Sep 17 00:00:00 2001 From: Luke Date: Fri, 9 Feb 2018 23:47:29 -0700 Subject: initial commit --- credentials/getmuttpass | 4 ++++ credentials/imappwd.py | 11 +++++++++++ 2 files changed, 15 insertions(+) create mode 100755 credentials/getmuttpass create mode 100755 credentials/imappwd.py (limited to 'credentials') 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 "" -- cgit v1.2.3