]> git.notmuchmail.org Git - notmuch/blob - doc/man1/notmuch-show.rst
7ba091cf57c3ce3a76784b7b663c73cc5914d774
[notmuch] / doc / man1 / notmuch-show.rst
1 ============
2 notmuch-show
3 ============
4
5 SYNOPSIS
6 ========
7
8 **notmuch** **show** [*option* ...] <*search-term*> ...
9
10 DESCRIPTION
11 ===========
12
13 Shows all messages matching the search terms.
14
15 See **notmuch-search-terms(7)** for details of the supported syntax for
16 <search-terms>.
17
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).
23
24 Supported options for **show** include
25
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
30         ``--format=sexp`` this defaults to true. For other formats, this
31         defaults to false.
32
33     ``--format=(text|json|sexp|mbox|raw)``
34
35         **text** (default for messages)
36             The default plain-text format has all text-content MIME
37             parts decoded. Various components in the output,
38             (**message**, **header**, **body**, **attachment**, and MIME
39             **part**), will be delimited by easily-parsed markers. Each
40             marker consists of a Control-L character (ASCII decimal 12),
41             the name of the marker, and then either an opening or
42             closing brace, ('{' or '}'), to either open or close the
43             component. For a multipart MIME message, these parts will be
44             nested.
45
46         **json**
47             The output is formatted with Javascript Object Notation
48             (JSON). This format is more robust than the text format for
49             automated processing. The nested structure of multipart MIME
50             messages is reflected in nested JSON output. By default JSON
51             output includes all messages in a matching thread; that is,
52             by default,
53             ``--format=json`` sets ``--entire-thread``. The caller can
54             disable this behaviour by setting ``--entire-thread=false``.
55             The JSON output is always encoded as UTF-8 and any message
56             content included in the output will be charset-converted to
57             UTF-8.
58
59         **sexp**
60             The output is formatted as the Lisp s-expression (sexp)
61             equivalent of the JSON format above. Objects are formatted
62             as property lists whose keys are keywords (symbols preceded
63             by a colon). True is formatted as ``t`` and both false and
64             null are formatted as ``nil``. As for JSON, the s-expression
65             output is always encoded as UTF-8.
66
67         **mbox**
68             All matching messages are output in the traditional, Unix
69             mbox format with each message being prefixed by a line
70             beginning with "From " and a blank line separating each
71             message. Lines in the message content beginning with "From "
72             (preceded by zero or more '>' characters) have an additional
73             '>' character added. This reversible escaping is termed
74             "mboxrd" format and described in detail here:
75
76             http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/mail-mbox-formats.html
77
78         **raw** (default if --part is given)
79             Write the raw bytes of the given MIME part of a message to
80             standard out. For this format, it is an error to specify a
81             query that matches more than one message.
82
83             If the specified part is a leaf part, this outputs the
84             body of the part after performing content transfer
85             decoding (but no charset conversion). This is suitable for
86             saving attachments, for example.
87
88             For a multipart or message part, the output includes the
89             part headers as well as the body (including all child
90             parts). No decoding is performed because multipart and
91             message parts cannot have non-trivial content transfer
92             encoding. Consumers of this may need to implement MIME
93             decoding and similar functions.
94
95     ``--format-version=N``
96         Use the specified structured output format version. This is
97         intended for programs that invoke **notmuch(1)** internally. If
98         omitted, the latest supported version will be used.
99
100     ``--part=N``
101         Output the single decoded MIME part N of a single message. The
102         search terms must match only a single message. Message parts are
103         numbered in a depth-first walk of the message MIME structure,
104         and are identified in the 'json', 'sexp' or 'text' output
105         formats.
106
107         Note that even a message with no MIME structure or a single
108         body part still has two MIME parts: part 0 is the whole
109         message (headers and body) and part 1 is just the body.
110
111     ``--verify``
112         Compute and report the validity of any MIME cryptographic
113         signatures found in the selected content (ie. "multipart/signed"
114         parts). Status of the signature will be reported (currently only
115         supported with --format=json and --format=sexp), and the
116         multipart/signed part will be replaced by the signed data.
117
118     ``--decrypt``
119         Decrypt any MIME encrypted parts found in the selected content
120         (ie. "multipart/encrypted" parts). Status of the decryption will
121         be reported (currently only supported with --format=json and
122         --format=sexp) and on successful decryption the
123         multipart/encrypted part will be replaced by the decrypted
124         content.
125
126         Decryption expects a functioning **gpg-agent(1)** to provide any
127         needed credentials. Without one, the decryption will fail.
128
129         Implies --verify.
130
131     ``--exclude=(true|false)``
132         Specify whether to omit threads only matching
133         search.tag\_exclude from the search results (the default) or
134         not. In either case the excluded message will be marked with the
135         exclude flag (except when output=mbox when there is nowhere to
136         put the flag).
137
138         If --entire-thread is specified then complete threads are
139         returned regardless (with the excluded flag being set when
140         appropriate) but threads that only match in an excluded message
141         are not returned when ``--exclude=true.``
142
143         The default is ``--exclude=true.``
144
145     ``--body=(true|false)``
146         If true (the default) **notmuch show** includes the bodies of
147         the messages in the output; if false, bodies are omitted.
148         ``--body=false`` is only implemented for the json and sexp
149         formats and it is incompatible with ``--part > 0.``
150
151         This is useful if the caller only needs the headers as body-less
152         output is much faster and substantially smaller.
153
154     ``--include-html``
155         Include "text/html" parts as part of the output (currently only
156         supported with --format=json and --format=sexp). By default,
157         unless ``--part=N`` is used to select a specific part or
158         ``--include-html`` is used to include all "text/html" parts, no
159         part with content type "text/html" is included in the output.
160
161 A common use of **notmuch show** is to display a single thread of email
162 messages. For this, use a search term of "thread:<thread-id>" as can be
163 seen in the first column of output from the **notmuch search** command.
164
165 EXIT STATUS
166 ===========
167
168 This command supports the following special exit status codes
169
170 ``20``
171     The requested format version is too old.
172
173 ``21``
174     The requested format version is too new.
175
176 SEE ALSO
177 ========
178
179 **notmuch(1)**,
180 **notmuch-config(1)**,
181 **notmuch-count(1)**,
182 **notmuch-dump(1)**,
183 **notmuch-hooks(5)**,
184 **notmuch-insert(1)**,
185 **notmuch-new(1)**,
186 **notmuch-reply(1)**,
187 **notmuch-restore(1)**,
188 **notmuch-search(1)**,
189 **notmuch-search-terms(7)**,
190 **notmuch-tag(1)**