mu4e
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
| System | Support | Install |
|---|---|---|
| Linux | Native | apt sudo apt install mu4e isyncdnf sudo dnf install maildir-utils isync emacsAUR yay -S mu isync |
| macOS | Native | Homebrew brew install mu isync emacs |
| Windows | Through WSL | WSL sudo apt install mu4e isyncmu has no Windows package and upstream calls native Windows support experimental; run Emacs, mu and mbsync in WSL. |
| BSD | Native | FreeBSD pkg pkg install mu isyncOpenBSD pkg_add mu isync |
| Android | Through Termux | Termux pkg install mu isync |
Protocols and features
| Protocol | mu4e |
|---|---|
| IMAP | Through a separate tool |
| POP3 | Through a separate tool |
| SMTP | Yes |
| JMAP | No |
| Maildir | Yes |
| mbox | No |
| notmuch | No |
| Feature | mu4e |
|---|---|
| OpenPGP | Yes |
| S/MIME | via Emacs MML |
| OAuth2 sign-in | via script |
| Threads | Yes |
| Search | Xapian full-text index with mu query syntax |
| HTML mail | built-in, rendered with the Emacs shr library |
| Mouse | Yes |
| Multiple accounts | via contexts |
| Offline use | full; reads a local Maildir synced by mbsync or OfflineIMAP |
| Calendar | replies to invitations with mu4e-icalendar |
| Contacts | address completion from indexed mail |
| Vim-style keys | No |
| Configuration | Emacs 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.
# 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| Protocol | Server | Port | Security |
|---|---|---|---|
| IMAP | imap.forwardemail.net | 993 | SSL/TLS |
| POP3 | pop3.forwardemail.net | 995 | SSL/TLS |
| SMTP | smtp.forwardemail.net | 465 | SSL/TLS |
| SMTP | smtp.forwardemail.net | 587 | STARTTLS |
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
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
- djcbsoftware.nl/code/mu/mu4e.html
- djcbsoftware.nl/code/mu/mu4e/
- github.com/djcb/mu
- github.com/djcb/mu/blob/master/README.org
- github.com/djcb/mu/blob/master/COPYING
- github.com/djcb/mu/blob/master/mu4e/mu4e.texi
- github.com/djcb/mu/blob/master/man/mu-init.1.org
- formulae.brew.sh/formula/mu
- packages.debian.org/trixie/mu4e
- src.fedoraproject.org/rpms/maildir-utils/blob/rawhide/f/maildir-utils.spec
- aur.archlinux.org/packages/mu
- github.com/freebsd/freebsd-ports/blob/main/mail/mu/Makefile
- github.com/openbsd/ports/blob/master/mail/mu/Makefile
- github.com/termux/termux-packages/blob/master/packages/mu/build.sh
- packages.msys2.org/api/search?query=mu
- sourceforge.net/p/isync/isync/ci/master/tree/src/mbsync.1.in
- github.com/emacs-mirror/emacs/blob/emacs-31/lisp/mail/smtpmail.el
- github.com/forwardemail/forwardemail.net/blob/master/helpers/ensure-default-mailboxes.js