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