mutt-wizard/bin/imappwd.py
2019-02-21 10:14:17 -05:00

12 lines
372 B
Python
Executable File

import os.path
import subprocess
home = os.path.expanduser("~")
def mailpasswd(acct):
acct = os.path.basename(acct)
path = "%s/.local/share/muttwizard/%s.gpg" % (home,acct)
args = ["gpg2", "--use-agent", "--quiet", "--batch", "-d", path]
try:
return subprocess.check_output(args).strip().decode('UTF-8')
except subprocess.CalledProcessError:
return ""