aboutsummaryrefslogtreecommitdiffstats
path: root/mbsync
diff options
context:
space:
mode:
authorGravatar Tom Willemse2016-08-05 01:43:09 +0200
committerGravatar Tom Willemse2016-08-05 01:43:09 +0200
commite87c292ab3de515970647d36963f508029e1951e (patch)
tree91d5e093fc05aecbe71ed86425d22e2d7fdb4514 /mbsync
parentdbc0aabdc1fe0faeff873a06a807279825173ed4 (diff)
downloadnew-dotfiles-e87c292ab3de515970647d36963f508029e1951e.tar.gz
new-dotfiles-e87c292ab3de515970647d36963f508029e1951e.zip
Add mbsync config
Diffstat (limited to 'mbsync')
-rw-r--r--mbsync/.mbsyncrc119
-rwxr-xr-xmbsync/usr/bin/get-mail-password15
-rwxr-xr-xmbsync/usr/bin/set-mail-password16
3 files changed, 150 insertions, 0 deletions
diff --git a/mbsync/.mbsyncrc b/mbsync/.mbsyncrc
new file mode 100644
index 0000000..4ff0c24
--- /dev/null
+++ b/mbsync/.mbsyncrc
@@ -0,0 +1,119 @@
+## Ryuslash:
+IMAPAccount ryuslash
+Host imap-ryuslash.alwaysdata.net
+User tom@ryuslash.org
+PassCmd "~/usr/bin/get-mail-password ryuslash"
+SSLType IMAPS
+CertificateFile /etc/ssl/certs/ca-certificates.crt
+
+IMAPStore ryuslash-remote
+Account ryuslash
+
+MaildirStore ryuslash-local
+Path ~/documents/mail/ryuslash/
+Inbox ~/documents/mail/ryuslash/inbox
+
+Channel ryuslash
+Master :ryuslash-remote:
+Slave :ryuslash-local:
+# Don't synchronize lda-dupes, it causes trouble.
+Patterns * !dovecot/lda-dupes
+Create Both
+SyncState *
+
+## Gmail:
+IMAPAccount gmail
+Host imap.gmail.com
+User ryuslash@gmail.com
+PassCmd "~/usr/bin/get-mail-password gmail"
+SSLType IMAPS
+CertificateFile /etc/ssl/certs/ca-certificates.crt
+
+IMAPStore gmail-remote
+Account gmail
+
+MaildirStore gmail-local
+Path ~/documents/mail/gmail
+Inbox ~/documents/mail/gmail/inbox
+
+# Synchronize only the gmail INBOX mailbox.
+Channel gmail-inbox
+Master :gmail-remote:
+Slave :gmail-local:
+Patterns INBOX
+# Automatically create missing mailboxes, both locally and on the
+# server.
+Create Both
+# Save the synchronization state files in the relevant directory.
+SyncState *
+
+# Synchronize only the gmail [Gmail]/Sent Mail inbox to sent.
+Channel gmail-sent
+Master :gmail-remote:"[Gmail]/Sent Mail"
+Slave :gmail-local:sent
+Create Both
+SyncState *
+
+# Group the INBOX and [Gmail]/Sent Mail mailboxes together so "mbsync
+# gmail" can be used to synchronize both.
+Group gmail
+Channel gmail-inbox
+Channel gmail-sent
+
+## Picturefix:
+IMAPAccount picturefix
+Host imap.gmail.com
+User tom@picturefix.nl
+PassCmd "~/usr/bin/get-mail-password picturefix"
+SSLType IMAPS
+CertificateFile /etc/ssl/certs/ca-certificates.crt
+
+IMAPStore picturefix-remote
+Account picturefix
+
+MaildirStore picturefix-local
+Path ~/documents/mail/picturefix
+Inbox ~/documents/mail/picturefix/inbox
+
+# Synchronize only the gmail INBOX mailbox.
+Channel picturefix-inbox
+Master :picturefix-remote:
+Slave :picturefix-local:
+Patterns INBOX
+Create Both
+SyncState *
+
+# Synchronize only the sent mailbox.
+Channel picturefix-sent
+Master :picturefix-remote:"[Gmail]/Verzonden berichten"
+Slave :picturefix-local:sent
+Create Both
+SyncState *
+
+# Group the picturefix channels together so that synching with the
+# command-line is easier.
+Group picturefix
+Channel picturefix-inbox
+Channel picturefix-sent
+
+## Ninthfloor:
+IMAPAccount ninthfloor
+Host mail.ninthfloor.org
+User ryuslash
+PassCmd "~/usr/bin/get-mail-password ninthfloor"
+SSLType STARTTLS
+CertificateFile /etc/ssl/certs/ca-certificates.crt
+
+IMAPStore ninthfloor-remote
+Account ninthfloor
+
+MaildirStore ninthfloor-local
+Path ~/documents/mail/ninthfloor/
+Inbox ~/documents/mail/ninthfloor/inbox
+
+Channel ninthfloor
+Master :ninthfloor-remote:
+Slave :ninthfloor-local:
+Patterns *
+Create Both
+SyncState *
diff --git a/mbsync/usr/bin/get-mail-password b/mbsync/usr/bin/get-mail-password
new file mode 100755
index 0000000..a26d9ce
--- /dev/null
+++ b/mbsync/usr/bin/get-mail-password
@@ -0,0 +1,15 @@
+#!/usr/bin/python2
+
+import gi
+
+gi.require_version('GnomeKeyring', '1.0')
+
+import logging
+
+logger = logging.getLogger('keyring')
+logger.addHandler(logging.StreamHandler())
+
+import keyring
+import sys
+
+print(keyring.get_password('offlineimap', sys.argv[1]))
diff --git a/mbsync/usr/bin/set-mail-password b/mbsync/usr/bin/set-mail-password
new file mode 100755
index 0000000..d92c863
--- /dev/null
+++ b/mbsync/usr/bin/set-mail-password
@@ -0,0 +1,16 @@
+#!/usr/bin/python2
+
+import gi
+
+gi.require_version('GnomeKeyring', '1.0')
+
+import logging
+
+logger = logging.getLogger('keyring')
+logger.addHandler(logging.StreamHandler())
+
+import keyring
+import sys
+import getpass
+
+keyring.set_password('offlineimap', sys.argv[1], getpass.getpass())