]> git.notmuchmail.org Git - notmuch/blob - doc/man1/notmuch-config.rst
Merge branch 'release'
[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:: index.decrypt
111
112     Policy for decrypting encrypted messages during indexing.  Must be
113     one of: ``false``, ``auto``, ``nostash``, or ``true``.
114
115     When indexing an encrypted e-mail message, if this variable is set
116     to ``true``, notmuch will try to decrypt the message and index the
117     cleartext, stashing a copy of any discovered session keys for the
118     message.  If ``auto``, it will try to index the cleartext if a
119     stashed session key is already known for the message (e.g. from a
120     previous copy), but will not try to access your secret keys.  Use
121     ``false`` to avoid decrypting even when a stashed session key is
122     already present.
123
124     ``nostash`` is the same as ``true`` except that it will not stash
125     newly-discovered session keys in the database.
126
127     From the command line (i.e. during :any:`notmuch-new(1)`,
128     :any:`notmuch-insert(1)`, or :any:`notmuch-reindex(1)`), the user can
129     override the database's stored decryption policy with the
130     ``--decrypt=`` option.
131
132     Here is a table that summarizes the functionality of each of these
133     policies:
134
135     +------------------------+-------+------+---------+------+
136     |                        | false | auto | nostash | true |
137     +========================+=======+======+=========+======+
138     | Index cleartext using  |       |  X   |    X    |  X   |
139     | stashed session keys   |       |      |         |      |
140     +------------------------+-------+------+---------+------+
141     | Index cleartext        |       |      |    X    |  X   |
142     | using secret keys      |       |      |         |      |
143     +------------------------+-------+------+---------+------+
144     | Stash session keys     |       |      |         |  X   |
145     +------------------------+-------+------+---------+------+
146     | Delete stashed session |   X   |      |         |      |
147     | keys on reindex        |       |      |         |      |
148     +------------------------+-------+------+---------+------+
149
150     Stashed session keys are kept in the database as properties
151     associated with the message.  See ``session-key`` in
152     :any:`notmuch-properties(7)` for more details about how they can be
153     useful.
154
155     Be aware that the notmuch index is likely sufficient (and a
156     stashed session key is certainly sufficient) to reconstruct the
157     cleartext of the message itself, so please ensure that the notmuch
158     message index is adequately protected.  DO NOT USE
159     ``index.decrypt=true`` or ``index.decrypt=nostash`` without
160     considering the security of your index.
161
162     Default: ``auto``.
163
164 .. _index.header:
165
166 .. nmconfig:: index.header.<prefix>
167
168     Define the query prefix <prefix>, based on a mail header. For
169     example ``index.header.List=List-Id`` will add a probabilistic
170     prefix ``List:`` that searches the ``List-Id`` field.  User
171     defined prefixes must not start with 'a'...'z'; in particular
172     adding a prefix with same name as a predefined prefix is not
173     supported. See :any:`notmuch-search-terms(7)` for a list of existing
174     prefixes, and an explanation of probabilistic prefixes.
175
176 .. nmconfig:: maildir.synchronize_flags
177
178     If true, then the following maildir flags (in message filenames)
179     will be synchronized with the corresponding notmuch tags:
180
181     +--------+-----------------------------------------------+
182     | Flag   | Tag                                           |
183     +========+===============================================+
184     | D      | draft                                         |
185     +--------+-----------------------------------------------+
186     | F      | flagged                                       |
187     +--------+-----------------------------------------------+
188     | P      | passed                                        |
189     +--------+-----------------------------------------------+
190     | R      | replied                                       |
191     +--------+-----------------------------------------------+
192     | S      | unread (added when 'S' flag is not present)   |
193     +--------+-----------------------------------------------+
194
195     The :any:`notmuch-new(1)` command will notice flag changes in
196     filenames and update tags, while the :any:`notmuch-tag(1)` and
197     :any:`notmuch-restore(1)` commands will notice tag changes and
198     update flags in filenames.
199
200     If there have been any changes in the maildir (new messages added,
201     old ones removed or renamed, maildir flags changed, etc.), it is
202     advisable to run :any:`notmuch-new(1)` before
203     :any:`notmuch-tag(1)` or :any:`notmuch-restore(1)` commands to
204     ensure the tag changes are properly synchronized to the maildir
205     flags, as the commands expect the database and maildir to be in
206     sync.
207
208     Default: ``true``.
209
210 .. nmconfig:: new.ignore
211
212     A list to specify files and directories that will not be searched
213     for messages by :any:`notmuch-new(1)`. Each entry in the list is either:
214
215     A file or a directory name, without path, that will be ignored,
216     regardless of the location in the mail store directory hierarchy.
217
218     Or:
219
220     A regular expression delimited with // that will be matched
221     against the path of the file or directory relative to the database
222     path. Matching files and directories will be ignored. The
223     beginning and end of string must be explicitly anchored. For
224     example, /.*/foo$/ would match "bar/foo" and "bar/baz/foo", but
225     not "foo" or "bar/foobar".
226
227     Default: empty list.
228
229 .. nmconfig:: new.tags
230
231     A list of tags that will be added to all messages incorporated by
232     **notmuch new**.
233
234     Default: ``unread;inbox``.
235
236 .. nmconfig:: query.<name>
237
238     Expansion for named query called <name>. See
239     :any:`notmuch-search-terms(7)` for more information about named
240     queries.
241
242 .. nmconfig:: search.exclude_tags
243
244     A list of tags that will be excluded from search results by
245     default. Using an excluded tag in a query will override that
246     exclusion.
247
248     Default: empty list. Note that :any:`notmuch-setup(1)` puts
249     ``deleted;spam`` here when creating new configuration file.
250
251 .. nmconfig:: show.extra_headers
252
253     By default :any:`notmuch-show(1)` includes the following headers
254     in structured output if they are present in the message:
255     `Subject`, `From`, `To`, `Cc`, `Bcc`, `Reply-To`, `Date`. This
256     option allows the specification of a list of further
257     headers to output.
258
259     History: This configuration value was introduced in notmuch 0.35.
260
261     Default: empty list.
262
263 .. nmconfig:: squery.<name>
264
265     Expansion for named query called <name>, using s-expression syntax. See
266     :any:`notmuch-sexp-queries(7)` for more information about s-expression
267     queries.
268
269 .. nmconfig:: user.name
270
271     Your full name.
272
273     Default: ``$NAME`` variable if set, otherwise read from
274     ``/etc/passwd``.
275
276 .. nmconfig:: user.other_email
277
278     A list of other email addresses at which you receive email
279     (see also, :nmconfig:`user.primary_email`)
280
281     Default: not set.
282
283 .. nmconfig:: user.primary_email
284
285     Your primary email address.
286
287     Default: ``$EMAIL`` variable if set, otherwise constructed from
288     the username and hostname of the current machine.
289
290 FILES
291 =====
292
293 .. _config_search:
294
295 CONFIGURATION
296 -------------
297
298 Notmuch configuration file search order:
299
300 1. File specified by :option:`notmuch --config` global option; see
301    :any:`notmuch(1)`.
302
303 2. File specified by :envvar:`NOTMUCH_CONFIG` environment variable.
304
305 3. ``$XDG_CONFIG_HOME/notmuch/<profile>/config`` where ``<profile>``
306    is defined by :envvar:`NOTMUCH_PROFILE` environment variable if
307    set, ``$XDG_CONFIG_HOME/notmuch/default/config`` otherwise.
308
309 4. ``$HOME/.notmuch-config.<profile>`` where ``<profile>`` is defined
310    by :envvar:`NOTMUCH_PROFILE` environment variable if set,
311    ``$HOME/.notmuch-config`` otherwise.
312
313 .. _database:
314
315 DATABASE LOCATION
316 -----------------
317
318 Notmuch database search order:
319
320 1. Directory specified by :envvar:`NOTMUCH_DATABASE` environment variable.
321
322 2. Directory specified by config key ``database.path``.
323
324 3. ``$XDG_DATA_HOME/notmuch/<profile>`` where ``<profile>``
325    is defined by :envvar:`NOTMUCH_PROFILE` environment variable if
326    set, ``$XDG_DATA_HOME/notmuch/default`` otherwise.
327
328 4. Directory specified by :envvar:`MAILDIR` environment variable.
329
330 5. ``$HOME/mail``
331
332 HOOKS
333 -----
334
335 Notmuch hook directory search order:
336
337 1. Directory specified by ``database.hook_dir`` configuration option.
338
339 2. ``$XDG_CONFIG_HOME/notmuch/<profile>/hooks`` where ``<profile>``
340    is defined by :envvar:`NOTMUCH_PROFILE` environment variable if
341    set, ``$XDG_CONFIG_HOME/notmuch/default/hooks`` otherwise.
342
343 3. ``<database.path>/.notmuch/hooks``
344
345 SEE ALSO
346 ========
347
348 :any:`notmuch(1)`,
349 :any:`notmuch-count(1)`,
350 :any:`notmuch-dump(1)`,
351 :any:`notmuch-hooks(5)`,
352 :any:`notmuch-insert(1)`,
353 :any:`notmuch-new(1)`,
354 :any:`notmuch-properties(7)`,
355 :any:`notmuch-reply(1)`,
356 :any:`notmuch-restore(1)`,
357 :any:`notmuch-search(1)`,
358 :any:`notmuch-search-terms(7)`,
359 :any:`notmuch-show(1)`,
360 :any:`notmuch-tag(1)`