Skip to content

mbsync

mbsync 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; the operation set can be selected in a fine-grained manner.

Installation

apt-get install isync

Configuration

Assuming that you want to sync the mails of example@examplehost.com and that you have your password stored in pass under mail/example.

File: ~/.mbsyncrc

IMAPAccount example
Host examplehost.com
User "example@examplehost.com"
PassCmd "/usr/bin/pass mail/example"

IMAPStore example-remote
Account example
UseNamespace no

MaildirStore example-local
Path ~/mail/example/
Inbox ~/mail/example/Inbox

Channel example
Master :example-remote:
Slave :example-local:
Create Both
Patterns *
SyncState *
CopyArrivalDate yes
Sync Pull

You need to manually create the directories where you store the emails.

mkdir -p ~/mail/example

References