10 **notmuch** **insert** [option ...] [+<*tag*>|-<*tag*> ...]
15 **notmuch insert** reads a message from standard input and delivers it
16 into the maildir directory given by configuration option
17 **database.path**, then incorporates the message into the notmuch
18 database. It is an alternative to using a separate tool to deliver the
19 message then running :any:`notmuch-new(1)` afterwards.
21 The new message will be tagged with the tags specified by the
22 **new.tags** configuration option, then by operations specified on the
23 command-line: tags prefixed by '+' are added while those prefixed by '-'
26 If the new message is a duplicate of an existing message in the database
27 (it has same Message-ID), it will be added to the maildir folder and
28 notmuch database, but the tags will not be changed.
30 The **insert** command supports hooks. See :any:`notmuch-hooks(5)` for
31 more details on hooks.
33 Option arguments must appear before any tag operation arguments.
34 Supported options for **insert** include
36 ``--folder=<``\ folder\ **>**
37 Deliver the message to the specified folder, relative to the
38 top-level directory given by the value of **database.path**. The
39 default is the empty string, which means delivering to the
43 Try to create the folder named by the ``--folder`` option, if it
44 does not exist. Otherwise the folder must already exist for mail
48 Keep the message file if indexing fails, and keep the message
49 indexed if applying tags or maildir flag synchronization
50 fails. Ignore these errors and return exit status 0 to indicate
51 successful mail delivery.
54 Prevent hooks from being run.
57 When writing mail to the mailbox, allow it to be read by users
58 other than the current user. Note that this does not override
59 umask. By default, delivered mail is only readable by the current
62 ``--decrypt=(true|nostash|auto|false)``
63 If ``true`` and the message is encrypted, try to decrypt the
64 message while indexing, stashing any session keys discovered. If
65 ``auto``, and notmuch already knows about a session key for the
66 message, it will try decrypting using that session key but will
67 not try to access the user's secret keys. If decryption is
68 successful, index the cleartext itself. Either way, the message
69 is always stored to disk in its original form (ciphertext).
71 ``nostash`` is the same as ``true`` except that it will not stash
72 newly-discovered session keys in the database.
74 Be aware that the index is likely sufficient (and a stashed
75 session key is certainly sufficient) to reconstruct the cleartext
76 of the message itself, so please ensure that the notmuch message
77 index is adequately protected. DO NOT USE ``--decrypt=true`` or
78 ``--decrypt=nostash`` without considering the security of your
81 See also ``index.decrypt`` in :any:`notmuch-config(1)`.
86 This command returns exit status 0 on successful mail delivery,
87 non-zero otherwise. The default is to indicate failed mail delivery on
88 any errors, including message file delivery to the filesystem, message
89 indexing to Notmuch database, changing tags, and synchronizing tags to
90 maildir flags. The ``--keep`` option may be used to settle for
91 successful message file delivery.
93 This command supports the following special exit status code for
94 errors most likely to be temporary in nature, e.g. failure to get a
98 A temporary failure occurred; the user is invited to retry.
100 The exit status of the **post-insert** hook does not affect the exit
101 status of the **insert** command.
107 :any:`notmuch-config(1)`,
108 :any:`notmuch-count(1)`,
109 :any:`notmuch-dump(1)`,
110 :any:`notmuch-hooks(5)`,
111 :any:`notmuch-reply(1)`,
112 :any:`notmuch-restore(1)`,
113 :any:`notmuch-search(1)`,
114 :any:`notmuch-search-terms(7)`,
115 :any:`notmuch-show(1)`,
116 :any:`notmuch-tag(1)`