Notmuch Emacs interface
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
| System | Support | Install |
|---|---|---|
| Linux | Native | apt sudo apt install elpa-notmuch isync msmtpdnf sudo dnf install emacs-notmuch isync msmtppacman sudo pacman -S notmuch emacs isync msmtp |
| macOS | Native | Homebrew brew install notmuch emacs isync msmtp |
| Windows | Through WSL | WSL sudo apt install elpa-notmuch isync msmtpnotmuch has no native Windows build or MSYS2 package; run Emacs and notmuch in WSL. |
| BSD | Native | FreeBSD pkg pkg install notmuch-emacs isync msmtpOpenBSD pkg_add notmuch-emacs isync msmtp |
| Android | Through Termux | Termux pkg install notmuch emacs isync msmtp |
Protocols and features
| Protocol | Notmuch Emacs interface |
|---|---|
| IMAP | Through a separate tool |
| POP3 | Through a separate tool |
| SMTP | Yes |
| JMAP | No |
| Maildir | Yes |
| mbox | No |
| notmuch | Yes |
| Feature | Notmuch Emacs interface |
|---|---|
| OpenPGP | Yes |
| S/MIME | Yes |
| OAuth2 sign-in | via script |
| Threads | Yes |
| Search | notmuch Xapian full-text search with tags |
| HTML mail | built-in, rendered with the Emacs shr library |
| Mouse | Yes |
| Multiple accounts | Yes |
| Offline use | full; reads a local Maildir synced by mbsync or OfflineIMAP |
| Calendar | shows text/calendar parts; no invitation replies |
| Contacts | address completion from the notmuch index |
| Vim-style keys | No |
| Configuration | Emacs 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.
# 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")| 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 Notmuch Emacs interface
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
- notmuchmail.org/
- notmuchmail.org/notmuch-emacs/
- notmuchmail.org/doc/latest/notmuch-emacs.html
- git.notmuchmail.org/git/notmuch
- git.notmuchmail.org/git/notmuch/blob/HEAD:/COPYING
- git.notmuchmail.org/git/notmuch/blob/HEAD:/NEWS
- git.notmuchmail.org/git/notmuch/blob/HEAD:/emacs/notmuch-maildir-fcc.el
- git.notmuchmail.org/git/notmuch/blob/HEAD:/emacs/notmuch-show.el
- notmuchmail.org/releases/
- packages.debian.org/trixie/elpa-notmuch
- mdapi.fedoraproject.org/rawhide/pkg/emacs-notmuch
- archlinux.org/packages/extra/x86_64/notmuch/
- formulae.brew.sh/formula/notmuch
- github.com/Homebrew/homebrew-core/blob/main/Formula/n/notmuch.rb
- freshports.org/mail/notmuch-emacs/
- github.com/openbsd/ports/blob/master/mail/notmuch/Makefile
- github.com/termux/termux-packages/blob/master/packages/notmuch/build.sh
- packages.msys2.org/api/search?query=notmuch
- sourceforge.net/p/isync/isync/ci/master/tree/src/mbsync.1.in
- git.marlam.de/gitweb/?p=msmtp.git;a=blob;f=doc/msmtp.texi
- github.com/forwardemail/forwardemail.net/blob/master/helpers/ensure-default-mailboxes.js