]> git.notmuchmail.org Git - notmuch/blob - doc/man1/notmuch.rst
c488f12a9e7a58193486b5dd5fdf76fe31f62057
[notmuch] / doc / man1 / notmuch.rst
1 .. _notmuch(1):
2 .. _notmuch-setup(1):
3
4 =======
5 notmuch
6 =======
7
8 SYNOPSIS
9 ========
10
11 **notmuch** [option ...] **command** [arg ...]
12
13 DESCRIPTION
14 ===========
15
16 Notmuch is a command-line based program for indexing, searching,
17 reading, and tagging large collections of email messages.
18
19 This page describes how to get started using notmuch from the command
20 line, and gives a brief overview of the commands available. For more
21 information on e.g. **notmuch show** consult the
22 :any:`notmuch-show(1)` man page, also accessible via **notmuch help
23 show**
24
25 The quickest way to get started with Notmuch is to simply invoke the
26 ``notmuch`` command with no arguments, which will interactively guide
27 you through the process of indexing your mail.
28
29 NOTE
30 ====
31
32 While the command-line program ``notmuch`` provides powerful
33 functionality, it does not provide the most convenient interface for
34 that functionality. More sophisticated interfaces are expected to be
35 built on top of either the command-line interface, or more likely, on
36 top of the notmuch library interface. See https://notmuchmail.org for
37 more about alternate interfaces to notmuch. The emacs-based interface to
38 notmuch (available under **emacs/** in the Notmuch source distribution)
39 is probably the most widely used at this time.
40
41 OPTIONS
42 =======
43
44 Supported global options for ``notmuch`` include
45
46 .. program:: notmuch
47
48 .. option:: --help [command-name]
49
50    Print a synopsis of available commands and exit. With an optional
51    command name, show the man page for that subcommand.
52
53 .. option:: --version
54
55    Print the installed version of notmuch, and exit.
56
57 .. option:: --config=FILE
58
59    Specify the configuration file to use. This overrides any
60    configuration file specified by :envvar:`NOTMUCH_CONFIG`. The empty
61    string is a permitted and sometimes useful value of *FILE*, which
62    tells ``notmuch`` to use only configuration metadata from the database.
63
64 .. option:: --uuid=HEX
65
66    Enforce that the database UUID (a unique identifier which persists
67    until e.g. the database is compacted) is HEX; exit with an error
68    if it is not. This is useful to detect rollover in modification
69    counts on messages. You can find this UUID using e.g. ``notmuch
70    count --lastmod``
71
72 All global options except ``--config`` can also be specified after the
73 command. For example, ``notmuch subcommand --uuid=HEX`` is equivalent
74 to ``notmuch --uuid=HEX subcommand``.
75
76 COMMANDS
77 ========
78
79 SETUP
80 -----
81
82 The **notmuch setup** command is used to configure Notmuch for first
83 use, (or to reconfigure it later).
84
85 The setup command will prompt for your full name, your primary email
86 address, any alternate email addresses you use, and the directory
87 containing your email archives. Your answers will be written to a
88 configuration file in :envvar:`NOTMUCH_CONFIG` (if set) or
89 ${HOME}/.notmuch-config . This configuration file will be created with
90 descriptive comments, making it easy to edit by hand later to change the
91 configuration. Or you can run **notmuch setup** again to change the
92 configuration.
93
94 The mail directory you specify can contain any number of sub-directories
95 and should primarily contain only files with individual email messages
96 (eg. maildir or mh archives are perfect). If there are other, non-email
97 files (such as indexes maintained by other email programs) then notmuch
98 will do its best to detect those and ignore them.
99
100 Mail storage that uses mbox format, (where one mbox file contains many
101 messages), will not work with notmuch. If that's how your mail is
102 currently stored, it is recommended you first convert it to maildir
103 format with a utility such as :manpage:`mb2md(1)` before running
104 **notmuch setup**.
105
106 Invoking ``notmuch`` with no command argument will run **setup** if the
107 setup command has not previously been completed.
108
109 OTHER COMMANDS
110 --------------
111
112 Several of the notmuch commands accept search terms with a common
113 syntax. See :any:`notmuch-search-terms(7)` for more details on the
114 supported syntax.
115
116 The :any:`notmuch-search(1)`, :any:`notmuch-show(1)`,
117 :any:`notmuch-address(1)` and :any:`notmuch-count(1)` commands are
118 used to query the email database.
119
120 The :any:`notmuch-reply(1)` command is useful for preparing a template
121 for an email reply.
122
123 The :any:`notmuch-tag(1)` command is the only command available for
124 manipulating database contents.
125
126 The :any:`notmuch-dump(1)` and :any:`notmuch-restore(1)` commands can
127 be used to create a textual dump of email tags for backup purposes,
128 and to restore from that dump.
129
130 The :any:`notmuch-config(1)` command can be used to get or set
131 settings in the notmuch configuration file.
132
133 EXTERNAL COMMANDS
134 -----------------
135
136 If the given command is not known to notmuch, notmuch tries to execute
137 the external **notmuch-<subcommand>** in :envvar:`PATH` instead. This
138 allows users to have their own notmuch related tools to be run via the
139 notmuch command. By design, this does not allow notmuch's own commands
140 to be overridden using external commands.  The environment variable
141 :envvar:`NOTMUCH_CONFIG` will be set according to :option:`--config`,
142 if the latter is present.
143
144 OPTION SYNTAX
145 -------------
146
147 All options accepting an argument can be used with '=' or ':' as a
148 separator. Except for boolean options (which would be ambiguous), a
149 space can also be used as a separator. The following are all
150 equivalent:
151
152 ::
153
154    notmuch --config=alt-config config get user.name
155    notmuch --config:alt-config config get user.name
156    notmuch --config alt-config config get user.name
157
158 .. _duplicate-files:
159
160 DUPLICATE MESSAGE FILES
161 =======================
162
163 Notmuch considers the :mailheader:`Message-ID` to be the primary
164 identifier of message. Per :rfc:`5322` the :mailheader:`Message-ID` is
165 supposed to be globally unique, but this fails in two distinct
166 ways. When you receive copies of a message via a mechanism like
167 :mailheader:`Cc` or via a mailing list, the copies are typically
168 interchangeable. In the case of some broken mail sending software, the
169 same :mailheader:`Message-ID` is used for completely unrelated
170 messages. The options :option:`search --duplicate` and :option:`show
171 --duplicate` options provide the user with control over which message
172 file is displayed. Front ends will need to provide their own
173 interface, see e.g. the Emacs front-end :any:`emacs-show-duplicates`.
174
175 ENVIRONMENT
176 ===========
177
178 The following environment variables can be used to control the behavior
179 of notmuch.
180
181 .. envvar:: NOTMUCH_CONFIG
182
183    Specifies the location of the notmuch configuration file. See
184    :any:`notmuch-config(1)` for details.
185
186 .. envvar:: NOTMUCH_DATABASE
187
188    Specifies the location of the notmuch database. See
189    :any:`notmuch-config(1)` for details.
190
191 .. envvar:: NOTMUCH_PROFILE
192
193    Selects among notmuch configurations. See :any:`notmuch-config(1)`
194    for details.
195
196 .. envvar:: NOTMUCH_TALLOC_REPORT
197
198    Location to write a talloc memory usage report. See
199    **talloc\_enable\_leak\_report\_full** in :manpage:`talloc(3)` for more
200    information.
201
202 .. envvar:: NOTMUCH_DEBUG_QUERY
203
204    If set to a non-empty value, the notmuch library will print (to
205    stderr) Xapian queries it constructs.
206
207 SEE ALSO
208 ========
209
210 :any:`notmuch-address(1)`,
211 :any:`notmuch-compact(1)`,
212 :any:`notmuch-config(1)`,
213 :any:`notmuch-count(1)`,
214 :any:`notmuch-dump(1)`,
215 :any:`notmuch-hooks(5)`,
216 :any:`notmuch-insert(1)`,
217 :any:`notmuch-new(1)`,
218 :any:`notmuch-properties(7)`,
219 :any:`notmuch-reindex(1)`,
220 :any:`notmuch-reply(1)`,
221 :any:`notmuch-restore(1)`,
222 :any:`notmuch-search(1)`,
223 :any:`notmuch-search-terms(7)`,
224 :any:`notmuch-show(1)`,
225 :any:`notmuch-tag(1)`
226
227 The notmuch website: **https://notmuchmail.org**
228
229 CONTACT
230 =======
231
232 Feel free to send questions, comments, or kudos to the notmuch mailing
233 list <notmuch@notmuchmail.org> . Subscription is not required before
234 posting, but is available from the notmuchmail.org website.
235
236 Real-time interaction with the Notmuch community is available via IRC
237 (server: irc.libera.chat, channel: #notmuch).