]> git.notmuchmail.org Git - notmuch/blob - doc/man1/notmuch-reindex.rst
emacs: Add new option notmuch-search-hide-excluded
[notmuch] / doc / man1 / notmuch-reindex.rst
1 .. _notmuch-reindex(1):
2
3 ===============
4 notmuch-reindex
5 ===============
6
7 SYNOPSIS
8 ========
9
10 **notmuch** **reindex** [*option* ...] <*search-term*> ...
11
12 DESCRIPTION
13 ===========
14
15 Re-index all messages matching the search terms.
16
17 See :any:`notmuch-search-terms(7)` for details of the supported syntax for
18 <*search-term*\ >.
19
20 The **reindex** command searches for all messages matching the
21 supplied search terms, and re-creates the full-text index on these
22 messages using the supplied options.
23
24 Supported options for **reindex** include
25
26 .. program:: reindex
27
28 .. option:: --decrypt=(true|nostash|auto|false)
29
30    If ``true``, when encountering an encrypted message, try to
31    decrypt it while reindexing, stashing any session keys discovered.
32    If ``auto``, and notmuch already knows about a session key for the
33    message, it will try decrypting using that session key but will
34    not try to access the user's secret keys.  If decryption is
35    successful, index the cleartext itself.
36
37    ``nostash`` is the same as ``true`` except that it will not stash
38    newly-discovered session keys in the database.
39
40    If ``false``, notmuch reindex will also delete any stashed session
41    keys for all messages matching the search terms.
42
43    Be aware that the index is likely sufficient (and a stashed
44    session key is certainly sufficient) to reconstruct the cleartext
45    of the message itself, so please ensure that the notmuch message
46    index is adequately protected. DO NOT USE ``--decrypt=true`` or
47    ``--decrypt=nostash`` without considering the security of your
48    index.
49
50    See also ``index.decrypt`` in :any:`notmuch-config(1)`.
51
52 EXAMPLES
53 ========
54
55 A user just received an encrypted message without indexing its
56 cleartext.  After reading it (via ``notmuch show --decrypt=true``),
57 they decide that they want to index its cleartext so that they can
58 easily find it later and read it without having to have access to
59 their secret keys:
60
61 ::
62
63  notmuch reindex --decrypt=true id:1234567@example.com
64
65 A user wants to change their policy going forward to start indexing
66 cleartext.  But they also want indexed access to the cleartext of all
67 previously-received encrypted messages.  Some messages might have
68 already been indexed in the clear (as in the example above). They can
69 ask notmuch to just reindex the not-yet-indexed messages:
70
71 ::
72
73   notmuch config set index.decrypt true
74   notmuch reindex tag:encrypted and not property:index.decryption=success
75
76 Later, the user changes their mind, and wants to stop indexing
77 cleartext (perhaps their threat model has changed, or their trust in
78 their index store has been shaken).  They also want to clear all of
79 their old cleartext from the index.  Note that they compact the
80 database afterward as a workaround for
81 https://trac.xapian.org/ticket/742:
82
83 ::
84
85   notmuch config set index.decrypt false
86   notmuch reindex property:index.decryption=success
87   notmuch compact
88
89 SEE ALSO
90 ========
91
92 :any:`notmuch(1)`,
93 :any:`notmuch-compact(1)`,
94 :any:`notmuch-config(1)`,
95 :any:`notmuch-count(1)`,
96 :any:`notmuch-dump(1)`,
97 :any:`notmuch-hooks(5)`,
98 :any:`notmuch-insert(1)`,
99 :any:`notmuch-new(1)`,
100 :any:`notmuch-reply(1)`,
101 :any:`notmuch-restore(1)`,
102 :any:`notmuch-search(1)`,
103 :any:`notmuch-search-terms(7)`,
104 :any:`notmuch-show(1)`,
105 :any:`notmuch-tag(1)`