[offlineimap] update config
authorAmin Bandali <me@aminb.org>
Sun, 22 Feb 2015 03:43:08 +0000 (22:43 -0500)
committerAmin Bandali <me@aminb.org>
Sun, 22 Feb 2015 03:43:08 +0000 (22:43 -0500)
offlineimap/.offlineimap.py
offlineimap/.offlineimaprc [new file with mode: 0644]

index 23ba11c..3b89349 100644 (file)
@@ -10,6 +10,15 @@ def mailpasswd(acct):
     except subprocess.CalledProcessError:
         return ""
 
+def mailuser(acct):
+    acct = os.path.basename(acct)
+    path = "/home/amin/.passwd/%s" % acct
+    args = ["cat", path]
+    try:
+        return subprocess.check_output(args).strip()
+    except subprocess.CalledProcessError:
+        return ""
+
 def prime_gpg_agent():
   ret = False
   i = 1
diff --git a/offlineimap/.offlineimaprc b/offlineimap/.offlineimaprc
new file mode 100644 (file)
index 0000000..60d9801
--- /dev/null
@@ -0,0 +1,42 @@
+[general]
+pythonfile = ~/.offlineimap.py
+accounts = Gmail, aminb
+maxsyncaccounts = 3
+
+[Account Gmail]
+localrepository = GmailL
+remoterepository = GmailR
+
+[Account aminb]
+localrepository = aminbL
+remoterepository = aminbR
+
+[Repository GmailL]
+type = Maildir
+localfolders = ~/Maildir/Gmail
+
+[Repository GmailR]
+type = IMAP
+remotehost = imap.gmail.com
+remoteusereval = mailuser("gmail")
+remotepasseval = mailpasswd("gmail")
+sslcacertfile = /etc/ssl/certs/ca-certificates.crt
+ssl = yes
+folderfilter = lambda foldername: foldername not in '[Gmail]/All Mail'
+maxconnections = 1
+realdelete = no
+
+[Repository aminbL]
+type = Maildir
+localfolders = ~/Maildir/aminb
+
+[Repository aminbR]
+type = IMAP
+remotehost = mail.aminb.org
+remoteusereval = mailuser("aminb")
+remotepasseval = mailpasswd("aminb")
+sslcacertfile = /etc/ssl/certs/ca-certificates.crt
+ssl = yes
+folderfilter = lambda foldername: foldername not in 'dovecot.sieve'
+maxconnections = 1
+realdelete = no