]> git.notmuchmail.org Git - notmuch/blob - doc/man1/notmuch-insert.rst
emacs: Add new option notmuch-search-hide-excluded
[notmuch] / doc / man1 / notmuch-insert.rst
1 .. _notmuch-insert(1):
2
3 ==============
4 notmuch-insert
5 ==============
6
7 SYNOPSIS
8 ========
9
10 **notmuch** **insert** [option ...] [+<*tag*>|-<*tag*> ...]
11
12 DESCRIPTION
13 ===========
14
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.
20
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 '-'
24 are removed.
25
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.
29
30 The **insert** command supports hooks. See :any:`notmuch-hooks(5)` for
31 more details on hooks.
32
33 Option arguments must appear before any tag operation arguments.
34 Supported options for **insert** include
35
36 .. program:: insert
37
38 .. option:: --folder=<folder>
39
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
43    top-level directory.
44
45 .. option:: --create-folder
46
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
49    delivery to succeed.
50
51 .. option:: --keep
52
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.
57
58 .. option:: --no-hooks
59
60    Prevent hooks from being run.
61
62 .. option:: --world-readable
63
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
67    user.
68
69 .. option:: --decrypt=(true|nostash|auto|false)
70
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).
78
79    ``nostash`` is the same as ``true`` except that it will not stash
80    newly-discovered session keys in the database.
81
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
87    index.
88
89    See also :nmconfig:`index.decrypt` in :any:`notmuch-config(1)`.
90
91 CONFIGURATION
92 =============
93
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.
99
100 EXIT STATUS
101 ===========
102
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.
109
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
112 database write lock.
113
114 ``75 (EX_TEMPFAIL)``
115     A temporary failure occurred; the user is invited to retry.
116
117 The exit status of the **post-insert** hook does not affect the exit
118 status of the **insert** command.
119
120 SEE ALSO
121 ========
122
123 :any:`notmuch(1)`,
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)`