From ArchWiki
Revision as of 18:07, 2 October 2012 by RunningDroid (Talk | contribs) (Undo revision 226559 by RunningDroid (talk))

Jump to: navigation, search

isync is a command line application which synchronizes mailboxes; currently Maildir and IMAP4 mailboxes are supported. New messages, message deletions and flag changes can be propagated both ways.

Synchronization is based on unique message identifiers (UIDs), so no identification conflicts can occur (as opposed to some other mail synchronizers). Synchronization state is kept in one local text file per mailbox pair; multiple replicas of a mailbox can be maintained.

Note: isync is the name of the project, mbsync is the name of the executable


isyncAUR can be installed from the AUR.


  • Fine-grained selection of synchronization operations to perform
  • Synchronizes single mailboxes or entire mailbox collections
  • Partial mirrors possible: keep only the latest messages locally
  • Trash functionality: backup messages before removing them
  • IMAP features:
    • Security: supports TLS/SSL via imaps: (port 993) and STARTTLS; CRAM-MD5 for authentication
    • Supports NAMESPACE for simplified configuration
    • Pipelining for maximum speed (currently only partially implemented)


The configuration file is mandatory; mbsync will not run without it.

example ~/.mbsyncrc:

IMAPAccount gmail
# Address to connect to
Pass ***************
# Use SSL
UseIMAPS yes
# the first two have to be manually retrieved, use:
# "openssl s_client -connect -showcerts 2>&1 < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sed -ne '1,/-END CERTIFICATE-/p' > ~/.mail/gmail.crt"
# and "$ openssl s_client -connect -showcerts 2>&1 < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | tac | sed -ne '1,/-BEGIN CERTIFICATE-/p' | tac > ~/.mail/google.crt"
CertificateFile ~/.mail/gmail.crt
CertificateFile ~/.mail/google.crt
# provided by ca-certificates
CertificateFile /usr/share/ca-certificates/mozilla/Equifax_Secure_CA.crt

IMAPStore gmail-remote
Account gmail

MaildirStore gmail-local
# The trailing "/" is important
Path ~/.mail/gmail/
Inbox ~/.mail/gmail/Inbox

Channel gmail
Master :gmail-remote:
Slave :gmail-local:
# Exclude everything under the internal [Gmail] folder, except the interesting folders
Patterns * ![Gmail]* “[Gmail]/Sent Mail” “[Gmail]/Starred” “[Gmail]/All Mail”
# include everything
#Patterns *
# Automatically create missing mailboxes, both locally and on the server
Create Both
# Save the synchronization state files in the relevant directory
SyncState *


First make any folders that were specified as Maildirs.

$ mkdir -p ~/.mail/gmail

Then to retrieve the mail for a specific channel run:

$ mbsync gmail

or to retrive the mail for all channels:

$ mbsync -a

External Links