]> git.notmuchmail.org Git - notmuch/blob - doc/man1/notmuch-config.rst
doc: use hyperlinks for config options in notmuch-insert(1)
[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 built_with.<name>
59     Compile time feature <name>. Current possibilities include
60     "retry_lock" (configure option, included by default).
61     (since notmuch 0.30, "compact" and "field_processor" are
62     always included.)
63
64 database.autocommit
65
66     How often to commit transactions to disk. `0` means wait until
67     command completes, otherwise an integer `n` specifies to commit to
68     disk after every `n` completed transactions.
69
70     History: this configuration value was introduced in notmuch 0.33.
71
72 database.backup_dir
73     Directory to store tag dumps when upgrading database.
74
75     History: this configuration value was introduced in notmuch 0.32.
76
77     Default: A sibling directory of the Xapian database called
78     `backups`.
79
80 database.hook_dir
81     Directory containing hooks run by notmuch commands. See
82     :any:`notmuch-hooks(5)`.
83
84     History: this configuration value was introduced in notmuch 0.32.
85
86     Default: See HOOKS, below.
87
88 .. _database.mail_root:
89
90 database.mail_root
91     The top-level directory where your mail currently exists and to
92     where mail will be delivered in the future. Files should be
93     individual email messages.
94
95     History: this configuration value was introduced in notmuch 0.32.
96
97     Default: For compatibility with older configurations, the value of
98     database.path is used if **database.mail\_root** is unset.
99
100 database.path
101     Notmuch will store its database here, (in
102     sub-directory named ``.notmuch`` if **database.mail\_root**
103     is unset).
104
105     Default: see :ref:`database`
106
107 .. _index.decrypt:
108
109 index.decrypt
110     Policy for decrypting encrypted messages during indexing.  Must be
111     one of: ``false``, ``auto``, ``nostash``, or ``true``.
112
113     When indexing an encrypted e-mail message, if this variable is set
114     to ``true``, notmuch will try to decrypt the message and index the
115     cleartext, stashing a copy of any discovered session keys for the
116     message.  If ``auto``, it will try to index the cleartext if a
117     stashed session key is already known for the message (e.g. from a
118     previous copy), but will not try to access your secret keys.  Use
119     ``false`` to avoid decrypting even when a stashed session key is
120     already present.
121
122     ``nostash`` is the same as ``true`` except that it will not stash
123     newly-discovered session keys in the database.
124
125     From the command line (i.e. during :any:`notmuch-new(1)`,
126     :any:`notmuch-insert(1)`, or :any:`notmuch-reindex(1)`), the user can
127     override the database's stored decryption policy with the
128     ``--decrypt=`` option.
129
130     Here is a table that summarizes the functionality of each of these
131     policies:
132
133     +------------------------+-------+------+---------+------+
134     |                        | false | auto | nostash | true |
135     +========================+=======+======+=========+======+
136     | Index cleartext using  |       |  X   |    X    |  X   |
137     | stashed session keys   |       |      |         |      |
138     +------------------------+-------+------+---------+------+
139     | Index cleartext        |       |      |    X    |  X   |
140     | using secret keys      |       |      |         |      |
141     +------------------------+-------+------+---------+------+
142     | Stash session keys     |       |      |         |  X   |
143     +------------------------+-------+------+---------+------+
144     | Delete stashed session |   X   |      |         |      |
145     | keys on reindex        |       |      |         |      |
146     +------------------------+-------+------+---------+------+
147
148     Stashed session keys are kept in the database as properties
149     associated with the message.  See ``session-key`` in
150     :any:`notmuch-properties(7)` for more details about how they can be
151     useful.
152
153     Be aware that the notmuch index is likely sufficient (and a
154     stashed session key is certainly sufficient) to reconstruct the
155     cleartext of the message itself, so please ensure that the notmuch
156     message index is adequately protected.  DO NOT USE
157     ``index.decrypt=true`` or ``index.decrypt=nostash`` without
158     considering the security of your index.
159
160     Default: ``auto``.
161
162 .. _index.header:
163
164 index.header.<prefix>
165     Define the query prefix <prefix>, based on a mail header. For
166     example ``index.header.List=List-Id`` will add a probabilistic
167     prefix ``List:`` that searches the ``List-Id`` field.  User
168     defined prefixes must not start with 'a'...'z'; in particular
169     adding a prefix with same name as a predefined prefix is not
170     supported. See :any:`notmuch-search-terms(7)` for a list of existing
171     prefixes, and an explanation of probabilistic prefixes.
172
173 .. _maildir.synchronize_flags:
174
175 maildir.synchronize\_flags
176     If true, then the following maildir flags (in message filenames)
177     will be synchronized with the corresponding notmuch tags:
178
179     +--------+-----------------------------------------------+
180     | Flag   | Tag                                           |
181     +========+===============================================+
182     | D      | draft                                         |
183     +--------+-----------------------------------------------+
184     | F      | flagged                                       |
185     +--------+-----------------------------------------------+
186     | P      | passed                                        |
187     +--------+-----------------------------------------------+
188     | R      | replied                                       |
189     +--------+-----------------------------------------------+
190     | S      | unread (added when 'S' flag is not present)   |
191     +--------+-----------------------------------------------+
192
193     The :any:`notmuch-new(1)` command will notice flag changes in
194     filenames and update tags, while the :any:`notmuch-tag(1)` and
195     :any:`notmuch-restore(1)` commands will notice tag changes and
196     update flags in filenames.
197
198     If there have been any changes in the maildir (new messages added,
199     old ones removed or renamed, maildir flags changed, etc.), it is
200     advisable to run :any:`notmuch-new(1)` before
201     :any:`notmuch-tag(1)` or :any:`notmuch-restore(1)` commands to
202     ensure the tag changes are properly synchronized to the maildir
203     flags, as the commands expect the database and maildir to be in
204     sync.
205
206     Default: ``true``.
207
208 .. _new.ignore:
209
210 new.ignore
211     A list to specify files and directories that will not be searched
212     for messages by :any:`notmuch-new(1)`. Each entry in the list is either:
213
214     A file or a directory name, without path, that will be ignored,
215     regardless of the location in the mail store directory hierarchy.
216
217     Or:
218
219     A regular expression delimited with // that will be matched
220     against the path of the file or directory relative to the database
221     path. Matching files and directories will be ignored. The
222     beginning and end of string must be explicitly anchored. For
223     example, /.*/foo$/ would match "bar/foo" and "bar/baz/foo", but
224     not "foo" or "bar/foobar".
225
226     Default: empty list.
227
228 .. _new.tags:
229
230 new.tags
231     A list of tags that will be added to all messages incorporated by
232     **notmuch new**.
233
234     Default: ``unread;inbox``.
235
236 query.<name>
237     Expansion for named query called <name>. See
238     :any:`notmuch-search-terms(7)` for more information about named
239     queries.
240
241 search.exclude\_tags
242     A list of tags that will be excluded from search results by
243     default. Using an excluded tag in a query will override that
244     exclusion.
245
246     Default: empty list. Note that :any:`notmuch-setup(1)` puts
247     ``deleted;spam`` here when creating new configuration file.
248
249 .. _show.extra_headers:
250
251 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 squery.<name>
264     Expansion for named query called <name>, using s-expression syntax. See
265     :any:`notmuch-sexp-queries(7)` for more information about s-expression
266     queries.
267
268 user.name
269     Your full name.
270
271     Default: ``$NAME`` variable if set, otherwise read from
272     ``/etc/passwd``.
273
274 user.other\_email
275     A list of other email addresses at which you receive email
276     (see also, :ref:`user.primary_email <user.primary_email>`).
277
278     Default: not set.
279
280 .. _user.primary_email:
281
282 user.primary\_email
283     Your primary email address.
284
285     Default: ``$EMAIL`` variable if set, otherwise constructed from
286     the username and hostname of the current machine.
287
288 FILES
289 =====
290
291 .. _config_search:
292
293 CONFIGURATION
294 -------------
295
296 Notmuch configuration file search order:
297
298 1. File specified by :option:`notmuch --config` global option; see
299    :any:`notmuch(1)`.
300
301 2. File specified by :envvar:`NOTMUCH_CONFIG` environment variable.
302
303 3. ``$XDG_CONFIG_HOME/notmuch/<profile>/config`` where ``<profile>``
304    is defined by :envvar:`NOTMUCH_PROFILE` environment variable if
305    set, ``$XDG_CONFIG_HOME/notmuch/default/config`` otherwise.
306
307 4. ``$HOME/.notmuch-config.<profile>`` where ``<profile>`` is defined
308    by :envvar:`NOTMUCH_PROFILE` environment variable if set,
309    ``$HOME/.notmuch-config`` otherwise.
310
311 .. _database:
312
313 DATABASE LOCATION
314 -----------------
315
316 Notmuch database search order:
317
318 1. Directory specified by :envvar:`NOTMUCH_DATABASE` environment variable.
319
320 2. Directory specified by config key ``database.path``.
321
322 3. ``$XDG_DATA_HOME/notmuch/<profile>`` where ``<profile>``
323    is defined by :envvar:`NOTMUCH_PROFILE` environment variable if
324    set, ``$XDG_DATA_HOME/notmuch/default`` otherwise.
325
326 4. Directory specified by :envvar:`MAILDIR` environment variable.
327
328 5. ``$HOME/mail``
329
330 HOOKS
331 -----
332
333 Notmuch hook directory search order:
334
335 1. Directory specified by ``database.hook_dir`` configuration option.
336
337 2. ``$XDG_CONFIG_HOME/notmuch/<profile>/hooks`` where ``<profile>``
338    is defined by :envvar:`NOTMUCH_PROFILE` environment variable if
339    set, ``$XDG_CONFIG_HOME/notmuch/default/hooks`` otherwise.
340
341 3. ``<database.path>/.notmuch/hooks``
342
343 SEE ALSO
344 ========
345
346 :any:`notmuch(1)`,
347 :any:`notmuch-count(1)`,
348 :any:`notmuch-dump(1)`,
349 :any:`notmuch-hooks(5)`,
350 :any:`notmuch-insert(1)`,
351 :any:`notmuch-new(1)`,
352 :any:`notmuch-properties(7)`,
353 :any:`notmuch-reply(1)`,
354 :any:`notmuch-restore(1)`,
355 :any:`notmuch-search(1)`,
356 :any:`notmuch-search-terms(7)`,
357 :any:`notmuch-show(1)`,
358 :any:`notmuch-tag(1)`