Notmuch logo

Software working with Maildir and Notmuch

Mail storage formats

Notmuch can index any mail that is stored as singular files in directory structure. Here are some popular formats used.

Maildir

This is the native mail storage format for notmuch. In addition to indexing mail content notmuch can synchronize standard maildir flags with notmuch tags. See special-tags.

Original specification, for extensions see below.

There are slight differences on how to handle the new subdirectory. While the definition specifies it's for freshly-delivered mail before adding flags only, some software (notably mutt) use it for all unread mail even after the flags were added to filenames.

NNTP Spool

As NNTP uses incrementing number for each message in a newsgroup those are often used for filenames in NNTP software. Notmuch can index mail stored like this, but flag synchronization is unavailable and mail-reading software that expects maildir might not work with it.

MH folders

This is structured very much like NNTP Spool with numbered messages in a directory. Above statements apply.

Notmuch frontends

Have a separate wiki page.

Mail fetchers and synchronizers

Name Bidirectional Protocol Keywords/tags More info
offlineimap yes IMAP4 standard-only? -
muchsync yes custom notmuch database -
dsync yes IMAP4/POP3/custom dovecot format
mbsync/isync yes IMAP4 standard-only -
getmail no IMAP4/POP3 no -
fetchmail no IMAP4/POP3 no no maildir support, can deliver to SMTP or local MDA
imapfw yes IMAP4 ? work in progress
lieer tags: yes, mail: fetch GMail bi-directional tag Fast email-fetching and two-way tag synchronization between notmuch and GMail written using GMail API and Notmuch Python

Other links of interest:

Filters and mail delivery agents

Mail delivery agent (or MDA for short) is a piece of software that performs the final step of mail transfer: saving it into user's mailbox. This is invoked either by SMTP server (MTA), mail fetcher, or chained from other delivery agent to perform such tasks as mail filtering, saving to different folders, or forwarding to different addresses.

Following software can deliver to Maildir mailboxes:

Many MDAs also support filtering via Sieve language.

IMAP servers

Internet Mail Access Protocol servers that can interoperate with notmuch. It is of note that IMAP protocol supports storing so-called keywords (user-defined flags) which are mostly equivalent to notmuch tags. Unfortunately Maildir does not have standard way to encode keywords, so there are extensions necessary to store that information.

Dovecot

Homepage | Maildir extensions

The fully standard-compliant IMAP server. Has efficient syncing and multimaster replication capability.

Up to 26 different keywords can be stored per-maildir using Maildir flags a-z. Their meaning is defined via dovecot-keywords file which is simple, well-defined text file which maps each letter to specific tag/keyword. If more than 26 keywords appear in one Maildir then some of them are stored in dovecot-specific index files. Dovecot's dsync will sync keywords into this format.

Courier

Homepage | Maildir++ specification | Further Maildir++ specification

The origin of Maildir++ format which was also adopted by dovecot, among others. Ships many useful commandline tools.

It stores keywords in courierimapkeywords inside the maildir. It supports arbitrary amount of keywords, but unfortunately actually reading them is rather convoluted process.

Other