1 .. _notmuch-reindex(1):
10 **notmuch** **reindex** [*option* ...] <*search-term*> ...
15 Re-index all messages matching the search terms.
17 See :any:`notmuch-search-terms(7)` for details of the supported syntax for
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.
24 Supported options for **reindex** include
28 .. option:: --decrypt=(true|nostash|auto|false)
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.
37 ``nostash`` is the same as ``true`` except that it will not stash
38 newly-discovered session keys in the database.
40 If ``false``, notmuch reindex will also delete any stashed session
41 keys for all messages matching the search terms.
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
50 See also ``index.decrypt`` in :any:`notmuch-config(1)`.
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
63 notmuch reindex --decrypt=true id:1234567@example.com
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:
73 notmuch config set index.decrypt true
74 notmuch reindex tag:encrypted and not property:index.decryption=success
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:
85 notmuch config set index.decrypt false
86 notmuch reindex property:index.decryption=success
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)`