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