1 <h1>NOTMUCH-SHOW(1)</h1>
5 notmuch-show - show messages matching the given search terms
10 <b>notmuch</b> <b>show</b> [<u>option</u> ...] <<u>search-term</u>> ...
15 Shows all messages matching the search terms.
17 See <a href='../notmuch-search-terms-7/'>notmuch-search-terms</a>(7) for details of the supported syntax for
20 The messages will be grouped and sorted based on the threading (all
21 replies to a particular message will appear immediately after that mes‐
22 sage in date order). The output is not indented by default, but depth
23 tags are printed so that proper indentation can be performed by a
24 post-processor (such as the emacs interface to notmuch).
26 Supported options for <b>show</b> include
28 <b>--entire-thread=(true|false)</b>
29 If true, <b>notmuch</b> <b>show</b> outputs all messages in the thread of any
30 message matching the search terms; if false, it outputs only the
31 matching messages. For <b>--format=json</b> and <b>--format=sexp</b> this de‐
32 faults to true. For other formats, this defaults to false.
34 <b>--format=(text|json|sexp|mbox|raw)</b>
36 <b>text</b> <b>(default</b> <b>for</b> <b>messages)</b>
37 The default plain-text format has all text-content MIME
38 parts decoded. Various components in the output, (<b>mes-</b>
39 <b>sage</b>, <b>header</b>, <b>body</b>, <b>attachment</b>, and MIME <b>part</b>), will be
40 delimited by easily-parsed markers. Each marker consists
41 of a Control-L character (ASCII decimal 12), the name of
42 the marker, and then either an opening or closing brace,
43 ('{' or '}'), to either open or close the component. For
44 a multipart MIME message, these parts will be nested.
46 <b>json</b> The output is formatted with Javascript Object Notation
47 (JSON). This format is more robust than the text format
48 for automated processing. The nested structure of multi‐
49 part MIME messages is reflected in nested JSON output. By
50 default JSON output includes all messages in a matching
51 thread; that is, by default, <b>--format=json</b> sets <b>--en-</b>
52 <b>tire-thread</b>. The caller can disable this behaviour by
53 setting <b>--entire-thread=false</b>. The JSON output is always
54 encoded as UTF-8 and any message content included in the
55 output will be charset-converted to UTF-8.
57 <b>sexp</b> The output is formatted as the Lisp s-expression (sexp)
58 equivalent of the JSON format above. Objects are format‐
59 ted as property lists whose keys are keywords (symbols
60 preceded by a colon). True is formatted as <b>t</b> and both
61 false and null are formatted as <b>nil</b>. As for JSON, the
62 s-expression output is always encoded as UTF-8.
64 <b>mbox</b> All matching messages are output in the traditional, Unix
65 mbox format with each message being prefixed by a line
66 beginning with "From " and a blank line separating each
67 message. Lines in the message content beginning with
68 "From " (preceded by zero or more '>' characters) have an
69 additional '>' character added. This reversible escaping
70 is termed "mboxrd" format and described in detail here:
71 <u>http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/mail-mbox-formats.html</u>
73 <b>raw</b> <b>(default</b> <b>if</b> <b>--part</b> <b>is</b> <b>given)</b>
74 Write the raw bytes of the given MIME part of a message
75 to standard out. For this format, it is an error to spec‐
76 ify a query that matches more than one message.
78 If the specified part is a leaf part, this outputs the
79 body of the part after performing content transfer decod‐
80 ing (but no charset conversion). This is suitable for
81 saving attachments, for example.
83 For a multipart or message part, the output includes the
84 part headers as well as the body (including all child
85 parts). No decoding is performed because multipart and
86 message parts cannot have non-trivial content transfer
87 encoding. Consumers of this may need to implement MIME
88 decoding and similar functions.
90 <b>--format-version=N</b>
91 Use the specified structured output format version. This is in‐
92 tended for programs that invoke <a href='../notmuch-1/'>notmuch</a>(1) internally. If omit‐
93 ted, the latest supported version will be used.
96 Output the single decoded MIME part N of a single message. The
97 search terms must match only a single message. Message parts are
98 numbered in a depth-first walk of the message MIME structure,
99 and are identified in the 'json', 'sexp' or 'text' output for‐
102 Note that even a message with no MIME structure or a single body
103 part still has two MIME parts: part 0 is the whole message
104 (headers and body) and part 1 is just the body.
106 <b>--sort=(newest-first|oldest-first)</b>
107 This option can be used to present results in either chronologi‐
108 cal order (<b>oldest-first</b>) or reverse chronological order (<b>new-</b>
111 Only threads as a whole are reordered. Ordering of messages
112 within each thread will not be affected by this flag, since that
113 order is always determined by the thread's replies.
115 By default, results will be displayed in reverse chronological
116 order, (that is, the newest results will be displayed first).
119 Compute and report the validity of any MIME cryptographic signa‐
120 tures found in the selected content (e.g., "multipart/signed"
121 parts). Status of the signature will be reported (currently only
122 supported with <b>--format=json</b> and <b>--format=sexp</b>), and the multi‐
123 part/signed part will be replaced by the signed data.
125 <b>--decrypt=(false|auto|true|stash)</b>
126 If <b>true</b>, decrypt any MIME encrypted parts found in the selected
127 content (e.g., "multipart/encrypted" parts). Status of the de‐
128 cryption will be reported (currently only supported with <b>--for-</b>
129 <b>mat=json</b> and <b>--format=sexp</b>) and on successful decryption the
130 multipart/encrypted part will be replaced by the decrypted con‐
133 <b>stash</b> behaves like <b>true</b>, but upon successful decryption it will
134 also stash the message's session key in the database, and index
135 the cleartext of the message, enabling automatic decryption in
138 If <b>auto</b>, and a session key is already known for the message,
139 then it will be decrypted, but notmuch will not try to access
140 the user's keys.
142 Use <b>false</b> to avoid even automatic decryption.
144 Non-automatic decryption (<b>stash</b> or <b>true</b>, in the absence of a
145 stashed session key) expects a functioning <b>gpg-agent</b>(1) to pro‐
146 vide any needed credentials. Without one, the decryption will
149 Note: setting either <b>true</b> or <b>stash</b> here implies <b>--verify</b>.
151 Here is a table that summarizes each of these policies:
153 ┌──────────────┬───────┬──────┬──────┬───────┐
154 │ │ false │ auto │ true │ stash │
155 ├──────────────┼───────┼──────┼──────┼───────┤
156 │Show cleart‐ │ │ X │ X │ X │
157 │ext if ses‐ │ │ │ │ │
158 │sion key is │ │ │ │ │
159 │already known │ │ │ │ │
160 ├──────────────┼───────┼──────┼──────┼───────┤
161 │Use secret │ │ │ X │ X │
162 │keys to show │ │ │ │ │
164 ├──────────────┼───────┼──────┼──────┼───────┤
165 │Stash any │ │ │ │ X │
166 │newly recov‐ │ │ │ │ │
167 │ered session │ │ │ │ │
168 │keys, rein‐ │ │ │ │ │
169 │dexing mes‐ │ │ │ │ │
170 │sage if found │ │ │ │ │
171 └──────────────┴───────┴──────┴──────┴───────┘
173 Note: <b>--decrypt=stash</b> requires write access to the database.
174 Otherwise, <b>notmuch</b> <b>show</b> operates entirely in read-only mode.
178 <b>--exclude=(true|false)</b>
179 Specify whether to omit threads only matching search.ex‐
180 clude_tags from the search results (the default) or not. In ei‐
181 ther case the excluded message will be marked with the exclude
182 flag (except when output=mbox when there is nowhere to put the
185 If <b>--entire-thread</b> is specified then complete threads are re‐
186 turned regardless (with the excluded flag being set when appro‐
187 priate) but threads that only match in an excluded message are
188 not returned when <b>--exclude=true.</b>
190 The default is <b>--exclude=true.</b>
192 <b>--body=(true|false)</b>
193 If true (the default) <b>notmuch</b> <b>show</b> includes the bodies of the
194 messages in the output; if false, bodies are omitted.
195 <b>--body=false</b> is only implemented for the text, json and sexp
196 formats and it is incompatible with <b>--part</b> <b>></b> <b>0.</b>
198 This is useful if the caller only needs the headers as body-less
199 output is much faster and substantially smaller.
201 <b>--include-html</b>
202 Include "text/html" parts as part of the output (currently only
203 supported with <b>--format=text</b>, <b>--format=json</b> and <b>--format=sexp</b>).
204 By default, unless <b>--part=N</b> is used to select a specific part or
205 <b>--include-html</b> is used to include all "text/html" parts, no part
206 with content type "text/html" is included in the output.
208 A common use of <b>notmuch</b> <b>show</b> is to display a single thread of email
209 messages. For this, use a search term of "thread:<thread-id>" as can be
210 seen in the first column of output from the <a href='../notmuch-search-1/'>notmuch-search</a>(1) command.
213 <h2>CONFIGURATION</h2>
215 Structured output (json / sexp) is influenced by the configuration op‐
216 tion show.extra_headers. See <a href='../notmuch-config-1/'>notmuch-config</a>(1) for details.
221 This command supports the following special exit status codes
223 <b>20</b> The requested format version is too old.
225 <b>21</b> The requested format version is too new.
230 <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>
231 <a href='../notmuch-hooks-5/'>much-hooks</a>(5), <a href='../notmuch-insert-1/'>notmuch-insert</a>(1), <a href='../notmuch-new-1/'>notmuch-new</a>(1), <a href='../notmuch-reply-1/'>notmuch-reply</a>(1),
232 <a href='../notmuch-restore-1/'>notmuch-restore</a>(1), <a href='../notmuch-search-1/'>notmuch-search</a>(1), <a href='../notmuch-search-terms-7/'>notmuch-search-terms</a>(7), <a href='../notmuch-tag-1/'>not‐</a>
233 <a href='../notmuch-tag-1/'>much-tag</a>(1)
238 Carl Worth and many others
243 2009-2022, Carl Worth and many others