]> git.cworth.org Git - notmuch-wiki/blob - manpages/notmuch-insert-1.mdwn
complete sentence
[notmuch-wiki] / manpages / notmuch-insert-1.mdwn
1 <h1>NOTMUCH-INSERT(1)</h1>
2
3 <h2>NAME</h2>
4 <pre>
5        notmuch-insert - add a message to the maildir and notmuch database
6 </pre>
7
8 <h2>SYNOPSIS</h2>
9 <pre>
10        <b>notmuch</b> <b>insert</b> [option ...] [+&lt;<u>tag</u>&gt;|-&lt;<u>tag</u>&gt; ...]
11 </pre>
12
13 <h2>DESCRIPTION</h2>
14 <pre>
15        <b>notmuch</b> <b>insert</b> reads a message from standard input and delivers it into
16        the maildir directory given by configuration option <b>database.mail</b>_<b>root</b>,
17        then  incorporates  the message into the notmuch database. It is an al‐
18        ternative to using a separate tool to deliver the message then  running
19        <a href='../notmuch-new-1/'>notmuch-new</a>(1) afterwards.
20
21        The  new message will be tagged with the tags specified by the <b>new.tags</b>
22        configuration option, then by operations specified on the command-line:
23        tags prefixed by &apos;+&apos; are added while those prefixed by &apos;-&apos; are removed.
24
25        If  the  new message is a duplicate of an existing message in the data‐
26        base (it has same Message-ID), it will be added to the  maildir  folder
27        and notmuch database, but the tags will not be changed.
28
29        The  <b>insert</b>  command  supports hooks. See <a href='../notmuch-hooks-5/'>notmuch-hooks</a>(5) for more de‐
30        tails on hooks.
31
32        Option arguments must appear before any tag operation arguments.   Sup‐
33        ported options for <b>insert</b> include
34
35        <b>--folder=&lt;folder&gt;</b>
36               Deliver  the  message  to  the specified folder, relative to the
37               top-level directory given by the  value  of  <b>database.mail</b>_<b>root</b>.
38               The  default  is the empty string, which means delivering to the
39               top-level directory.
40
41        <b>--create-folder</b>
42               Try to create the folder named by the  <b>--folder</b>  option,  if  it
43               does not exist. Otherwise the folder must already exist for mail
44               delivery to succeed.
45
46        <b>--keep</b> Keep the message file if indexing fails, and  keep  the  message
47               indexed  if applying tags or maildir flag synchronization fails.
48               Ignore these errors and return exit status 0  to  indicate  suc‐
49               cessful mail delivery.
50
51        <b>--no-hooks</b>
52               Prevent hooks from being run.
53
54        <b>--world-readable</b>
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 cur‐
58               rent user.
59
60        <b>--decrypt=(true|nostash|auto|false)</b>
61               If <b>true</b> and the message is encrypted, try to decrypt the message
62               while  indexing, stashing any session keys discovered.  If <b>auto</b>,
63               and notmuch already knows about a session key for  the  message,
64               it  will  try decrypting using that session key but will not try
65               to access the user&apos;s secret keys.  If decryption is  successful,
66               index  the  cleartext itself.  Either way, the message is always
67               stored to disk in its original form (ciphertext).
68
69               <b>nostash</b> is the same as  <b>true</b>  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 ses‐
73               sion 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  <b>--decrypt=true</b>  or
76               <b>--decrypt=nostash</b>  without  considering the security of your in‐
77               dex.
78
79               See also <b>index.decrypt</b> in <a href='../notmuch-config-1/'>notmuch-config</a>(1).
80 </pre>
81
82 <h2>EXIT STATUS</h2>
83 <pre>
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 <b>--keep</b> option may be used to settle  for  successful
89        message file delivery.
90
91        This command supports the following special exit status code for errors
92        most likely to be temporary in nature, e.g. failure to get  a  database
93        write lock.
94
95        <b>75</b> <b>(EX</b>_<b>TEMPFAIL)</b>
96               A temporary failure occurred; the user is invited to retry.
97
98        The exit status of the <b>post-insert</b> hook does not affect the exit status
99        of the <b>insert</b> command.
100 </pre>
101
102 <h2>SEE ALSO</h2>
103 <pre>
104        <a href='../notmuch-1/'>notmuch</a>(1), <a href='../notmuch-config-1/'>notmuch-config</a>(1), <a href='../notmuch-count-1/'>notmuch-count</a>(1), <a href='../notmuch-dump-1/'>notmuch-dump</a>(1),  <a href='../notmuch-hooks-5/'>not‐</a>
105        <a href='../notmuch-hooks-5/'>much-hooks</a>(5), <a href='../notmuch-reply-1/'>notmuch-reply</a>(1), <a href='../notmuch-restore-1/'>notmuch-restore</a>(1), <a href='../notmuch-search-1/'>notmuch-search</a>(1),
106        <a href='../notmuch-search-terms-7/'>notmuch-search-terms</a>(7), <a href='../notmuch-show-1/'>notmuch-show</a>(1), <a href='../notmuch-tag-1/'>notmuch-tag</a>(1)
107 </pre>
108
109 <h2>AUTHOR</h2>
110 <pre>
111        Carl Worth and many others
112 </pre>
113
114 <h2>COPYRIGHT</h2>
115 <pre>
116        2009-2022, Carl Worth and many others
117 </pre>
118
119 <h2>0.35</h2>