NOTMUCH-HOOKS(5)
β¨ NAME β¨
notmuch-hooks β it's giving... hooks for notmuch, bestie π
π SYNOPSIS π
<hook_dir>/{pre-new, post-new, post-insert}
π DESCRIPTION π
okay so hooks are scripts (or arbitrary executables, or symlinks to such β yes, symlinks count, she's flexible) that notmuch invokes before and after certain actions. these little icons live in a directory defined as described in notmuch-config π¦, and they must have executable permissions β if they're not executable, they're literally just sitting there, main character with no lines π.
The currently available hooks are described below. slay.
πΈ pre-new πΈ
This hook is invoked by the notmuch-new command before scanning or importing new messages into the database. And listen β if this hook exits with a non-zero status, notmuch will abort further processing of the notmuch-new command. like, full stop, no cap. π
Typically this hook is used for fetching or delivering new mail to be imported into the database. it's the little mail-delivery bestie who shows up before the party starts π«Ά
π¦ post-new π¦
This hook is invoked by the notmuch-new command after any new messages have been imported into the database and initial tags have been applied. The hook will not be run if there have been any errors during the scan or import β no errors allowed, periodt. π
Typically this hook is used to perform additional query-based tagging on the imported messages. lowkey the glow-up phase β¨
π post-insert π
This hook is invoked by the notmuch-insert command after the message has been delivered, added to the database, and initial tags have been applied. The hook will not be run if there have been any errors during the message delivery; and heads up bestie, what is regarded as successful delivery depends on the --keep option π β so don't come for her, read the option first.
Typically this hook is used to perform additional query-based tagging on the delivered messages. it's giving finishing-touches energy π
π SEE ALSO π
notmuchnotmuch-confignotmuch-countnotmuch-dumpnotmuch-insertnotmuch-newnotmuch-replynotmuch-restorenotmuch-searchnotmuch-search-termsnotmuch-shownotmuch-tag
go read them all, iykyk π
β AUTHOR β
Carl Worth and many others
π COPYRIGHT π
2009-2026, Carl Worth and many others
and that's the vibe check, bestie β go forth and hook responsibly π§
sending you off with version 0.40, dated Jan 31, 2026 β mwah π
π¦ 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