]> git.notmuchmail.org Git - notmuch-wiki/blob - manpages/notmuch-insert-1.mdwn
68626ab5bd00a149c4497954bc365eacd21e4696
[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.path</b>, then
17        incorporates  the  message into the notmuch database. It is an alterna‐
18        tive to using a separate tool to deliver the message then running  <b>not-</b>
19        <b>much</b> <b>new</b> 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
30        details 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.path</b>.  The
38                  default is to deliver to the top-level directory.
39
40           <b>--create-folder</b>
41                  Try  to create the folder named by the <b>--folder</b> option, if it
42                  does not exist. Otherwise the folder must already  exist  for
43                  mail delivery to succeed.
44
45           <b>--keep</b> 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 indi‐
48                  cate successful mail delivery.
49
50           <b>--no-hooks</b>
51                  Prevent hooks from being run.
52 </pre>
53
54 <h2>EXIT STATUS</h2>
55 <pre>
56        This command  returns  exit  status  0  on  successful  mail  delivery,
57        non-zero  otherwise. The default is to indicate failed mail delivery on
58        any errors, including message file delivery to the filesystem,  message
59        indexing  to Notmuch database, changing tags, and synchronizing tags to
60        maildir flags. The <b>--keep</b> option may be used to settle  for  successful
61        message file delivery.
62
63        The exit status of the <b>post-insert</b> hook does not affect the exit status
64        of the <b>insert</b> command.
65 </pre>
66
67 <h2>SEE ALSO</h2>
68 <pre>
69        <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>
70        <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),
71        <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)
72 </pre>
73
74 <h2>AUTHOR</h2>
75 <pre>
76        Carl Worth and many others
77 </pre>
78
79 <h2>COPYRIGHT</h2>
80 <pre>
81        2009-2016, Carl Worth and many others
82 </pre>
83
84 <h2>0.23</h2>