summaryrefslogtreecommitdiffstats
path: root/mutt/offlineimap.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--mutt/offlineimap.py5
-rw-r--r--mutt/offlineimap.py-bak17
2 files changed, 22 insertions, 0 deletions
diff --git a/mutt/offlineimap.py b/mutt/offlineimap.py
new file mode 100644
index 0000000..3bdc780
--- /dev/null
+++ b/mutt/offlineimap.py
@@ -0,0 +1,5 @@
+#!/usr/bin/env python2
+from subprocess import check_output
+
+def get_pass(account):
+ return check_output("pass Email/" + account, shell=True).rstrip()
diff --git a/mutt/offlineimap.py-bak b/mutt/offlineimap.py-bak
new file mode 100644
index 0000000..41fe18b
--- /dev/null
+++ b/mutt/offlineimap.py-bak
@@ -0,0 +1,17 @@
+#/usr/bin/python
+
+import re, subprocess
+def get_keychain_pass(account=None, server=None):
+ params = {
+ 'security': '/usr/bin/security',
+ 'command': 'find-internet-password',
+ 'account': account,
+ 'server': server,
+ 'keychain': '/Users/lemon/Library/Keychains/login.keychain',
+ }
+ command = "sudo -u lemon %(security)s -v %(command)s -g -a %(account)s -s %(server)s %(keychain)s" % params
+ output = subprocess.check_output(command, shell=True, stderr=subprocess.STDOUT)
+ outtext = [l for l in output.splitlines()
+ if l.startswith('password: ')][0]
+
+ return re.match(r'password: "(.*)"', outtext).group(1)