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 :nmconfig:`database.mail_root`, 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 :nmconfig:`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
38 .. option:: --folder=<folder>
40 Deliver the message to the specified folder, relative to the
41 top-level directory given by the value of :nmconfig:`database.mail_root`. The
42 default is the empty string, which means delivering to the
45 .. option:: --create-folder
47 Try to create the folder named by the ``--folder`` option, if it
48 does not exist. Otherwise the folder must already exist for mail
53 Keep the message file if indexing fails, and keep the message
54 indexed if applying tags or maildir flag synchronization
55 fails. Ignore these errors and return exit status 0 to indicate
56 successful mail delivery.
58 .. option:: --no-hooks
60 Prevent hooks from being run.
62 .. option:: --world-readable
64 When writing mail to the mailbox, allow it to be read by users
65 other than the current user. Note that this does not override
66 umask. By default, delivered mail is only readable by the current
69 .. option:: --decrypt=(true|nostash|auto|false)
71 If ``true`` and the message is encrypted, try to decrypt the
72 message while indexing, stashing any session keys discovered. If
73 ``auto``, and notmuch already knows about a session key for the
74 message, it will try decrypting using that session key but will
75 not try to access the user's secret keys. If decryption is
76 successful, index the cleartext itself. Either way, the message
77 is always stored to disk in its original form (ciphertext).
79 ``nostash`` is the same as ``true`` except that it will not stash
80 newly-discovered session keys in the database.
82 Be aware that the index is likely sufficient (and a stashed
83 session key is certainly sufficient) to reconstruct the cleartext
84 of the message itself, so please ensure that the notmuch message
85 index is adequately protected. DO NOT USE ``--decrypt=true`` or
86 ``--decrypt=nostash`` without considering the security of your
89 See also :nmconfig:`index.decrypt` in :any:`notmuch-config(1)`.
94 Indexing is influenced by the configuration options
95 :nmconfig:`index.decrypt` and :nmconfig:`index.header.\<prefix\>`. Tagging
96 is controlled by options :nmconfig:`new.tags` and
97 :nmconfig:`maildir.synchronize_flags`. See
98 :any:`notmuch-config(1)` for details.
103 This command returns exit status 0 on successful mail delivery,
104 non-zero otherwise. The default is to indicate failed mail delivery on
105 any errors, including message file delivery to the filesystem, message
106 indexing to Notmuch database, changing tags, and synchronizing tags to
107 maildir flags. The ``--keep`` option may be used to settle for
108 successful message file delivery.
110 This command supports the following special exit status code for
111 errors most likely to be temporary in nature, e.g. failure to get a
115 A temporary failure occurred; the user is invited to retry.
117 The exit status of the **post-insert** hook does not affect the exit
118 status of the **insert** command.
124 :any:`notmuch-config(1)`,
125 :any:`notmuch-count(1)`,
126 :any:`notmuch-dump(1)`,
127 :any:`notmuch-hooks(5)`,
128 :any:`notmuch-reply(1)`,
129 :any:`notmuch-restore(1)`,
130 :any:`notmuch-search(1)`,
131 :any:`notmuch-search-terms(7)`,
132 :any:`notmuch-show(1)`,
133 :any:`notmuch-tag(1)`