# My credentials are encrypted with my GPG keys symmetrically. The login is done
# through SSL and the certificate file is located where openSUSE puts it. This
# configuration requires mbsync 1.3 (or current git master). I'm doing this
# because:
#   1. I need to increase the timeout for imap.novell.com
#   2. I need the improvements for subdirectories handling

##
# GMail

IMAPAccount gmail
Host imap.gmail.com
User mikisabate@gmail.com
PassCmd "gpg2 -q --for-your-eyes-only --no-tty -d ~/.mbsyncpassgmail.gpg"
SSLType IMAPS
AuthMechs Login
CertificateFile /etc/ssl/ca-bundle.pem

# Use the account specified above as the remote storage.
IMAPStore gmail-remote
Account gmail

# Let's use ~/.mail as the prefix for the local storage.
MaildirStore gmail-local
Path ~/.mail/gmail/
Inbox ~/.mail/gmail/inbox
SubFolders Verbatim

# We could have one only channel, and filter them through the Patterns
# directive. I prefer having multiple channels and then group them.

Channel gmail-inbox
Master :gmail-remote:
Slave :gmail-local:
Patterns "INBOX"
Create Both
Expunge Both
Sync All
SyncState *

Channel gmail-all
Master :gmail-remote:"[Gmail]/Tot el correu"
Slave :gmail-local:"All"
Create Both
Expunge Both
Sync All
SyncState *

Channel gmail-sent
Master :gmail-remote:"[Gmail]/Enviats"
Slave :gmail-local:"Sent"
Create Both
Expunge Both
Sync All
SyncState *

# And finally group everything here.

Group gmail
Channel gmail-inbox
Channel gmail-all
Channel gmail-sent

##
# suse.de

IMAPAccount desuse
Host imap.suse.de
User msabate@imapsusede
PassCmd "gpg2 -q --for-your-eyes-only --no-tty -d ~/.imapsusede.gpg"
SSLType IMAPS
AuthMechs Login
CertificateFile /etc/ssl/ca-bundle.pem

IMAPStore desuse-remote
Account desuse

MaildirStore desuse-local
Path ~/.mail/desuse/
Inbox ~/.mail/desuse/inbox
SubFolders Verbatim

Channel desuse
Master :desuse-remote:
Slave :desuse-local:
Patterns *
Create Both
Sync All
Expunge Both
SyncState *

##
# suse.com

IMAPAccount comsuse
Host outlook.office365.com
User msabate@suse.com
PassCmd "~/bin/mutt_oauth2.py ~/.mail/comsuse/sessionfile"
SSLType IMAPS
AuthMechs XOAUTH2
CertificateFile /etc/ssl/ca-bundle.pem
Timeout 0

IMAPStore comsuse-remote
Account comsuse

MaildirStore comsuse-local
Path ~/.mail/comsuse/
Inbox ~/.mail/comsuse/inbox
SubFolders Verbatim

Channel comsuse
Master :comsuse-remote:
Slave :comsuse-local:
Patterns * !Calendar
Create Both
Sync All
Expunge Both
SyncState *

##
# ajuntament

IMAPAccount ajuntament
Host mail.diba.cat
User dibasp\\sabatesm
PassCmd "gpg2 -q --for-your-eyes-only --no-tty -d ~/.mbsyncpasssusede.gpg"
SSLType IMAPS
AuthMechs Login
CertificateFile /etc/ssl/ca-bundle.pem
Timeout 0

IMAPStore ajuntament-remote
Account ajuntament

MaildirStore ajuntament-local
Path ~/.mail/ajuntament/
Inbox ~/.mail/ajuntament/inbox
SubFolders Verbatim

Channel ajuntament
Master :ajuntament-remote:
Slave :ajuntament-local:
Patterns * !Calendar
Create Both
Sync All
Expunge Both
SyncState *

##
# cgtsuse.org

IMAPAccount sindicat
Host cgtsuse.org
User msabate@cgtsuse.org
PassCmd "gpg2 -q --for-your-eyes-only --no-tty -d ~/.mbsyncpasssusede.gpg"
SSLType IMAPS
AuthMechs Login
CertificateFile /etc/ssl/ca-bundle.pem
Timeout 0

IMAPStore sindicat-remote
Account sindicat

MaildirStore sindicat-local
Path ~/.mail/sindicat/
Inbox ~/.mail/sindicat/inbox
SubFolders Verbatim

Channel sindicat
Master :sindicat-remote:
Slave :sindicat-local:
Patterns * !Calendar
Create Both
Sync All
Expunge Both
SyncState *

##
# uoc.edu

IMAPAccount uoc
Host imap.gmail.com
User mssola@uoc.edu
PassCmd "gpg2 -q --for-your-eyes-only --no-tty -d ~/.mbsyncpassuoc.gpg"
SSLType IMAPS
AuthMechs Login
CertificateFile /etc/ssl/ca-bundle.pem

# Use the account specified above as the remote storage.
IMAPStore uoc-remote
Account uoc

# Let's use ~/.mail as the prefix for the local storage.
MaildirStore uoc-local
Path ~/.mail/uoc/
Inbox ~/.mail/uoc/inbox
SubFolders Verbatim

Channel uoc-inbox
Master :uoc-remote:
Slave :uoc-local:
Patterns "INBOX"
Create Both
Expunge Both
Sync All
SyncState *

Channel uoc-all
Master :uoc-remote:"[Gmail]/Tot el correu"
Slave :uoc-local:"All"
Create Both
Expunge Both
Sync All
SyncState *

Channel uoc-sent
Master :uoc-remote:"[Gmail]/Enviats"
Slave :uoc-local:"Sent"
Create Both
Expunge Both
Sync All
SyncState *

# And finally group everything here.

Group uoc
Channel uoc-inbox
Channel uoc-all
Channel uoc-sent
