mbsync

synchronizes IMAP mailboxes with local Maildir folders

TLDR

Sync all channels
$ mbsync -a
Sync specific channel
$ mbsync [channel]
Sync specific group
$ mbsync [group]
Verbose sync
$ mbsync -V [channel]
Dry run
$ mbsync -n [channel]
Create missing mailboxes
$ mbsync -C [channel]

SYNOPSIS

mbsync [options] channel|group...

DESCRIPTION

mbsync (part of isync) synchronizes IMAP mailboxes with local Maildir folders. It provides bidirectional sync with fine-grained control over what gets synchronized, supporting per-mailbox state tracking for reliable resumable transfers.mbsync is commonly used with mu, notmuch, or other local mail tools for offline email access.

PARAMETERS

-a, --all

Sync all channels.
-l, --list
List remote mailboxes.
-C, --create
Create missing mailboxes.
-n, --dry-run
Show what would happen.
-V, --verbose
Verbose output.
-D, --debug
Debug output.
-c file
Config file.

CONFIGURATION

$ # ~/.mbsyncrc
IMAPAccount gmail
Host imap.gmail.com
User [email protected]
PassCmd "gpg -q --decrypt ~/.gmail-pass.gpg"
SSLType IMAPS

IMAPStore gmail-remote
Account gmail

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

Channel gmail
Far :gmail-remote:
Near :gmail-local:
Patterns *
Create Both

INSTALL

sudo apt install isync
sudo dnf install isync
sudo pacman -S isync
sudo apk add isync
sudo zypper install isync
brew install isync
nix profile install nixpkgs#isync

CAVEATS

Config file required. Deleting on one side propagates. IMAP quota limits apply. Initial sync can be slow.

HISTORY

mbsync was developed by Oswald Buddenhagen as part of isync, a free IMAP4 sync implementation, providing reliable bidirectional synchronization.

SEE ALSO

offlineimap(1), mu(1), notmuch(1), mutt(1)