Terminal Email

isync

CLIMail tool

Command line program (mbsync) that syncs IMAP mailboxes with local Maildir folders in both directions.

isync is the project name; the program is called mbsync. It keeps a local Maildir copy of IMAP folders and propagates new messages, deletions and flag changes both ways, using one state file per mailbox pair. It is a common companion to Maildir-based clients such as NeoMutt, aerc, mu4e and notmuch. Sending mail is out of scope; pair it with an SMTP tool such as msmtp.

Type
Mail tool
Interface
Command-line tools and prompts
Systems
Runs on Linux, macOS and BSD, on Windows through WSL, on Android through Termux.
Language
C
License
GPL 2.0 or later
Latest version
1.5.1
Maintained
Yes
Website
isync.sourceforge.io
Source
sourceforge.net/p/isync/isync
Documentation
isync.sourceforge.io

Install

SystemSupportInstall
LinuxNative
aptsudo apt install isync
dnfsudo dnf install isync
pacmansudo pacman -S isync
apksudo apk add isync
macOSNative
Homebrewbrew install isync
MacPortssudo port install isync
WindowsThrough WSL
WSLsudo apt install isync

No native Windows build; use WSL.

BSDNative
FreeBSD pkgpkg install isync
OpenBSDpkg_add isync
AndroidThrough Termux
Termuxpkg install isync

Protocols and features

Protocols
Protocolisync
IMAPYes
POP3No
SMTPNo
JMAPNo
MaildirYes
mboxNo
notmuchNo
Features
Featureisync
OpenPGPNo
S/MIMENo
OAuth2 sign-invia a Cyrus SASL XOAUTH2 plugin and PassCmd
ThreadsNo
SearchNo
HTML mailNo
MouseNo
Multiple accountsYes
Offline usekeeps a full local Maildir copy
CalendarNo
ContactsNo
Vim-style keysNo
Configuration~/.mbsyncrc or ~/.config/isyncrc text file

Pros and cons

Pros

  • Two-way sync of messages, deletions and flags between IMAP and Maildir
  • PassCmd reads the password from any command, such as pass or gpg
  • Packaged for nearly every Linux distribution, macOS, the BSDs and Termux

Cons

  • Version 1.5 renamed options (SSLType to TLSType), so older guides need edits
  • Only IMAP and Maildir; no POP3 and no sending
  • No built-in daemon or IDLE watch; runs from cron, a timer or the mail client

Use isync with Forward Email

How isync fits with a Forward Email mailbox. Replace you@example.com with your alias and the password command with your own. The same settings work with any provider once the server names change.

~/.mbsyncrc
# Sync a Forward Email mailbox to ~/Mail/forwardemail (run: mkdir -p ~/Mail/forwardemail)
# TLSType needs isync 1.5 or newer; on 1.4 write "SSLType IMAPS" instead.
IMAPAccount forwardemail
Host imap.forwardemail.net
Port 993
User you@example.com
PassCmd "pass show forwardemail/you@example.com"
TLSType IMAPS

IMAPStore forwardemail-remote
Account forwardemail

MaildirStore forwardemail-local
SubFolders Verbatim
Path ~/Mail/forwardemail/
Inbox ~/Mail/forwardemail/INBOX

Channel forwardemail
Far :forwardemail-remote:
Near :forwardemail-local:
Patterns *
Create Both
Expunge Both
SyncState *

# Then run: mbsync forwardemail
ProtocolServerPortSecurity
IMAPimap.forwardemail.net993SSL/TLS
POP3pop3.forwardemail.net995SSL/TLS
SMTPsmtp.forwardemail.net465SSL/TLS
SMTPsmtp.forwardemail.net587STARTTLS

Username: your full alias address, such as you@example.com. Password: the one shown by Generate Password next to the alias in your Forward Email account. Folders: INBOX, Drafts, Sent Mail, Trash, Spam and Archive.

Prefer no config at all? Forward Email's terminal app signs in with your account and has mail, calendar and contacts in one program.

Questions

Does isync work on Windows?

Not natively. It runs in Windows Subsystem for Linux (WSL). No native Windows build; use WSL.

Does isync support IMAP?

Yes, isync connects to IMAP servers directly.

Is isync open source?

Yes, under the GPL 2.0 or later.

How do I use isync with Forward Email?

Use the config in the Forward Email section on this page, saved as ~/.mbsyncrc, and replace the address and password with your own.

Sources