diff options
| author | Jani Nikula <jani@nikula.org> | 2014-09-28 17:40:59 +0300 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2014-10-28 19:19:30 +0100 |
| commit | 19c09d870f18f549df3d9f5a3a30a20f7279b07a (patch) | |
| tree | 2172a8fd4f8ef1ce02aa3bb899034e06217378f9 /doc | |
| parent | 50eedb48ec7b8b961d3f865d75bb03a57b062d4f (diff) | |
cli/insert: add post-insert hook
The post-new hook might no longer be needed or run very often if
notmuch insert is being used. Therefore a post-insert hook is needed
(arguably pre-insert not so much, so don't add one). Also add the
--no-hooks option to skip hooks.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/man1/notmuch-insert.rst | 9 | ||||
| -rw-r--r-- | doc/man5/notmuch-hooks.rst | 11 |
2 files changed, 20 insertions, 0 deletions
diff --git a/doc/man1/notmuch-insert.rst b/doc/man1/notmuch-insert.rst index e396f6cf..2c9c0d02 100644 --- a/doc/man1/notmuch-insert.rst +++ b/doc/man1/notmuch-insert.rst @@ -25,6 +25,9 @@ If the new message is a duplicate of an existing message in the database (it has same Message-ID), it will be added to the maildir folder and notmuch database, but the tags will not be changed. +The **insert** command supports hooks. See **notmuch-hooks(5)** for +more details on hooks. + Option arguments must appear before any tag operation arguments. Supported options for **insert** include @@ -44,6 +47,9 @@ Supported options for **insert** include fails. Ignore these errors and return exit status 0 to indicate succesful mail delivery. + ``--no-hooks`` + Prevent hooks from being run. + EXIT STATUS =========== @@ -54,6 +60,9 @@ indexing to Notmuch database, changing tags, and synchronizing tags to maildir flags. The ``--keep`` option may be used to settle for successful message file delivery. +The exit status of the **post-insert** hook does not affect the exit +status of the **insert** command. + SEE ALSO ======== diff --git a/doc/man5/notmuch-hooks.rst b/doc/man5/notmuch-hooks.rst index 493abf20..f1c2528c 100644 --- a/doc/man5/notmuch-hooks.rst +++ b/doc/man5/notmuch-hooks.rst @@ -35,6 +35,17 @@ The currently available hooks are described below. Typically this hook is used to perform additional query-based tagging on the imported messages. + **post-insert** + + This hook is invoked by the **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; what is regarded + as succesful delivery depends on the ``--keep`` option. + + Typically this hook is used to perform additional query-based + tagging on the delivered messages. + SEE ALSO ======== |
