]> git.notmuchmail.org Git - notmuch/blob - doc/man1/notmuch-show.rst
doc: unify definition list usage across man pages
[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 ``--format=sexp``
30     this defaults to true. For other formats, this defaults to false.
31
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.
42
43     **json**
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.
54
55     **sexp**
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.
62
63     **mbox**
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:
71
72             http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/mail-mbox-formats.html
73
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.
78
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,
82         for example.
83
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
89         functions.
90
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.
95
96 ``--part=N``
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.
101
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.
105
106 ``--verify``
107     Compute and report the validity of any MIME cryptographic
108     signatures found in the selected content (ie. "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.
112
113 ``--decrypt``
114     Decrypt any MIME encrypted parts found in the selected content
115     (ie. "multipart/encrypted" parts). Status of the decryption will
116     be reported (currently only supported with --format=json and
117     --format=sexp) and on successful decryption the
118     multipart/encrypted part will be replaced by the decrypted
119     content.
120
121     If a session key is already known for the message, then it will be
122     decrypted automatically unless the user explicitly sets
123     ``--decrypt=false``.
124
125     Decryption expects a functioning **gpg-agent(1)** to provide any
126     needed credentials. Without one, the decryption will fail.
127
128     Implies --verify.
129
130 ``--exclude=(true|false)``
131     Specify whether to omit threads only matching search.tag\_exclude
132     from the search results (the default) or not. In either case the
133     excluded message will be marked with the exclude flag (except when
134     output=mbox when there is nowhere to put the flag).
135
136     If --entire-thread is specified then complete threads are returned
137     regardless (with the excluded flag being set when appropriate) but
138     threads that only match in an excluded message are not returned
139     when ``--exclude=true.``
140
141     The default is ``--exclude=true.``
142
143 ``--body=(true|false)``
144     If true (the default) **notmuch show** includes the bodies of the
145     messages in the output; if false, bodies are omitted.
146     ``--body=false`` is only implemented for the json and sexp formats
147     and it is incompatible with ``--part > 0.``
148
149     This is useful if the caller only needs the headers as body-less
150     output is much faster and substantially smaller.
151
152 ``--include-html``
153     Include "text/html" parts as part of the output (currently only
154     supported with --format=json and --format=sexp). By default,
155     unless ``--part=N`` is used to select a specific part or
156     ``--include-html`` is used to include all "text/html" parts, no
157     part with content type "text/html" is included in the output.
158
159 A common use of **notmuch show** is to display a single thread of email
160 messages. For this, use a search term of "thread:<thread-id>" as can be
161 seen in the first column of output from the **notmuch search** command.
162
163 EXIT STATUS
164 ===========
165
166 This command supports the following special exit status codes
167
168 ``20``
169     The requested format version is too old.
170
171 ``21``
172     The requested format version is too new.
173
174 SEE ALSO
175 ========
176
177 **notmuch(1)**,
178 **notmuch-config(1)**,
179 **notmuch-count(1)**,
180 **notmuch-dump(1)**,
181 **notmuch-hooks(5)**,
182 **notmuch-insert(1)**,
183 **notmuch-new(1)**,
184 **notmuch-reply(1)**,
185 **notmuch-restore(1)**,
186 **notmuch-search(1)**,
187 **notmuch-search-terms(7)**,
188 **notmuch-tag(1)**