(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
fails. Ignore these errors and return exit status 0 to
indicate succesful mail delivery.
+ ``--no-hooks``
+ Prevent hooks from being run.
+
EXIT STATUS
===========
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
========
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
========
const char *folder = NULL;
notmuch_bool_t create_folder = FALSE;
notmuch_bool_t keep = FALSE;
+ notmuch_bool_t no_hooks = FALSE;
notmuch_bool_t synchronize_flags;
const char *maildir;
char *newpath;
{ NOTMUCH_OPT_STRING, &folder, "folder", 0, 0 },
{ NOTMUCH_OPT_BOOLEAN, &create_folder, "create-folder", 0, 0 },
{ NOTMUCH_OPT_BOOLEAN, &keep, "keep", 0, 0 },
+ { NOTMUCH_OPT_BOOLEAN, &no_hooks, "no-hooks", 'n', 0 },
{ NOTMUCH_OPT_END, 0, 0, 0, 0 }
};
}
}
+ if (! no_hooks && status == NOTMUCH_STATUS_SUCCESS) {
+ /* Ignore hook failures. */
+ notmuch_run_hook (db_path, "post-insert");
+ }
+
return status ? EXIT_FAILURE : EXIT_SUCCESS;
}