summaryrefslogtreecommitdiffstats
path: root/mutt/offlineimap.py-bak
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2023-05-03 20:15:56 +0100
committerMatthew Lemon <y@yulqen.org>2023-05-03 20:15:56 +0100
commit70d5f6d7a146cc8f8d6cc71703eb8b3f70245a62 (patch)
treecf6aef5f754096069fba3ded9a5e7eb7ce3422e8 /mutt/offlineimap.py-bak
parent21b2c998efa2fa99ba4015ff2ef100514e0142d6 (diff)
Adds neomutt and all the stuff to Debian
Diffstat (limited to 'mutt/offlineimap.py-bak')
-rw-r--r--mutt/offlineimap.py-bak17
1 files changed, 17 insertions, 0 deletions
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)