notmuch
Command-line mail indexer that adds fast full-text search, threading and tags to a local Maildir.
notmuch indexes messages in a local Maildir with Xapian and lets you search, thread and tag them from the command line. It does not fetch or send mail; a sync tool such as mbsync and an SMTP client such as msmtp handle that. Several mail clients use it as their back end, including its own Emacs interface, alot, aerc and NeoMutt. It suits users who want tags and search instead of folders.
- 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, C++
- License
- GPL 3.0 or later
- Latest version
0.40- Maintained
- Yes
- Website
- notmuchmail.org
- Source
- git.notmuchmail.org/git/notmuch
- Documentation
- notmuchmail.org
Install
| System | Support | Install |
|---|---|---|
| Linux | Native | apt sudo apt install notmuchdnf sudo dnf install notmuchpacman sudo pacman -S notmuch |
| macOS | Native | Homebrew brew install notmuch |
| Windows | Through WSL | WSL sudo apt install notmuchNo native Windows build or MSYS2 package; run it in WSL. |
| BSD | Native | FreeBSD pkg pkg install notmuchOpenBSD pkg_add notmuch |
| Android | Through Termux | Termux pkg install notmuch |
Protocols and features
| Protocol | notmuch |
|---|---|
| IMAP | No |
| POP3 | No |
| SMTP | No |
| JMAP | No |
| Maildir | Yes |
| mbox | No |
| notmuch | Yes |
| Feature | notmuch |
|---|---|
| OpenPGP | Yes |
| S/MIME | Yes |
| OAuth2 sign-in | No |
| Threads | Yes |
| Search | Xapian full-text search with tags and date ranges |
| HTML mail | No |
| Mouse | No |
| Multiple accounts | indexes every Maildir under one database path |
| Offline use | full; works only on local mail |
| Calendar | No |
| Contacts | notmuch address lists addresses from indexed mail |
| Vim-style keys | No |
| Configuration | INI-style notmuch config file |
Pros and cons
Pros
- Fast full-text search and tagging over large local mail stores.
- Used as a back end by several clients, so one index serves more than one front end.
- Can index and search decrypted PGP/MIME and S/MIME messages.
Cons
- Does not fetch or send mail; needs mbsync and msmtp or similar tools.
- Custom tags stay in the local index; only standard flags such as unread and replied sync to Maildir, and from there to IMAP.
- No native Windows build.
Use notmuch with Forward Email
How notmuch 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.
# notmuch only indexes local mail. Sync Forward Email to ~/Mail first with mbsync (~/.mbsyncrc):
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 *
# ~/.notmuch-config
[database]
path=/home/you/Mail
[user]
name=Your Name
primary_email=you@example.com
[new]
tags=unread;inbox;
# Then: mbsync forwardemail && notmuch new
# Search: notmuch search tag:unread from:someone@example.org| 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.
Questions
Does notmuch work on Windows?
Not natively. It runs in Windows Subsystem for Linux (WSL). No native Windows build or MSYS2 package; run it in WSL.
Does notmuch support IMAP?
No. notmuch does not use IMAP.
Is notmuch open source?
Yes, under the GPL 3.0 or later.
How do I use notmuch with Forward Email?
Use the config in the Forward Email section on this page, saved as ~/.mbsyncrc and ~/.notmuch-config, and replace the address and password with your own.
Sources
- notmuchmail.org/
- notmuchmail.org/doc/latest/
- notmuchmail.org/releases/
- 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:/doc/man1/notmuch-config.rst
- packages.debian.org/trixie/notmuch
- mdapi.fedoraproject.org/rawhide/pkg/notmuch
- archlinux.org/packages/extra/x86_64/notmuch/
- formulae.brew.sh/formula/notmuch
- freshports.org/mail/notmuch/
- 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