From e5b50746586ef6204d7cb237d7889972b47863e1 Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Sun, 19 Apr 2015 19:23:25 +0100 Subject: added encryption to offlineimap passwords --- offlineimap.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 offlineimap.py (limited to 'offlineimap.py') 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 "" -- cgit v1.2.3