Created by
Ossi Herrala
| The ~/.muttrc is simple:
set smtp_pass = `security find-internet-password -g -a <account> -s gmail.com -w`
|
| The ~/.offlineimaprc:
[Account Gmail]
localrepository = Gmail-local
remoterepository = Gmail-remote
autorefresh = 5
[Repository Gmail-local]
type = GmailMaildir
localfolders = ~/Mail/Gmail
[Repository Gmail-remote]
type = Gmail
idlefolders = [ 'INBOX' ]
remoteuser = <account>@gmail.com
remotepasseval = get_keychain_pass(account="<account>", server="gmail.com")
The ~/.offlineimap.py:
import subprocess
def get_keychain_pass(account=None, server=None):
command = [ '/usr/bin/security', 'find-internet-password', '-g', '-w',
'-a', account,
'-s', server ]
password = subprocess.check_output(command, stderr=subprocess.STDOUT)
return password.strip('\n')
|