]> git.notmuchmail.org Git - notmuch/blob - doc/man5/notmuch-hooks.rst
emacs: Add new option notmuch-search-hide-excluded
[notmuch] / doc / man5 / notmuch-hooks.rst
1 .. _notmuch-hooks(5):
2
3 =============
4 notmuch-hooks
5 =============
6
7 SYNOPSIS
8 ========
9
10 <hook_dir>/{pre-new, post-new, post-insert}
11
12 DESCRIPTION
13 ===========
14
15 Hooks are scripts (or arbitrary executables or symlinks to such) that
16 notmuch invokes before and after certain actions. These scripts reside
17 in a directory defined as described in :any:`notmuch-config(1)`. They
18 must have executable permissions.
19
20 The currently available hooks are described below.
21
22 pre-new
23     This hook is invoked by the :any:`notmuch-new(1)` command before
24     scanning or importing new messages into the database. If this hook
25     exits with a non-zero status, notmuch will abort further
26     processing of the :any:`notmuch-new(1)` command.
27
28     Typically this hook is used for fetching or delivering new mail to
29     be imported into the database.
30
31 post-new
32     This hook is invoked by the :any:`notmuch-new(1)` command after
33     any new messages have been imported into the database and initial
34     tags have been applied. The hook will not be run if there have
35     been any errors during the scan or import.
36
37     Typically this hook is used to perform additional query-based
38     tagging on the imported messages.
39
40 post-insert
41     This hook is invoked by the :any:`notmuch-insert(1)` command after
42     the message has been delivered, added to the database, and initial
43     tags have been applied. The hook will not be run if there have
44     been any errors during the message delivery; what is regarded as
45     successful delivery depends on the ``--keep`` option.
46
47     Typically this hook is used to perform additional query-based
48     tagging on the delivered messages.
49
50 SEE ALSO
51 ========
52
53 :any:`notmuch(1)`,
54 :any:`notmuch-config(1)`,
55 :any:`notmuch-count(1)`,
56 :any:`notmuch-dump(1)`,
57 :any:`notmuch-insert(1)`,
58 :any:`notmuch-new(1)`,
59 :any:`notmuch-reply(1)`,
60 :any:`notmuch-restore(1)`,
61 :any:`notmuch-search(1)`,
62 :any:`notmuch-search-terms(7)`,
63 :any:`notmuch-show(1)`,
64 :any:`notmuch-tag(1)`