8 **notmuch** **show** [*option* ...] <*search-term*> ...
13 Shows all messages matching the search terms.
15 See **notmuch-search-terms(7)** for details of the supported syntax for
18 The messages will be grouped and sorted based on the threading (all
19 replies to a particular message will appear immediately after that
20 message in date order). The output is not indented by default, but depth
21 tags are printed so that proper indentation can be performed by a
22 post-processor (such as the emacs interface to notmuch).
24 Supported options for **show** include
26 ``--entire-thread=(true|false)``
27 If true, **notmuch show** outputs all messages in the thread of
28 any message matching the search terms; if false, it outputs only
29 the matching messages. For ``--format=json`` and ``--format=sexp``
30 this defaults to true. For other formats, this defaults to false.
32 ``--format=(text|json|sexp|mbox|raw)``
33 **text** (default for messages)
34 The default plain-text format has all text-content MIME parts
35 decoded. Various components in the output, (**message**,
36 **header**, **body**, **attachment**, and MIME **part**), will
37 be delimited by easily-parsed markers. Each marker consists of
38 a Control-L character (ASCII decimal 12), the name of the
39 marker, and then either an opening or closing brace, ('{' or
40 '}'), to either open or close the component. For a multipart
41 MIME message, these parts will be nested.
44 The output is formatted with Javascript Object Notation
45 (JSON). This format is more robust than the text format for
46 automated processing. The nested structure of multipart MIME
47 messages is reflected in nested JSON output. By default JSON
48 output includes all messages in a matching thread; that is, by
49 default, ``--format=json`` sets ``--entire-thread``. The
50 caller can disable this behaviour by setting
51 ``--entire-thread=false``. The JSON output is always encoded
52 as UTF-8 and any message content included in the output will
53 be charset-converted to UTF-8.
56 The output is formatted as the Lisp s-expression (sexp)
57 equivalent of the JSON format above. Objects are formatted as
58 property lists whose keys are keywords (symbols preceded by a
59 colon). True is formatted as ``t`` and both false and null are
60 formatted as ``nil``. As for JSON, the s-expression output is
61 always encoded as UTF-8.
64 All matching messages are output in the traditional, Unix mbox
65 format with each message being prefixed by a line beginning
66 with "From " and a blank line separating each message. Lines
67 in the message content beginning with "From " (preceded by
68 zero or more '>' characters) have an additional '>' character
69 added. This reversible escaping is termed "mboxrd" format and
70 described in detail here:
72 http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/mail-mbox-formats.html
74 **raw** (default if ``--part`` is given)
75 Write the raw bytes of the given MIME part of a message to
76 standard out. For this format, it is an error to specify a
77 query that matches more than one message.
79 If the specified part is a leaf part, this outputs the body of
80 the part after performing content transfer decoding (but no
81 charset conversion). This is suitable for saving attachments,
84 For a multipart or message part, the output includes the part
85 headers as well as the body (including all child parts). No
86 decoding is performed because multipart and message parts
87 cannot have non-trivial content transfer encoding. Consumers
88 of this may need to implement MIME decoding and similar
91 ``--format-version=N``
92 Use the specified structured output format version. This is
93 intended for programs that invoke **notmuch(1)** internally. If
94 omitted, the latest supported version will be used.
97 Output the single decoded MIME part N of a single message. The
98 search terms must match only a single message. Message parts are
99 numbered in a depth-first walk of the message MIME structure, and
100 are identified in the 'json', 'sexp' or 'text' output formats.
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.
107 Compute and report the validity of any MIME cryptographic
108 signatures found in the selected content (e.g., "multipart/signed"
109 parts). Status of the signature will be reported (currently only
110 supported with ``--format=json`` and ``--format=sexp``), and the
111 multipart/signed part will be replaced by the signed data.
113 ``--decrypt=(false|auto|true|stash)``
114 If ``true``, decrypt any MIME encrypted parts found in the
115 selected content (e.g., "multipart/encrypted" parts). Status of
116 the decryption will be reported (currently only supported
117 with ``--format=json`` and ``--format=sexp``) and on successful
118 decryption the multipart/encrypted part will be replaced by
119 the decrypted content.
121 ``stash`` behaves like ``true``, but upon successful decryption it
122 will also stash the message's session key in the database, and
123 index the cleartext of the message, enabling automatic decryption
126 If ``auto``, and a session key is already known for the
127 message, then it will be decrypted, but notmuch will not try
128 to access the user's keys.
130 Use ``false`` to avoid even automatic decryption.
132 Non-automatic decryption (``stash`` or ``true``, in the absence of
133 a stashed session key) expects a functioning **gpg-agent(1)** to
134 provide any needed credentials. Without one, the decryption will
137 Note: setting either ``true`` or ``stash`` here implies
140 Here is a table that summarizes each of these policies:
142 +------------------------+-------+------+------+-------+
143 | | false | auto | true | stash |
144 +========================+=======+======+======+=======+
145 | Show cleartext if | | X | X | X |
146 | session key is | | | | |
147 | already known | | | | |
148 +------------------------+-------+------+------+-------+
149 | Use secret keys to | | | X | X |
150 | show cleartext | | | | |
151 +------------------------+-------+------+------+-------+
152 | Stash any newly | | | | X |
153 | recovered session keys,| | | | |
154 | reindexing message if | | | | |
156 +------------------------+-------+------+------+-------+
158 Note: ``--decrypt=stash`` requires write access to the database.
159 Otherwise, ``notmuch show`` operates entirely in read-only mode.
163 ``--exclude=(true|false)``
164 Specify whether to omit threads only matching search.exclude\_tags
165 from the search results (the default) or not. In either case the
166 excluded message will be marked with the exclude flag (except when
167 output=mbox when there is nowhere to put the flag).
169 If ``--entire-thread`` is specified then complete threads are returned
170 regardless (with the excluded flag being set when appropriate) but
171 threads that only match in an excluded message are not returned
172 when ``--exclude=true.``
174 The default is ``--exclude=true.``
176 ``--body=(true|false)``
177 If true (the default) **notmuch show** includes the bodies of the
178 messages in the output; if false, bodies are omitted.
179 ``--body=false`` is only implemented for the text, json and sexp
180 formats and it is incompatible with ``--part > 0.``
182 This is useful if the caller only needs the headers as body-less
183 output is much faster and substantially smaller.
186 Include "text/html" parts as part of the output (currently
187 only supported with ``--format=text``, ``--format=json`` and
188 ``--format=sexp``). By default, unless ``--part=N`` is used to
189 select a specific part or ``--include-html`` is used to include all
190 "text/html" parts, no part with content type "text/html" is included
193 A common use of **notmuch show** is to display a single thread of email
194 messages. For this, use a search term of "thread:<thread-id>" as can be
195 seen in the first column of output from the **notmuch search** command.
200 This command supports the following special exit status codes
203 The requested format version is too old.
206 The requested format version is too new.
212 **notmuch-config(1)**,
213 **notmuch-count(1)**,
215 **notmuch-hooks(5)**,
216 **notmuch-insert(1)**,
218 **notmuch-reply(1)**,
219 **notmuch-restore(1)**,
220 **notmuch-search(1)**,
221 **notmuch-search-terms(7)**,