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

import os
import subprocess

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