diff options
Diffstat (limited to 'credentials/imappwd.py')
-rwxr-xr-x | credentials/imappwd.py | 11 |
1 files changed, 11 insertions, 0 deletions
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 "" |