]> git.notmuchmail.org Git - notmuch/blob - doc/man5/notmuch-hooks.rst
493abf20f0039a62e17355e5dc1fe757579f40be
[notmuch] / doc / man5 / notmuch-hooks.rst
1 =============
2 notmuch-hooks
3 =============
4
5 SYNOPSIS
6 ========
7
8         $DATABASEDIR/.notmuch/hooks/*
9
10 DESCRIPTION
11 ===========
12
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.
17
18 The currently available hooks are described below.
19
20     **pre-new**
21         This hook is invoked by the **new** command before scanning or
22         importing new messages into the database. If this hook exits
23         with a non-zero status, notmuch will abort further processing of
24         the **new** command.
25
26         Typically this hook is used for fetching or delivering new mail
27         to be imported into the database.
28
29     **post-new**
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.
34
35         Typically this hook is used to perform additional query-based
36         tagging on the imported messages.
37
38 SEE ALSO
39 ========
40
41 **notmuch(1)**, **notmuch-config(1)**, **notmuch-count(1)**,
42 **notmuch-dump(1)**, **notmuch-insert(1)**, **notmuch-new(1)**,
43 **notmuch-reply(1)**, **notmuch-restore(1)**, **notmuch-search(1)**,
44 **notmuch-search-terms(7)**, **notmuch-show(1)**, **notmuch-tag(1)**