Permalink
Browse files

offlineimap config

  • Loading branch information...
1 parent 9949fd3 commit 3be8a6e4b4bbaddd400a55614a2b7c5526e6db28 @rodjek committed Oct 17, 2012
Showing with 89 additions and 0 deletions.
  1. 0 .mail/.placeholder
  2. +16 −0 .mutt/offlineimap.py
  3. +73 −0 .offlineimaprc
View
No changes.
View
@@ -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)
View
@@ -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

0 comments on commit 3be8a6e

Please sign in to comment.