1 .\" notmuch - Not much of an email program, (just index, search and tagging)
3 .\" Copyright © 2009 Carl Worth
5 .\" Notmuch is free software: you can redistribute it and/or modify
6 .\" it under the terms of the GNU General Public License as published by
7 .\" the Free Software Foundation, either version 3 of the License, or
8 .\" (at your option) any later version.
10 .\" Notmuch is distributed in the hope that it will be useful,
11 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
12 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 .\" GNU General Public License for more details.
15 .\" You should have received a copy of the GNU General Public License
16 .\" along with this program. If not, see http://www.gnu.org/licenses/ .
18 .\" Author: Carl Worth <cworth@cworth.org>
19 .TH NOTMUCH 1 2009-10-31 "Notmuch 0.1"
21 notmuch \- thread-based email index, search, and tagging
24 .IR command " [" args " ...]"
26 Notmuch is a command-line based program for indexing, searching,
27 reading, and tagging large collections of email messages.
29 The quickest way to get started with Notmuch is to simply invoke the
31 command with no arguments, which will interactively guide you through
32 the process of indexing your mail.
34 While the command-line program
36 provides powerful functionality, it does not provide the most
37 convenient interface for that functionality. More sophisticated
38 interfaces are expected to be built on top of either the command-line
39 interface, or more likely, on top of the notmuch library
40 interface. See http://notmuchmail.org for more about alternate
41 interfaces to notmuch.
43 All commands need to know where your mail (and the notmuch database)
44 are stored. This is ${HOME}/mail by default. An alternate location can
51 commands are used to add new mail messages to the notmuch database.
56 Interactively sets up notmuch for first use.
58 The setup command will prompt for the directory containing your email
59 archives, and will then proceed to build a database that indexes the
60 mail to allow for fast search of the archive.
62 This directory can contain any number of sub-directories and should
63 primarily contain only files with indvidual email messages
64 (eg. maildir or mh archives are perfect). If there are other,
65 non-email files (such as indexes maintained by other email programs)
66 then notmuch will do its best to detect those and ignore them.
68 Mail storage that uses mbox format, (where one mbox file contains many
69 messages), will not work with notmuch. If that's how your mail is
70 currently stored, it is recommended you first convert it to maildir
71 format with a utility such as mb2md before running
76 with no command argument will run
78 if the setup command has not previously been completed.
83 Find and import any new messages to the database.
87 command scans all sub-directories of the database, adding new messages
88 that are found. Each new message will automatically be tagged with
95 will skip any read-only directories, so you can use that to mark
96 directories that will not receive any new mail (and make
102 .BR search " and "show
103 commands are used to query the email database.
106 .BR search " <search-term>..."
108 Search for messages matching the given search terms, and display as
109 results the threads containing the matched messages.
111 The output consists of one line per thread, giving a thread ID, the
112 date of the oldest matched message in the thread, and the subject from
115 Currently, in addition to free text (and quoted phrases) which match
116 terms appearing anywhere within an email, the following prefixes can
117 be used to search specific portions of an email, (where <brackets>
118 indicate user-supplied values):
120 from:<name-or-address>
124 subject:<word-or-quoted-phrase>
132 The from: prefix is used to match the name or address of the sender of
135 The to: prefix is used to match the names or addresses of any
136 recipient of an email message, (whether To, Cc, or Bcc).
138 Any term prefixed with subject: will match only text from
139 the subject of an email. Quoted phrases are supported when
140 searching with: subject:\"this is a phrase\".
142 Valid tag values include
143 .BR inbox " and " unread
144 by default for new messages added by
146 as well as any other tag values added manually with
149 Message ID values are the literal contents of the Message-ID: header
150 of email messages, but without the '<', '>' delimiters.
152 Thread ID values are generated internally by notmuch but can be seen
153 in the first column of output from
157 In addition to individual terms, multiple terms can be
158 combined with Boolean operators (
159 .BR and ", " or ", " not
160 , etc.). each term in the query will be implicitly connected by a
161 logical AND if no explicit operator is provided, (except that terms
162 with a common prefix will be implicitly combined with OR until we get
163 Xapian defect #402 fixed).
165 Parentheses can also be used to control the combination of the Boolean
166 operators, but will have to be protected from interpretation by the
167 shell, (such as by putting quotation marks around any parenthesized
170 .BR reply " <search-term>..."
172 Constructs a reply template for a set of messages.
174 See the documentation of
176 for deatils of the supported syntax of search terms.
178 To make replying to email easier,
180 takes an existing set of messages and constructs a suitable mail
181 template, taking From: and To: messages and using those for the new
182 To: address; copying Cc: addresses, building a suitable new subject
183 including Re: at the front, adding the old message IDs to the
184 References list and setting the In-Reply-To: field correctly.
186 The resulting message template is output to stdout.
189 .BR show " <search-term>..."
191 Shows all messages matching the search terms.
193 See the documentation of
195 for details of the supported syntax of search terms.
199 is to display a single thread of email messages. For this, use a
200 search term of "thread:<thread-id>" as can be seen in the first
201 column of output from the
205 All messages will be displayed in date order. The output format is
206 plain-text, with all text-content MIME parts decoded. Various
207 components in the output,
208 .RB ( message ", " header ", " body ", " attachment ", and MIME " part ),
209 will be delimited by easily-parsed markers. Each marker consists of a
210 Control-L character (ASCII decimal 12), the name of the marker, and
211 then either an opening or closing brace, ('{' or '}'), to either open
212 or close the component.
217 command is the only command available for manipulating database
222 .BR tag " +<tag>|-<tag> [...] [--] <search-term>..."
224 Add/remove tags for all messages matching the search terms.
226 The search terms are handled exactly as in
228 so one can use that command first to see what will be modified.
230 Tags prefixed by '+' are added while those prefixed by '-' are
231 removed. For each message, tag removal is before tag addition.
233 The beginning of <search-terms> is recognized by the first
234 argument that begins with neither '+' nor '-'. Support for
235 an initial search term beginning with '+' or '-' is provided
236 by allowing the user to specify a "--" argument to separate
237 the tags from the search terms.
241 between reading a thread with
243 and removing the "inbox" tag for that thread with
245 then you create the possibility of moving some messages from that
246 thread out of your inbox without ever reading them. The easiest way to
247 avoid this problem is to not run
249 between reading mail and removing tags.
253 .BR dump " and " restore
254 commands can be used to create a textual dump of email tags for backup
255 purposes, and to restore from that dump
259 .BR dump " [<filename>]"
261 Creates a plain-text dump of the tags of each message.
263 The output is to the given filename, if any, or to stdout.
265 These tags are the only data in the notmuch database that can't be
266 recreated from the messages themselves. The output of notmuch dump is
267 therefore the only critical thing to backup (and much more friendly to
268 incremental backup than the native database files.)
270 .BR restore " <filename>"
272 Restores the tags from the given file (see
273 .BR "notmuch dump" "."
275 Note: The dump file format is specifically chosen to be
276 compatible with the format of files produced by sup-dump.
277 So if you've previously been using sup for mail, then the
279 command provides you a way to import all of your tags (or labels as
283 Set to the directory which contains the user's mail to be indexed and
284 searched by notmuch. Notmuch will create a directory named
286 at the toplevel of this directory where it will store its database.
288 The emacs-based interface to notmuch (available as
290 in the Notmuch distribution).
293 .B http://notmuchmail.org