summaryrefslogtreecommitdiff
path: root/offlineimap.py
diff options
context:
space:
mode:
Diffstat (limited to 'offlineimap.py')
-rw-r--r--offlineimap.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/offlineimap.py b/offlineimap.py
new file mode 100644
index 0000000..c63b82d
--- /dev/null
+++ b/offlineimap.py
@@ -0,0 +1,12 @@
+#!/usr/bin/env python
+
+import os
+import subprocess
+def mailpasswd(acct):
+ acct = os.path.basename(acct)
+ path = "/home/urbain/.passwords/%s.asc" % acct
+ args = ["gpg", "--use-agent", "--quiet", "--batch", "-d", path]
+ try:
+ return subprocess.check_output(args).strip()
+ except subprocess.CalledProcessError:
+ return ""