summaryrefslogtreecommitdiff
path: root/.offlineimap/offlineimap.py
blob: 7d2b481a38070a5db273511bc76f2540bbc67f40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env python

import os
import subprocess


def mailpasswd(acct):
    acct = os.path.basename(acct)
    path = "/home/urbain/.password-store/Mail/%s.gpg" % acct
    args = ["gpg2", "--use-agent", "--quiet", "--batch", "-d", path]
    try:
        return subprocess.check_output(args).strip()
    except subprocess.CalledProcessError:
        return ""