]> git.notmuchmail.org Git - notmuch/blob - doc/man1/notmuch-insert.rst
1a3dfe98299ae21b6501de65cad97ef9f91a18bb
[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 the empty string, which means delivering to the
38         top-level directory.
39
40     ``--create-folder``
41         Try to create the folder named by the ``--folder`` option, if it
42         does not exist. Otherwise the folder must already exist for mail
43         delivery to succeed.
44
45     ``--keep``
46         Keep the message file if indexing fails, and keep the message
47         indexed if applying tags or maildir flag synchronization
48         fails. Ignore these errors and return exit status 0 to
49         indicate successful mail delivery.
50
51     ``--no-hooks``
52         Prevent hooks from being run.
53
54     ``--decrypt=(true|nostash|auto|false)``
55
56         If ``true`` and the message is encrypted, try to decrypt the
57         message while indexing, stashing any session keys discovered.
58         If ``auto``, and notmuch already knows about a session key for
59         the message, it will try decrypting using that session key but
60         will not try to access the user's secret keys.  If decryption
61         is successful, index the cleartext itself.  Either way, the
62         message is always stored to disk in its original form
63         (ciphertext).
64
65         ``nostash`` is the same as ``true`` except that it will not
66         stash newly-discovered session keys in the database.
67
68         Be aware that the index is likely sufficient (and a stashed
69         session key is certainly sufficient) to reconstruct the
70         cleartext of the message itself, so please ensure that the
71         notmuch message index is adequately protected. DO NOT USE
72         ``--decrypt=true`` or ``--decrypt=nostash`` without
73         considering the security of your index.
74
75         See also ``index.decrypt`` in **notmuch-config(1)**.
76
77 EXIT STATUS
78 ===========
79
80 This command returns exit status 0 on successful mail delivery,
81 non-zero otherwise. The default is to indicate failed mail delivery on
82 any errors, including message file delivery to the filesystem, message
83 indexing to Notmuch database, changing tags, and synchronizing tags to
84 maildir flags. The ``--keep`` option may be used to settle for
85 successful message file delivery.
86
87 This command supports the following special exit status code for
88 errors most likely to be temporary in nature, e.g. failure to get a
89 database write lock.
90
91 ``75 (EX_TEMPFAIL)``
92     A temporary failure occurred; the user is invited to retry.
93
94 The exit status of the **post-insert** hook does not affect the exit
95 status of the **insert** command.
96
97 SEE ALSO
98 ========
99
100 **notmuch(1)**,
101 **notmuch-config(1)**,
102 **notmuch-count(1)**,
103 **notmuch-dump(1)**,
104 **notmuch-hooks(5)**,
105 **notmuch-reply(1)**,
106 **notmuch-restore(1)**,
107 **notmuch-search(1)**,
108 **notmuch-search-terms(7)**,
109 **notmuch-show(1)**,
110 **notmuch-tag(1)**