NOTMUCH-REINDEX(1)
πΈ NOTMUCH-REINDEX πΈ
okay bestie, welcome to notmuch-reindex(1), one of the lil pages from the notmuch manual π sit down, grab a strawberry π, we're gonna re-index some mail.
β¨ NAME β¨
notmuch-reindex β re-index matching messages. that's it. that's the whole vibe. it goes in, it finds your messages, it builds that full-text index again. iconic behavior honestly.
π¦ SYNOPSIS π¦
notmuch reindex [option ...] <search-term> ...
π DESCRIPTION π
so like. the whole point: re-index all messages matching the search terms. every single one that matches. no cap.
need the deets on the search syntax for <search-term>? go read notmuch-search-terms π«Ά it's all there, i promise.
here's the actual flow: reindex searches for all the messages matching the search terms you gave it, and then it re-creates the full-text index on those messages, using whatever options you passed. cute, simple, effective. main character energy fr fr.
Supported options for reindex include:
--decrypt=(true|nostash|auto|false)β the big one, the one you actually need to think about πtrueβ when it bumps into an encrypted message, it'll try to decrypt it while reindexing, and it'll stash any session keys it discovers along the way. if decryption works, it indexes the cleartext itself. periodt.autoβ if notmuch already knows about a session key for that message, it'll try decrypting using that session key, but it will not try to access your secret keys. if decryption succeeds, again: it indexes the cleartext itself.nostashβ same astrue, except it will not stash newly-discovered session keys in the database. so it decrypts, it indexes, it just doesn't hold onto the keys.falseβ and this one does double duty π notmuch reindex will also delete any stashed session keys for all messages matching the search terms.
β οΈ okay real talk, please read this part. be aware that the index is likely sufficient (and a stashed session key is certainly sufficient) to reconstruct the cleartext of the message itself. so please, please ensure that the notmuch message index is adequately protected. DO NOT USE--decrypt=trueor--decrypt=nostashwithout considering the security of your index. like, actually consider it. don't just click. π
See also index.decrypt in notmuch-config π
π EXAMPLES π
Scenario one: a user just received an encrypted message without indexing its cleartext. after reading it (via notmuch show --decrypt=true), they decide they want to index its cleartext so they can easily find it later, and read it without having to have access to their secret keys:
notmuch reindex --decrypt=true id:1234567@example.com
slay. now it's in there.
Scenario two: a user wants to change their policy going forward and start indexing cleartext. but they also want indexed access to the cleartext of all previously-received encrypted messages. some of those messages might have already been indexed in the clear (like in the example above). so they can just ask notmuch to reindex only the not-yet-indexed messages:
notmuch config set index.decrypt true
notmuch reindex tag:encrypted and not property:index.decryption=success
chef's kiss, targeted, precise, no wasted work β¨
Scenario three: later, the user changes their mind and wants to stop indexing cleartext (maybe their threat model changed, or their trust in their index store got shaken π¬). they also want to clear all their old cleartext out of the index. note that they compact the database afterward as a workaround for <https://trac.xapian.org/ticket/742>:
notmuch config set index.decrypt false
notmuch reindex property:index.decryption=success
notmuch compact
don't forget that notmuch compact at the end, bestie, it's load-bearing π
π SEE ALSO π
notmuchnotmuch-compactnotmuch-confignotmuch-countnotmuch-dumpnotmuch-hooksnotmuch-insertnotmuch-newnotmuch-replynotmuch-restorenotmuch-searchnotmuch-search-termsnotmuch-shownotmuch-tag
π AUTHOR π
Carl Worth and many others π«Ά (a whole squad, truly)
π COPYRIGHT π
2009-2026, Carl Worth and many others
and that's the page, babes π§ this was notmuch-reindex, version 0.40, dated Jan 31, 2026. go forth and reindex responsibly π β
π¦ where this page comes from
- fedora 44: notmuch 0.40-1.fc44 Β· GPL-3.0-or-later
- fedora 44: notmuch 0.40-1.fc44 Β· GPL-3.0-or-later
- nixos 26.05: notmuch 0.40
- ubuntu resolute: notmuch 0.40-1ubuntu1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms