]> git.notmuchmail.org Git - notmuch/blob - doc/man1/notmuch-insert.rst
e2bf37d04c79e49f6a8127bf36949a84470d2f86
[notmuch] / doc / man1 / notmuch-insert.rst
1 ==============
2 notmuch-insert
3 ==============
4
5 SYNOPSIS
6 ========
7
8 **notmuch** **insert** [option ...] [+<*tag*>|-<*tag*> ...]
9
10 DESCRIPTION
11 ===========
12
13 **notmuch insert** reads a message from standard input and delivers it
14 into the maildir directory given by configuration option
15 **database.path**, then incorporates the message into the notmuch
16 database. It is an alternative to using a separate tool to deliver the
17 message then running **notmuch new** afterwards.
18
19 The new message will be tagged with the tags specified by the
20 **new.tags** configuration option, then by operations specified on the
21 command-line: tags prefixed by '+' are added while those prefixed by '-'
22 are removed.
23
24 If the new message is a duplicate of an existing message in the database
25 (it has same Message-ID), it will be added to the maildir folder and
26 notmuch database, but the tags will not be changed.
27
28 The **insert** command supports hooks. See **notmuch-hooks(5)** for
29 more details on hooks.
30
31 Option arguments must appear before any tag operation arguments.
32 Supported options for **insert** include
33
34     ``--folder=<``\ folder\ **>**
35         Deliver the message to the specified folder, relative to the
36         top-level directory given by the value of **database.path**. The
37         default is to deliver to the top-level directory.
38
39     ``--create-folder``
40         Try to create the folder named by the ``--folder`` option, if it
41         does not exist. Otherwise the folder must already exist for mail
42         delivery to succeed.
43
44     ``--keep``
45         Keep the message file if indexing fails, and keep the message
46         indexed if applying tags or maildir flag synchronization
47         fails. Ignore these errors and return exit status 0 to
48         indicate successful mail delivery.
49
50     ``--no-hooks``
51         Prevent hooks from being run.
52
53     ``--try-decrypt=(true|false)``
54
55         If true and the message is encrypted, try to decrypt the
56         message while indexing.  If decryption is successful, index
57         the cleartext itself.  Either way, the message is always
58         stored to disk in its original form (ciphertext).  Be aware
59         that the index is likely sufficient to reconstruct the
60         cleartext of the message itself, so please ensure that the
61         notmuch message index is adequately protected. DO NOT USE
62         ``--try-decrypt=true`` without considering the security of
63         your index.
64
65         See also ``index.try_decrypt`` in **notmuch-config(1)**.
66
67 EXIT STATUS
68 ===========
69
70 This command returns exit status 0 on successful mail delivery,
71 non-zero otherwise. The default is to indicate failed mail delivery on
72 any errors, including message file delivery to the filesystem, message
73 indexing to Notmuch database, changing tags, and synchronizing tags to
74 maildir flags. The ``--keep`` option may be used to settle for
75 successful message file delivery.
76
77 This command supports the following special exit status code for
78 errors most likely to be temporary in nature, e.g. failure to get a
79 database write lock.
80
81 ``75 (EX_TEMPFAIL)``
82     A temporary failure occurred; the user is invited to retry.
83
84 The exit status of the **post-insert** hook does not affect the exit
85 status of the **insert** command.
86
87 SEE ALSO
88 ========
89
90 **notmuch(1)**,
91 **notmuch-config(1)**,
92 **notmuch-count(1)**,
93 **notmuch-dump(1)**,
94 **notmuch-hooks(5)**,
95 **notmuch-reply(1)**,
96 **notmuch-restore(1)**,
97 **notmuch-search(1)**,
98 **notmuch-search-terms(7)**,
99 **notmuch-show(1)**,
100 **notmuch-tag(1)**