]> git.notmuchmail.org Git - notmuch/blob - doc/man1/notmuch-insert.rst
Import notmuch_0.28.2.orig.tar.gz
[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 indicate
49     successful mail delivery.
50
51 ``--no-hooks``
52     Prevent hooks from being run.
53
54 ``--world-readable``
55     When writing mail to the mailbox, allow it to be read by users
56     other than the current user.  Note that this does not override
57     umask.  By default, delivered mail is only readable by the current
58     user.
59
60 ``--decrypt=(true|nostash|auto|false)``
61     If ``true`` and the message is encrypted, try to decrypt the
62     message while indexing, stashing any session keys discovered.  If
63     ``auto``, and notmuch already knows about a session key for the
64     message, it will try decrypting using that session key but will
65     not try to access the user's secret keys.  If decryption is
66     successful, index the cleartext itself.  Either way, the message
67     is always stored to disk in its original form (ciphertext).
68
69     ``nostash`` is the same as ``true`` except that it will not stash
70     newly-discovered session keys in the database.
71
72     Be aware that the index is likely sufficient (and a stashed
73     session key is certainly sufficient) to reconstruct the cleartext
74     of the message itself, so please ensure that the notmuch message
75     index is adequately protected. DO NOT USE ``--decrypt=true`` or
76     ``--decrypt=nostash`` without considering the security of your
77     index.
78
79     See also ``index.decrypt`` in **notmuch-config(1)**.
80
81 EXIT STATUS
82 ===========
83
84 This command returns exit status 0 on successful mail delivery,
85 non-zero otherwise. The default is to indicate failed mail delivery on
86 any errors, including message file delivery to the filesystem, message
87 indexing to Notmuch database, changing tags, and synchronizing tags to
88 maildir flags. The ``--keep`` option may be used to settle for
89 successful message file delivery.
90
91 This command supports the following special exit status code for
92 errors most likely to be temporary in nature, e.g. failure to get a
93 database write lock.
94
95 ``75 (EX_TEMPFAIL)``
96     A temporary failure occurred; the user is invited to retry.
97
98 The exit status of the **post-insert** hook does not affect the exit
99 status of the **insert** command.
100
101 SEE ALSO
102 ========
103
104 **notmuch(1)**,
105 **notmuch-config(1)**,
106 **notmuch-count(1)**,
107 **notmuch-dump(1)**,
108 **notmuch-hooks(5)**,
109 **notmuch-reply(1)**,
110 **notmuch-restore(1)**,
111 **notmuch-search(1)**,
112 **notmuch-search-terms(7)**,
113 **notmuch-show(1)**,
114 **notmuch-tag(1)**