1NOTMUCH-HOOKS(5) notmuch NOTMUCH-HOOKS(5)
2
3
4
6 notmuch-hooks - hooks for notmuch
7
9 <hook_dir>/{pre-new, post-new, post-insert}
10
12 Hooks are scripts (or arbitrary executables or symlinks to such) that
13 notmuch invokes before and after certain actions. These scripts reside
14 in a directory defined as described in notmuch-config(1). They must
15 have executable permissions.
16
17 The currently available hooks are described below.
18
19 pre-new
20 This hook is invoked by the notmuch-new(1) command before scan‐
21 ning or importing new messages into the database. If this hook
22 exits with a non-zero status, notmuch will abort further pro‐
23 cessing of the notmuch-new(1) command.
24
25 Typically this hook is used for fetching or delivering new mail
26 to be imported into the database.
27
28 post-new
29 This hook is invoked by the notmuch-new(1) command after any new
30 messages have been imported into the database and initial tags
31 have been applied. The hook will not be run if there have been
32 any errors during the scan or import.
33
34 Typically this hook is used to perform additional query-based
35 tagging on the imported messages.
36
37 post-insert
38 This hook is invoked by the notmuch-insert(1) command after the
39 message has been delivered, added to the database, and initial
40 tags have been applied. The hook will not be run if there have
41 been any errors during the message delivery; what is regarded as
42 successful delivery depends on the --keep option.
43
44 Typically this hook is used to perform additional query-based
45 tagging on the delivered messages.
46
48 notmuch(1), notmuch-config(1), notmuch-count(1), notmuch-dump(1), not‐
49 much-insert(1), notmuch-new(1), notmuch-reply(1), notmuch-restore(1),
50 notmuch-search(1), notmuch-search-terms(7), notmuch-show(1), not‐
51 much-tag(1)
52
54 Carl Worth and many others
55
57 2009-2022, Carl Worth and many others
58
59
60
61
620.36 Jun 25, 2022 NOTMUCH-HOOKS(5)