1 [[!img notmuch-logo.png alt="Notmuch logo" class="left"]]
2 # Software working with Maildir and Notmuch
4 ## <span id="formats">**Mail storage formats**</span>
6 Notmuch can index any mail that is stored as singular files in directory structure.
7 Here are some popular formats used.
9 ### <span id="maildir">**Maildir**</span>
11 This is the native mail storage format for notmuch.
12 In addition to indexing mail content notmuch can synchronize standard maildir flags with notmuch tags. See [[special-tags]].
14 [Original specification](http://cr.yp.to/proto/maildir.html), for extensions see below.
16 There are slight differences on how to handle the `new` subdirectory.
17 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.
19 ### <span id="nntp-spool">**NNTP Spool**</span>
21 As NNTP uses incrementing number for each message in a newsgroup those are often used for filenames in NNTP software.
22 Notmuch can index mail stored like this, but flag synchronization is unavailable and mail-reading software that expects maildir might not work with it.
24 ### <span id="nntp-spool">**MH folders**</span>
26 This is structured very much like NNTP Spool with numbered messages in a directory.
27 Above statements apply.
29 ## <span id="frontends">**Notmuch frontends**</span>
31 Have a separate [[wiki page|frontends]].
33 ## <span id="synchronizers">**Mail fetchers and synchronizers**</span>
39 <th>Bidirectional</th>
41 <th>Keywords/tags</th>
47 <td><a href="http://offlineimap.org/">offlineimap</a></td>
50 <td>standard-only?</td>
54 <td><a href="http://www.muchsync.org/">muchsync</a></td>
57 <td>notmuch database</td>
61 <td><a href="http://wiki2.dovecot.org/Tools/Doveadm/Sync">dsync</a></td>
63 <td>IMAP4/POP3/custom</td>
64 <td>dovecot format</td>
67 <li><a href="http://wiki2.dovecot.org/Migration/Dsync">IMAP/POP howto</a></li>
68 <li><a href="http://wiki2.dovecot.org/Replication">replication howto<a></li>
73 <td><a href="http://isync.sourceforge.net/">mbsync/isync</a></td>
76 <td>standard-only</td>
80 <td><a href="http://pyropus.ca/software/getmail/">getmail</a></td>
87 <td><a href="http://fetchmail.berlios.de/">fetchmail</a></td>
91 <td>no maildir support, can deliver to SMTP or local MDA</td>
94 <td><a href="https://github.com/OfflineIMAP/imapfw">imapfw</a></td>
98 <td>work in progress</td>
101 <td><a href="https://github.com/gauteh/lieer">lieer</a></td>
102 <td>tags: yes, mail: fetch</td>
104 <td>bi-directional tag</td>
105 <td>Fast email-fetching and two-way tag synchronization between notmuch and GMail written using GMail API and Notmuch Python</td>
110 Other links of interest:
112 * [mswatch](http://mswatch.sourceforge.net/) Triggers sync on mailbox changes.
113 * [mailsync](http://mailsync.sourceforge.net/) Based on UW library that doesn't support Maildir out of the box. MH folders are supported.
114 * [imapsync](http://imapsync.lamiral.info/) (unidirectional)
115 * [slrnpull](http://slrn.sourceforge.net/docs/slrn-FAQ-5.html) Fetches NNTP newsgroups (such as USENET or Gmane) into numbered spool format which notmuch can index.
117 ## <span id="mda">**Filters and mail delivery agents**</span>
119 Mail delivery agent (or MDA for short) is a piece of software that performs the
120 final step of mail transfer: saving it into user's mailbox.
121 This is invoked either by SMTP server (MTA), mail fetcher, or chained from
122 other delivery agent to perform such tasks as mail filtering, saving to
123 different folders, or forwarding to different addresses.
125 Following software can deliver to Maildir mailboxes:
127 * [procmail](http://www.procmail.org/)
128 * Courier (or standalone): [maildrop](http://www.courier-mta.org/maildrop/)
129 * Dovecot: [dovecot-lda](http://wiki.dovecot.org/LDA)
130 * Postfix: [local](http://www.postfix.org/local.8.html)
131 * Exim: [appendfile](http://exim.org/exim-html-current/doc/html/spec_html/ch-the_appendfile_transport.html#SECTmaildirdelivery)
132 * Qmail: [qmail-local](http://qmail.org/man/man8/qmail-local.html)
133 * OpenSMTPD: supports tuning via [.forward](https://www.opensmtpd.org/forward.5.html) files
135 Many MDAs also support filtering via [Sieve](https://en.wikipedia.org/wiki/Sieve_%28mail_filtering_language%29) language.
137 ## <span id="imap">**IMAP servers**</span>
139 Internet Mail Access Protocol servers that can interoperate with notmuch.
140 It is of note that IMAP protocol supports storing so-called [keywords](https://tools.ietf.org/html/rfc3501#page-11) (user-defined flags) which are mostly equivalent to notmuch tags.
141 Unfortunately Maildir does not have standard way to encode keywords, so there are extensions necessary to store that information.
143 ### <span id="dovecot">**Dovecot**</span>
145 [Homepage](http://dovecot.org/) | [Maildir extensions](http://wiki.dovecot.org/MailboxFormat/Maildir)
147 The fully standard-compliant IMAP server.
148 Has efficient syncing and multimaster replication capability.
150 Up to 26 different keywords can be stored per-maildir using Maildir flags a-z.
151 Their meaning is defined via `dovecot-keywords` file which is simple, well-defined text file which maps each letter to specific tag/keyword.
152 If more than 26 keywords appear in one Maildir then some of them are stored in [dovecot-specific](http://wiki.dovecot.org/Design/Indexes/MainIndex) [index files](http://wiki.dovecot.org/IndexFiles).
153 Dovecot's dsync will sync keywords into this format.
155 ### <span id="courier">**Courier**</span>
157 [Homepage](http://www.courier-mta.org/) | [Maildir++ specification](http://www.courier-mta.org/maildir.html) | [Further Maildir++ specification](http://www.courier-mta.org/imap/README.maildirquota.html)
159 The origin of Maildir++ format which was also adopted by dovecot, among others.
160 Ships many useful commandline tools.
162 It stores keywords in [courierimapkeywords](http://www.courier-mta.org/imap/README.imapkeywords.html) inside the maildir.
163 It supports arbitrary amount of keywords, but unfortunately actually reading them is rather convoluted process.
165 ### <span id="imap-other">**Other**</span>
167 * [UW-IMAP](http://www.washington.edu/imap/) supports MH folders and there is a patch for Maildir support.
168 * [Cyrus](http://www.cyrusimap.org/) has it's [own mailbox format](http://www.cyrusimap.org/docs/cyrus-imapd/2.5.7/internal/mailbox-format.php), but stores messages as single files which should be indexable.