You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

imappwd.py 372 B

6 years ago
6 years ago
5 years ago
6 years ago
1234567891011
  1. import os.path
  2. import subprocess
  3. home = os.path.expanduser("~")
  4. def mailpasswd(acct):
  5. acct = os.path.basename(acct)
  6. path = "%s/.local/share/muttwizard/%s.gpg" % (home,acct)
  7. args = ["gpg2", "--use-agent", "--quiet", "--batch", "-d", path]
  8. try:
  9. return subprocess.check_output(args).strip().decode('UTF-8')
  10. except subprocess.CalledProcessError:
  11. return ""