diff options
author | Matthew Lemon <chaffinach+git@protonmail.ch> | 2022-04-20 09:10:58 +0100 |
---|---|---|
committer | Matthew Lemon <chaffinach+git@protonmail.ch> | 2022-04-20 09:10:58 +0100 |
commit | ebaf821d8ac29fdf65a3deba327c6ecb16ced2c2 (patch) | |
tree | 62835c19b7a606185c4d26fe03b1e102c5999151 /mutt2022/offlineimap.py | |
parent | a7be781125b0b03f795e17475a4e3951334a616b (diff) |
added some mbsync and mutt config
Diffstat (limited to '')
-rw-r--r-- | mutt2022/offlineimap.py | 5 | ||||
-rw-r--r-- | mutt2022/offlineimap.py-bak | 17 |
2 files changed, 22 insertions, 0 deletions
diff --git a/mutt2022/offlineimap.py b/mutt2022/offlineimap.py new file mode 100644 index 0000000..3bdc780 --- /dev/null +++ b/mutt2022/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/mutt2022/offlineimap.py-bak b/mutt2022/offlineimap.py-bak new file mode 100644 index 0000000..41fe18b --- /dev/null +++ b/mutt2022/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) |