1 <h1>NOTMUCH-INSERT(1)</h1>
5 notmuch-insert - add a message to the maildir and notmuch database
10 <b>notmuch</b> <b>insert</b> [option ...] [+<<u>tag</u>>|-<<u>tag</u>> ...]
15 <b>notmuch</b> <b>insert</b> reads a message from standard input and delivers it into
16 the maildir directory given by configuration option <b>database.path</b>, then
17 incorporates the message into the notmuch database. It is an alterna‐
18 tive to using a separate tool to deliver the message then running <b>not-</b>
19 <b>much</b> <b>new</b> afterwards.
21 The new message will be tagged with the tags specified by the <b>new.tags</b>
22 configuration option, then by operations specified on the command-line:
23 tags prefixed by '+' are added while those prefixed by '-' are removed.
25 If the new message is a duplicate of an existing message in the data‐
26 base (it has same Message-ID), it will be added to the maildir folder
27 and notmuch database, but the tags will not be changed.
29 The <b>insert</b> command supports hooks. See <a href='../notmuch-hooks-5/'>notmuch-hooks</a>(5) for more
32 Option arguments must appear before any tag operation arguments. Sup‐
33 ported options for <b>insert</b> include
35 <b>--folder=<</b>folder<b>></b>
36 Deliver the message to the specified folder, relative to the
37 top-level directory given by the value of <b>database.path</b>. The
38 default is the empty string, which means delivering to the
41 <b>--create-folder</b>
42 Try to create the folder named by the <b>--folder</b> option, if it
43 does not exist. Otherwise the folder must already exist for mail
46 <b>--keep</b> Keep the message file if indexing fails, and keep the message
47 indexed if applying tags or maildir flag synchronization fails.
48 Ignore these errors and return exit status 0 to indicate suc‐
49 cessful mail delivery.
52 Prevent hooks from being run.
54 <b>--decrypt=(true|nostash|auto|false)</b>
55 If <b>true</b> and the message is encrypted, try to decrypt the message
56 while indexing, stashing any session keys discovered. If <b>auto</b>,
57 and notmuch already knows about a session key for the message,
58 it will try decrypting using that session key but will not try
59 to access the user's secret keys. If decryption is successful,
60 index the cleartext itself. Either way, the message is always
61 stored to disk in its original form (ciphertext).
63 <b>nostash</b> is the same as <b>true</b> except that it will not stash
64 newly-discovered session keys in the database.
66 Be aware that the index is likely sufficient (and a stashed ses‐
67 sion key is certainly sufficient) to reconstruct the cleartext
68 of the message itself, so please ensure that the notmuch message
69 index is adequately protected. DO NOT USE <b>--decrypt=true</b> or
70 <b>--decrypt=nostash</b> without considering the security of your
73 See also <b>index.decrypt</b> in <a href='../notmuch-config-1/'>notmuch-config</a>(1).
78 This command returns exit status 0 on successful mail delivery,
79 non-zero otherwise. The default is to indicate failed mail delivery on
80 any errors, including message file delivery to the filesystem, message
81 indexing to Notmuch database, changing tags, and synchronizing tags to
82 maildir flags. The <b>--keep</b> option may be used to settle for successful
83 message file delivery.
85 This command supports the following special exit status code for errors
86 most likely to be temporary in nature, e.g. failure to get a database
89 <b>75</b> <b>(EX</b>_<b>TEMPFAIL)</b>
90 A temporary failure occurred; the user is invited to retry.
92 The exit status of the <b>post-insert</b> hook does not affect the exit status
93 of the <b>insert</b> command.
98 <a href='../notmuch-1/'>notmuch</a>(1), <a href='../notmuch-config-1/'>notmuch-config</a>(1), <a href='../notmuch-count-1/'>notmuch-count</a>(1), <a href='../notmuch-dump-1/'>notmuch-dump</a>(1), <a href='../notmuch-hooks-5/'>not‐</a>
99 <a href='../notmuch-hooks-5/'>much-hooks</a>(5), <a href='../notmuch-reply-1/'>notmuch-reply</a>(1), <a href='../notmuch-restore-1/'>notmuch-restore</a>(1), <a href='../notmuch-search-1/'>notmuch-search</a>(1),
100 <a href='../notmuch-search-terms-7/'>notmuch-search-terms</a>(7), <a href='../notmuch-show-1/'>notmuch-show</a>(1), <a href='../notmuch-tag-1/'>notmuch-tag</a>(1)
105 Carl Worth and many others
110 2009-2018, Carl Worth and many others