Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,16 @@ | |||
#!/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/tsharpe/Library/Keychains/login.keychain', | |||
} | |||
command = "sudo -u tsharpe %(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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,73 @@ | |||
[general] | |||
ui = ttyui | |||
accounts = Personal, GitHub | |||
pythonfile = ~/.mutt/offlineimap.py | |||
fsync = False | |||
maxsyncaccounts = 2 | |||
postsynchook = /opt/boxen/homebrew/bin/notmuch new | |||
|
|||
[Account Personal] | |||
localrepository = Personal-Local | |||
remoterepository = Personal-Remote | |||
status_backend = sqlite | |||
|
|||
[Account GitHub] | |||
localrepository = GitHub-Local | |||
remoterepository = GitHub-Remote | |||
status_backend = sqlite | |||
|
|||
[Repository Personal-Local] | |||
type = Maildir | |||
localfolders = ~/.mail/personal | |||
nametrans = lambda folder: {'drafts': '[Gmail]/Drafts', | |||
'sent': '[Gmail]/Sent Mail', | |||
'flagged': '[Gmail]/Starred', | |||
'trash': '[Gmail]/Trash', | |||
'archive': '[Gmail]/All Mail', | |||
}.get(folder, folder) | |||
|
|||
[Repository GitHub-Local] | |||
type = Maildir | |||
localfolders = ~/.mail/github | |||
nametrans = lambda folder: {'drafts': '[Gmail]/Drafts', | |||
'sent': '[Gmail]/Sent Mail', | |||
'flagged': '[Gmail]/Starred', | |||
'trash': '[Gmail]/Trash', | |||
'archive': '[Gmail]/All Mail', | |||
}.get(folder, folder) | |||
|
|||
[Repository Personal-Remote] | |||
maxconnections = 1 | |||
type = Gmail | |||
remoteuser = tim@sharpe.id.au | |||
remotepasseval = get_keychain_pass(account="tim@sharpe.id.au", server="imap.gmail.com") | |||
realdelete = no | |||
nametrans = lambda folder: {'[Gmail]/Drafts': 'drafts', | |||
'[Gmail]/Sent Mail': 'sent', | |||
'[Gmail]/Starred': 'flagged', | |||
'[Gmail]/Trash': 'trash', | |||
'[Gmail]/All Mail': 'archive', | |||
}.get(folder, folder) | |||
folderfilter = lambda folder: folder not in ['[Gmail]/Trash', | |||
'[Gmail]/Important', | |||
'[Gmail]/Spam', | |||
] | |||
cert_fingerprint = 6d1b5b5ee0180ab493b71d3b94534b5ab937d042 | |||
|
|||
[Repository GitHub-Remote] | |||
maxconnections = 1 | |||
type = Gmail | |||
remoteuser = tim@github.com | |||
remotepasseval = get_keychain_pass(account="tim@github.com", server="imap.gmail.com") | |||
realdelete = no | |||
nametrans = lambda folder: {'[Gmail]/Drafts': 'drafts', | |||
'[Gmail]/Sent Mail': 'sent', | |||
'[Gmail]/Starred': 'flagged', | |||
'[Gmail]/Trash': 'trash', | |||
'[Gmail]/All Mail': 'archive', | |||
}.get(folder, folder) | |||
folderfilter = lambda folder: folder not in ['[Gmail]/Trash', | |||
'[Gmail]/Important', | |||
'[Gmail]/Spam', | |||
] | |||
cert_fingerprint = 6d1b5b5ee0180ab493b71d3b94534b5ab937d042 |