Terminal Email

Notmuch Emacs interface

EmacsEmail client

Emacs front end for notmuch that reads, searches, tags and composes mail from a local Maildir.

The Notmuch Emacs interface (notmuch.el) ships with notmuch and runs inside GNU Emacs. It replaces folders with saved searches and tags stored in the notmuch Xapian index, and shows whole threads in one buffer. Mail must be synced to a local Maildir by a tool such as mbsync, and outgoing mail goes through Emacs message mode with smtpmail or a sendmail-compatible program such as msmtp. It suits Emacs users who organize mail with tags and search instead of folders.

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
License
GPL 3.0 or later
Latest version
0.40
Background
Part of the notmuch project
Maintained
Yes
Website
notmuchmail.org
Source
git.notmuchmail.org/git/notmuch
Documentation
notmuchmail.org

Install

SystemSupportInstall
LinuxNative
aptsudo apt install elpa-notmuch isync msmtp
dnfsudo dnf install emacs-notmuch isync msmtp
pacmansudo pacman -S notmuch emacs isync msmtp
macOSNative
Homebrewbrew install notmuch emacs isync msmtp
WindowsThrough WSL
WSLsudo apt install elpa-notmuch isync msmtp

notmuch has no native Windows build or MSYS2 package; run Emacs and notmuch in WSL.

BSDNative
FreeBSD pkgpkg install notmuch-emacs isync msmtp
OpenBSDpkg_add notmuch-emacs isync msmtp
AndroidThrough Termux
Termuxpkg install notmuch emacs isync msmtp

Protocols and features

Protocols
ProtocolNotmuch Emacs interface
IMAPThrough a separate tool
POP3Through a separate tool
SMTPYes
JMAPNo
MaildirYes
mboxNo
notmuchYes
Features
FeatureNotmuch Emacs interface
OpenPGPYes
S/MIMEYes
OAuth2 sign-invia script
ThreadsYes
Searchnotmuch Xapian full-text search with tags
HTML mailbuilt-in, rendered with the Emacs shr library
MouseYes
Multiple accountsYes
Offline usefull; reads a local Maildir synced by mbsync or OfflineIMAP
Calendarshows text/calendar parts; no invitation replies
Contactsaddress completion from the notmuch index
Vim-style keysNo
ConfigurationEmacs Lisp in init.el plus the notmuch config file

Pros and cons

Pros

  • Tag-based organization with fast full-text search over all local mail.
  • Shows a whole thread in a single buffer.
  • Handles PGP/MIME and S/MIME signatures and decryption through notmuch.

Cons

  • No built-in IMAP; needs mbsync or a similar sync tool.
  • Custom tags stay in the local index; only standard flags such as unread and replied reach the IMAP server.
  • Requires Emacs and some Emacs Lisp to configure.

Use Notmuch Emacs interface 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, ~/.config/msmtp/config 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 *
Create Both
SyncState *

# 2) Index: run "notmuch setup" (database path ~/Mail, address you@example.com),
#    then: mbsync forwardemail && notmuch new

# 3) ~/.config/msmtp/config (chmod 600)
account forwardemail
host smtp.forwardemail.net
port 465
tls on
tls_starttls off
auth on
user you@example.com
passwordeval "pass show email/forwardemail"
from you@example.com
account default : forwardemail

# 4) ~/.emacs.d/init.el
(require 'notmuch)
(setq user-mail-address "you@example.com"
      user-full-name "Your Name"
      message-send-mail-function 'message-send-mail-with-sendmail
      sendmail-program "msmtp"
      message-sendmail-envelope-from 'header
      mail-specify-envelope-from t
      notmuch-fcc-dirs "\"forwardemail/Sent Mail\" +sent -inbox -unread")
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 Notmuch Emacs interface

All Notmuch Emacs interface alternatives

Questions

Does Notmuch Emacs interface work on Windows?

Not natively. It runs in Windows Subsystem for Linux (WSL). notmuch has no native Windows build or MSYS2 package; run Emacs and notmuch in WSL.

Does Notmuch Emacs interface support IMAP?

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

Is Notmuch Emacs interface open source?

Yes, under the GPL 3.0 or later.

How do I use Notmuch Emacs interface with Forward Email?

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

Sources