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 show " <search-term>..."
172 Shows all messages matching the search terms.
174 See the documentation of
176 for details of the supported syntax of search terms.
180 is to display a single thread of email messages. For this, use a
181 search term of "thread:<thread-id>" as can be seen in the first
182 column of output from the
186 All messages will be displayed in date order. The output format is
187 plain-text, with all text-content MIME parts decoded. Various
188 components in the output,
189 .RB ( message ", " header ", " body ", " attachment ", and MIME " part ),
190 will be delimited by easily-parsed markers. Each marker consists of a
191 Control-L character (ASCII decimal 12), the name of the marker, and
192 then either an opening or closing brace, ('{' or '}'), to either open
193 or close the component.
198 command is the only command available for manipulating database
203 .BR tag " +<tag>|-<tag> [...] [--] <search-term>..."
205 Add/remove tags for all messages matching the search terms.
207 The search terms are handled exactly as in
209 so one can use that command first to see what will be modified.
211 Tags prefixed by '+' are added while those prefixed by '-' are
212 removed. For each message, tag removal is before tag addition.
214 The beginning of <search-terms> is recognized by the first
215 argument that begins with neither '+' nor '-'. Support for
216 an initial search term beginning with '+' or '-' is provided
217 by allowing the user to specify a "--" argument to separate
218 the tags from the search terms.
222 between reading a thread with
224 and removing the "inbox" tag for that thread with
226 then you create the possibility of moving some messages from that
227 thread out of your inbox without ever reading them. The easiest way to
228 avoid this problem is to not run
230 between reading mail and removing tags.
234 .BR dump " and " restore
235 commands can be used to create a textual dump of email tags for backup
236 purposes, and to restore from that dump
240 .BR dump " [<filename>]"
242 Creates a plain-text dump of the tags of each message.
244 The output is to the given filename, if any, or to stdout.
246 These tags are the only data in the notmuch database that can't be
247 recreated from the messages themselves. The output of notmuch dump is
248 therefore the only critical thing to backup (and much more friendly to
249 incremental backup than the native database files.)
251 .BR restore " <filename>"
253 Restores the tags from the given file (see
254 .BR "notmuch dump" "."
256 Note: The dump file format is specifically chosen to be
257 compatible with the format of files produced by sup-dump.
258 So if you've previously been using sup for mail, then the
260 command provides you a way to import all of your tags (or labels as
264 Set to the directory which contains the user's mail to be indexed and
265 searched by notmuch. Notmuch will create a directory named
267 at the toplevel of this directory where it will store its database.
269 The emacs-based interface to notmuch (available as
271 in the Notmuch distribution).
274 .B http://notmuchmail.org