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 as true, 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=true or --decrypt=nostash without 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 πŸŽ€

  • notmuch
  • notmuch-compact
  • notmuch-config
  • notmuch-count
  • notmuch-dump
  • notmuch-hooks
  • notmuch-insert
  • notmuch-new
  • notmuch-reply
  • notmuch-restore
  • notmuch-search
  • notmuch-search-terms
  • notmuch-show
  • notmuch-tag

πŸ‘‘ AUTHOR πŸ‘‘

Carl Worth and many others 🫢 (a whole squad, truly)

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