Terminal Email

mu4e

EmacsEmail client

Email client that runs inside GNU Emacs, built on the mu Maildir indexer and search tool.

mu4e reads mail from a local Maildir that mu indexes with Xapian, and its views are search queries rather than folders. Mail is fetched by a separate program such as mbsync (isync), and sent through Emacs smtpmail or an external sendmail-compatible program. It reuses the Gnus message and article modes, so signing, encryption and HTML rendering come from Emacs. It suits Emacs users who keep mail offline and want fast full-text search.

Type
Email client
Interface
Runs inside Emacs
Systems
Runs on Linux, macOS and BSD, on Windows through WSL, on Android through Termux.
Language
Emacs Lisp (mu4e), C++ (mu)
License
GPL 3.0 or later
Latest version
1.14.3
Background
Emacs front end of the mu project
Maintained
Yes
Website
djcbsoftware.nl
Source
github.com/djcb/mu
Documentation
djcbsoftware.nl

Install

SystemSupportInstall
LinuxNative
aptsudo apt install mu4e isync
dnfsudo dnf install maildir-utils isync emacs
AURyay -S mu isync
macOSNative
Homebrewbrew install mu isync emacs
WindowsThrough WSL
WSLsudo apt install mu4e isync

mu has no Windows package and upstream calls native Windows support experimental; run Emacs, mu and mbsync in WSL.

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

Protocols and features

Protocols
Protocolmu4e
IMAPThrough a separate tool
POP3Through a separate tool
SMTPYes
JMAPNo
MaildirYes
mboxNo
notmuchNo
Features
Featuremu4e
OpenPGPYes
S/MIMEvia Emacs MML
OAuth2 sign-invia script
ThreadsYes
SearchXapian full-text index with mu query syntax
HTML mailbuilt-in, rendered with the Emacs shr library
MouseYes
Multiple accountsvia contexts
Offline usefull; reads a local Maildir synced by mbsync or OfflineIMAP
Calendarreplies to invitations with mu4e-icalendar
Contactsaddress completion from indexed mail
Vim-style keysNo
ConfigurationEmacs Lisp in init.el

Pros and cons

Pros

  • Full-text search over all local mail through mu's Xapian index.
  • Works offline, since all mail lives in a local Maildir.
  • Uses Emacs message mode, so PGP/MIME, S/MIME and Org mode links are available.

Cons

  • No built-in IMAP; needs mbsync or a similar sync tool, so setup spans several config files.
  • Requires Emacs and some Emacs Lisp to configure.
  • No native Windows build, and Arch packages it only in the AUR.

Use mu4e with Forward Email

A working setup for 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 and ~/.emacs.d/init.el
# 1) ~/.mbsyncrc: sync the mailbox to ~/Mail/forwardemail (isync 1.5+ syntax)
IMAPAccount forwardemail
Host imap.forwardemail.net
Port 993
User you@example.com
PassCmd "pass show email/forwardemail"
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 * !Drafts
Create Both
Expunge Both
SyncState *

# 2) First sync and index:
#    mbsync forwardemail
#    mu init --maildir=~/Mail --personal-address=you@example.com && mu index

# 3) ~/.emacs.d/init.el
(require 'mu4e)
(setq user-mail-address "you@example.com"
      user-full-name "Your Name"
      mu4e-get-mail-command "mbsync forwardemail"
      mu4e-change-filenames-when-moving t
      mu4e-sent-folder "/forwardemail/Sent Mail"
      mu4e-drafts-folder "/forwardemail/Drafts"
      mu4e-trash-folder "/forwardemail/Trash"
      message-send-mail-function 'smtpmail-send-it
      smtpmail-smtp-server "smtp.forwardemail.net"
      smtpmail-smtp-service 465
      smtpmail-stream-type 'ssl
      smtpmail-smtp-user "you@example.com")

# 4) SMTP password in ~/.authinfo.gpg (read by Emacs auth-source):
# machine smtp.forwardemail.net login you@example.com port 465 password YOUR-GENERATED-PASSWORD
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.

Compare mu4e

All mu4e alternatives

Questions

Does mu4e work on Windows?

Not natively. It runs in Windows Subsystem for Linux (WSL). mu has no Windows package and upstream calls native Windows support experimental; run Emacs, mu and mbsync in WSL.

Does mu4e support IMAP?

Through a separate tool. mu4e reads local mail, so a sync program such as isync copies it from the IMAP server.

Is mu4e open source?

Yes, under the GPL 3.0 or later.

How do I use mu4e with Forward Email?

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

Sources