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