]> git.notmuchmail.org Git - notmuch/blob - doc/man1/notmuch-config.rst
emacs: Add new option notmuch-search-hide-excluded
[notmuch] / doc / man1 / notmuch-config.rst
1 .. _notmuch-config(1):
2
3 ==============
4 notmuch-config
5 ==============
6
7 SYNOPSIS
8 ========
9
10 **notmuch** **config** **get** <*section*>.<*item*>
11
12 **notmuch** **config** **set** [--database] <*section*>.<*item*> [*value* ...]
13
14 **notmuch** **config** **list**
15
16 DESCRIPTION
17 ===========
18
19 The **config** command can be used to get or set settings in the notmuch
20 configuration file and corresponding database.
21
22 .. program:: config
23
24 .. option:: get
25
26    The value of the specified configuration item is printed to
27    stdout. If the item has multiple values (it is a list), each value
28    is separated by a newline character.
29
30 .. option:: set
31
32    The specified configuration item is set to the given value. To
33    specify a multiple-value item (a list), provide each value as a
34    separate command-line argument.
35
36    If no values are provided, the specified configuration item will
37    be removed from the configuration file.
38
39    With the `--database` option, updates configuration metadata
40    stored in the database, rather than the default (text)
41    configuration file.
42
43 .. option:: list
44
45    Every configuration item is printed to stdout, each on a separate
46    line of the form::
47
48      section.item=value
49
50    No additional whitespace surrounds the dot or equals sign
51    characters. In a multiple-value item (a list), the values are
52    separated by semicolon characters.
53
54 The available configuration items are described below. Non-absolute
55 paths are presumed relative to `$HOME` for items in section
56 **database**.
57
58 .. nmconfig:: built_with.<name>
59
60     Compile time feature <name>. Current possibilities include
61     "retry_lock" (configure option, included by default).
62     (since notmuch 0.30, "compact" and "field_processor" are
63     always included.)
64
65 .. nmconfig:: database.autocommit
66
67     How often to commit transactions to disk. `0` means wait until
68     command completes, otherwise an integer `n` specifies to commit to
69     disk after every `n` completed transactions.
70
71     History: this configuration value was introduced in notmuch 0.33.
72
73 .. nmconfig:: database.backup_dir
74
75     Directory to store tag dumps when upgrading database.
76
77     History: this configuration value was introduced in notmuch 0.32.
78
79     Default: A sibling directory of the Xapian database called
80     `backups`.
81
82 .. nmconfig:: database.hook_dir
83
84     Directory containing hooks run by notmuch commands. See
85     :any:`notmuch-hooks(5)`.
86
87     History: this configuration value was introduced in notmuch 0.32.
88
89     Default: See HOOKS, below.
90
91 .. nmconfig:: database.mail_root
92
93     The top-level directory where your mail currently exists and to
94     where mail will be delivered in the future. Files should be
95     individual email messages.
96
97     History: this configuration value was introduced in notmuch 0.32.
98
99     Default: For compatibility with older configurations, the value of
100     database.path is used if :nmconfig:`database.mail_root` is unset.
101
102 .. nmconfig:: database.path
103
104     Notmuch will store its database here, (in
105     sub-directory named ``.notmuch`` if :nmconfig:`database.mail_root`
106     is unset).
107
108     Default: see :ref:`database`
109
110 .. nmconfig:: git.path
111
112     Default location for git repository for :any:`notmuch-git`.
113
114 .. nmconfig:: git.safe_fraction
115
116    Some :any:`notmuch-git` operations check that the fraction of
117    messages changed (in the database or in git, as appropriate) is not
118    too large. This item controls what fraction of total messages is
119    considered "not too large".
120
121 .. nmconfig:: git.tag_prefix
122
123     Default tag prefix (filter) for :any:`notmuch-git`.
124
125 .. nmconfig:: index.as_text
126
127    List of regular expressions (without delimiters) for MIME types to
128    be indexed as text. Currently this applies only to attachments.  By
129    default the regex matches anywhere in the content type; if the
130    user wants an anchored match, they should include anchors in their
131    regexes.
132
133    History: This configuration value was introduced in notmuch 0.38.
134
135 .. nmconfig:: index.decrypt
136
137     Policy for decrypting encrypted messages during indexing.  Must be
138     one of: ``false``, ``auto``, ``nostash``, or ``true``.
139
140     When indexing an encrypted e-mail message, if this variable is set
141     to ``true``, notmuch will try to decrypt the message and index the
142     cleartext, stashing a copy of any discovered session keys for the
143     message.  If ``auto``, it will try to index the cleartext if a
144     stashed session key is already known for the message (e.g. from a
145     previous copy), but will not try to access your secret keys.  Use
146     ``false`` to avoid decrypting even when a stashed session key is
147     already present.
148
149     ``nostash`` is the same as ``true`` except that it will not stash
150     newly-discovered session keys in the database.
151
152     From the command line (i.e. during :any:`notmuch-new(1)`,
153     :any:`notmuch-insert(1)`, or :any:`notmuch-reindex(1)`), the user can
154     override the database's stored decryption policy with the
155     ``--decrypt=`` option.
156
157     Here is a table that summarizes the functionality of each of these
158     policies:
159
160     +------------------------+-------+------+---------+------+
161     |                        | false | auto | nostash | true |
162     +========================+=======+======+=========+======+
163     | Index cleartext using  |       |  X   |    X    |  X   |
164     | stashed session keys   |       |      |         |      |
165     +------------------------+-------+------+---------+------+
166     | Index cleartext        |       |      |    X    |  X   |
167     | using secret keys      |       |      |         |      |
168     +------------------------+-------+------+---------+------+
169     | Stash session keys     |       |      |         |  X   |
170     +------------------------+-------+------+---------+------+
171     | Delete stashed session |   X   |      |         |      |
172     | keys on reindex        |       |      |         |      |
173     +------------------------+-------+------+---------+------+
174
175     Stashed session keys are kept in the database as properties
176     associated with the message.  See ``session-key`` in
177     :any:`notmuch-properties(7)` for more details about how they can be
178     useful.
179
180     Be aware that the notmuch index is likely sufficient (and a
181     stashed session key is certainly sufficient) to reconstruct the
182     cleartext of the message itself, so please ensure that the notmuch
183     message index is adequately protected.  DO NOT USE
184     ``index.decrypt=true`` or ``index.decrypt=nostash`` without
185     considering the security of your index.
186
187     Default: ``auto``.
188
189 .. _index.header:
190
191 .. nmconfig:: index.header.<prefix>
192
193     Define the query prefix <prefix>, based on a mail header. For
194     example ``index.header.List=List-Id`` will add a probabilistic
195     prefix ``List:`` that searches the ``List-Id`` field.  User
196     defined prefixes must not start with 'a'...'z'; in particular
197     adding a prefix with same name as a predefined prefix is not
198     supported. See :any:`notmuch-search-terms(7)` for a list of existing
199     prefixes, and an explanation of probabilistic prefixes.
200
201 .. nmconfig:: maildir.synchronize_flags
202
203     If true, then the following maildir flags (in message filenames)
204     will be synchronized with the corresponding notmuch tags:
205
206     +--------+-----------------------------------------------+
207     | Flag   | Tag                                           |
208     +========+===============================================+
209     | D      | draft                                         |
210     +--------+-----------------------------------------------+
211     | F      | flagged                                       |
212     +--------+-----------------------------------------------+
213     | P      | passed                                        |
214     +--------+-----------------------------------------------+
215     | R      | replied                                       |
216     +--------+-----------------------------------------------+
217     | S      | unread (added when 'S' flag is not present)   |
218     +--------+-----------------------------------------------+
219
220     The :any:`notmuch-new(1)` command will notice flag changes in
221     filenames and update tags, while the :any:`notmuch-tag(1)` and
222     :any:`notmuch-restore(1)` commands will notice tag changes and
223     update flags in filenames.
224
225     If there have been any changes in the maildir (new messages added,
226     old ones removed or renamed, maildir flags changed, etc.), it is
227     advisable to run :any:`notmuch-new(1)` before
228     :any:`notmuch-tag(1)` or :any:`notmuch-restore(1)` commands to
229     ensure the tag changes are properly synchronized to the maildir
230     flags, as the commands expect the database and maildir to be in
231     sync.
232
233     Default: ``true``.
234
235 .. nmconfig:: new.ignore
236
237     A list to specify files and directories that will not be searched
238     for messages by :any:`notmuch-new(1)`. Each entry in the list is either:
239
240     A file or a directory name, without path, that will be ignored,
241     regardless of the location in the mail store directory hierarchy.
242
243     Or:
244
245     A regular expression delimited with // that will be matched
246     against the path of the file or directory relative to the database
247     path. Matching files and directories will be ignored. The
248     beginning and end of string must be explicitly anchored. For
249     example, /.*/foo$/ would match "bar/foo" and "bar/baz/foo", but
250     not "foo" or "bar/foobar".
251
252     Default: empty list.
253
254 .. nmconfig:: new.tags
255
256     A list of tags that will be added to all messages incorporated by
257     **notmuch new**.
258
259     Default: ``unread;inbox``.
260
261 .. nmconfig:: query.<name>
262
263     Expansion for named query called <name>. See
264     :any:`notmuch-search-terms(7)` for more information about named
265     queries.
266
267 .. nmconfig:: search.exclude_tags
268
269     A list of tags that will be excluded from search results by
270     default. Using an excluded tag in a query will override that
271     exclusion.
272
273     Default: empty list. Note that :any:`notmuch-setup(1)` puts
274     ``deleted;spam`` here when creating new configuration file.
275
276 .. nmconfig:: show.extra_headers
277
278     By default :any:`notmuch-show(1)` includes the following headers
279     in structured output if they are present in the message:
280     `Subject`, `From`, `To`, `Cc`, `Bcc`, `Reply-To`, `Date`. This
281     option allows the specification of a list of further
282     headers to output.
283
284     History: This configuration value was introduced in notmuch 0.35.
285
286     Default: empty list.
287
288 .. nmconfig:: squery.<name>
289
290     Expansion for named query called <name>, using s-expression syntax. See
291     :any:`notmuch-sexp-queries(7)` for more information about s-expression
292     queries.
293
294 .. nmconfig:: user.name
295
296     Your full name.
297
298     Default: ``$NAME`` variable if set, otherwise read from
299     ``/etc/passwd``.
300
301 .. nmconfig:: user.other_email
302
303     A list of other email addresses at which you receive email
304     (see also, :nmconfig:`user.primary_email`)
305
306     Default: not set.
307
308 .. nmconfig:: user.primary_email
309
310     Your primary email address.
311
312     Default: ``$EMAIL`` variable if set, otherwise constructed from
313     the username and hostname of the current machine.
314
315 FILES
316 =====
317
318 .. _config_search:
319
320 CONFIGURATION
321 -------------
322
323 Notmuch configuration file search order:
324
325 1. File specified by :option:`notmuch --config` global option; see
326    :any:`notmuch(1)`.
327
328 2. File specified by :envvar:`NOTMUCH_CONFIG` environment variable.
329
330 3. ``$XDG_CONFIG_HOME/notmuch/<profile>/config`` where ``<profile>``
331    is defined by :envvar:`NOTMUCH_PROFILE` environment variable if
332    set, ``$XDG_CONFIG_HOME/notmuch/default/config`` otherwise.
333
334 4. ``$HOME/.notmuch-config.<profile>`` where ``<profile>`` is defined
335    by :envvar:`NOTMUCH_PROFILE` environment variable if set,
336    ``$HOME/.notmuch-config`` otherwise.
337
338 .. _database:
339
340 DATABASE LOCATION
341 -----------------
342
343 Notmuch database search order:
344
345 1. Directory specified by :envvar:`NOTMUCH_DATABASE` environment variable.
346
347 2. Directory specified by config key ``database.path``.
348
349 3. ``$XDG_DATA_HOME/notmuch/<profile>`` where ``<profile>``
350    is defined by :envvar:`NOTMUCH_PROFILE` environment variable if
351    set, ``$XDG_DATA_HOME/notmuch/default`` otherwise.
352
353 4. Directory specified by :envvar:`MAILDIR` environment variable.
354
355 5. ``$HOME/mail``
356
357 HOOKS
358 -----
359
360 Notmuch hook directory search order:
361
362 1. Directory specified by ``database.hook_dir`` configuration option.
363
364 2. ``$XDG_CONFIG_HOME/notmuch/<profile>/hooks`` where ``<profile>``
365    is defined by :envvar:`NOTMUCH_PROFILE` environment variable if
366    set, ``$XDG_CONFIG_HOME/notmuch/default/hooks`` otherwise.
367
368 3. ``<database.path>/.notmuch/hooks``
369
370 SEE ALSO
371 ========
372
373 :any:`notmuch(1)`,
374 :any:`notmuch-count(1)`,
375 :any:`notmuch-dump(1)`,
376 :any:`notmuch-hooks(5)`,
377 :any:`notmuch-insert(1)`,
378 :any:`notmuch-new(1)`,
379 :any:`notmuch-properties(7)`,
380 :any:`notmuch-reply(1)`,
381 :any:`notmuch-restore(1)`,
382 :any:`notmuch-search(1)`,
383 :any:`notmuch-search-terms(7)`,
384 :any:`notmuch-show(1)`,
385 :any:`notmuch-tag(1)`