summaryrefslogtreecommitdiff
path: root/bin/imappwd.py
blob: 9b25fcc622d48a3111684f592c9b157d4c8fa9bc (plain)
1
2
3
4
5
6
7
8
9
10
11
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 ""