.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "NOTMUCH-HOOKS" "5" "Feb 05, 2024" "0.38.2" "notmuch" .SH NAME notmuch-hooks \- hooks for notmuch .SH SYNOPSIS .sp /{pre\-new, post\-new, post\-insert} .SH DESCRIPTION .sp Hooks are scripts (or arbitrary executables or symlinks to such) that notmuch invokes before and after certain actions. These scripts reside in a directory defined as described in \fI\%notmuch\-config\fP\&. They must have executable permissions. .sp The currently available hooks are described below. .INDENT 0.0 .TP .B pre\-new This hook is invoked by the \fI\%notmuch\-new\fP command before scanning or importing new messages into the database. If this hook exits with a non\-zero status, notmuch will abort further processing of the \fI\%notmuch\-new\fP command. .sp Typically this hook is used for fetching or delivering new mail to be imported into the database. .TP .B post\-new This hook is invoked by the \fI\%notmuch\-new\fP command after any new messages have been imported into the database and initial tags have been applied. The hook will not be run if there have been any errors during the scan or import. .sp Typically this hook is used to perform additional query\-based tagging on the imported messages. .TP .B post\-insert This hook is invoked by the \fI\%notmuch\-insert\fP 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 successful delivery depends on the \fB\-\-keep\fP option. .sp Typically this hook is used to perform additional query\-based tagging on the delivered messages. .UNINDENT .SH SEE ALSO .sp \fI\%notmuch\fP, \fI\%notmuch\-config\fP, \fI\%notmuch\-count\fP, \fI\%notmuch\-dump\fP, \fI\%notmuch\-insert\fP, \fI\%notmuch\-new\fP, \fI\%notmuch\-reply\fP, \fI\%notmuch\-restore\fP, \fI\%notmuch\-search\fP, \fI\%notmuch\-search\-terms\fP, \fI\%notmuch\-show\fP, \fI\%notmuch\-tag\fP .SH AUTHOR Carl Worth and many others .SH COPYRIGHT 2009-2024, Carl Worth and many others .\" Generated by docutils manpage writer. .