8 $DATABASEDIR/.notmuch/hooks/*
13 Hooks are scripts (or arbitrary executables or symlinks to such) that
14 notmuch invokes before and after certain actions. These scripts reside
15 in the .notmuch/hooks directory within the database directory and must
16 have executable permissions.
18 The currently available hooks are described below.
21 This hook is invoked by the **new** command before scanning or
22 importing new messages into the database. If this hook exits with
23 a non-zero status, notmuch will abort further processing of the
26 Typically this hook is used for fetching or delivering new mail to
27 be imported into the database.
30 This hook is invoked by the **new** command after new messages
31 have been imported into the database and initial tags have been
32 applied. The hook will not be run if there have been any errors
33 during the scan or import.
35 Typically this hook is used to perform additional query-based
36 tagging on the imported messages.
39 This hook is invoked by the **insert** command after the message
40 has been delivered, added to the database, and initial tags have
41 been applied. The hook will not be run if there have been any
42 errors during the message delivery; what is regarded as successful
43 delivery depends on the ``--keep`` option.
45 Typically this hook is used to perform additional query-based
46 tagging on the delivered messages.
52 **notmuch-config(1)**,
55 **notmuch-insert(1)**,
58 **notmuch-restore(1)**,
59 **notmuch-search(1)**,
60 **notmuch-search-terms(7)**,