# 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 head). 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 /home/mssola/data/mail as the prefix for the local storage.
MaildirStore gmail-local
Path /home/mssola/data/mail/gmail/
Inbox /home/mssola/data/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
Far :gmail-remote:
Near :gmail-local:
Patterns "INBOX"
Create Both
Expunge Both
Sync All
SyncState *

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

Channel gmail-sent
Far :gmail-remote:"[Gmail]/Enviats"
Near :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.com

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

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

# Let's use /home/mssola/data/mail as the prefix for the local storage.
MaildirStore comsuse-local
Path /home/mssola/data/mail/comsuse/
Inbox /home/mssola/data/mail/comsuse/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 comsuse-inbox
Far :comsuse-remote:
Near :comsuse-local:
Patterns "INBOX"
Create Both
Expunge Both
Sync All
SyncState *

Channel comsuse-all
Far :comsuse-remote:"[Gmail]/Tot el correu"
Near :comsuse-local:"All"
Create Both
Expunge Both
Sync All
SyncState *

Channel comsuse-sent
Far :comsuse-remote:"[Gmail]/Enviats"
Near :comsuse-local:"Sent"
Create Both
Expunge Both
Sync All
SyncState *

# And finally group everything here.

Group comsuse
Channel comsuse-inbox
Channel comsuse-all
Channel comsuse-sent

##
# ajuntament: notice that in this case the mailbox is configured to 'Pull' only
# and that deletions are not propagated. This is done to workaround the
# shamefully-low capacity given on this service, in a way that I have to
# periodically *remove everything* on the server. This is hence manually backed
# up.

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 /home/mssola/data/mail/ajuntament/
Inbox /home/mssola/data/mail/ajuntament/inbox
SubFolders Verbatim

Channel ajuntament
Far :ajuntament-remote:
Near :ajuntament-local:
Patterns * !Calendar
Create None
Sync Pull New Flags
Expunge None
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 /home/mssola/data/mail/sindicat/
Inbox /home/mssola/data/mail/sindicat/inbox
SubFolders Verbatim

Channel sindicat
Far :sindicat-remote:
Near :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 /home/mssola/data/mail as the prefix for the local storage.
MaildirStore uoc-local
Path /home/mssola/data/mail/uoc/
Inbox /home/mssola/data/mail/uoc/inbox
SubFolders Verbatim

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

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

Channel uoc-sent
Far :uoc-remote:"[Gmail]/Enviats"
Near :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
