]> git.notmuchmail.org Git - notmuch/blob - doc/man1/notmuch-show.rst
emacs: Add new option notmuch-search-hide-excluded
[notmuch] / doc / man1 / notmuch-show.rst
1 .. _notmuch-show(1):
2
3 ============
4 notmuch-show
5 ============
6
7 SYNOPSIS
8 ========
9
10 **notmuch** **show** [*option* ...] <*search-term*> ...
11
12 DESCRIPTION
13 ===========
14
15 Shows all messages matching the search terms.
16
17 See :any:`notmuch-search-terms(7)` for details of the supported syntax for
18 <search-terms>.
19
20 The messages will be grouped and sorted based on the threading (all
21 replies to a particular message will appear immediately after that
22 message 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).
25
26 Supported options for **show** include
27
28 .. program:: show
29
30 .. option:: --duplicate=N
31
32    Output duplicate number N. The numbering starts from 1, and matches
33    the order used by :option:`search --duplicate` and
34    :option:`search --output=files <search --output>`
35
36 .. option:: --entire-thread=(true|false)
37
38    If true, **notmuch show** outputs all messages in the thread of
39    any message matching the search terms; if false, it outputs only
40    the matching messages. For ``--format=json`` and ``--format=sexp``
41    this defaults to true. For other formats, this defaults to false.
42
43 .. option:: --format=(text|json|sexp|mbox|raw)
44
45    text (default for messages)
46      The default plain-text format has all text-content MIME parts
47      decoded. Various components in the output, (**message**,
48      **header**, **body**, **attachment**, and MIME **part**), will
49      be delimited by easily-parsed markers. Each marker consists of
50      a Control-L character (ASCII decimal 12), the name of the
51      marker, and then either an opening or closing brace, ('{' or
52      '}'), to either open or close the component. For a multipart
53      MIME message, these parts will be nested.
54
55    json
56      The output is formatted with Javascript Object Notation
57      (JSON). This format is more robust than the text format for
58      automated processing. The nested structure of multipart MIME
59      messages is reflected in nested JSON output. By default JSON
60      output includes all messages in a matching thread; that is, by
61      default, ``--format=json`` sets ``--entire-thread``. The
62      caller can disable this behaviour by setting
63      ``--entire-thread=false``.  The JSON output is always encoded
64      as UTF-8 and any message content included in the output will
65      be charset-converted to UTF-8.
66
67    sexp
68      The output is formatted as the Lisp s-expression (sexp)
69      equivalent of the JSON format above. Objects are formatted as
70      property lists whose keys are keywords (symbols preceded by a
71      colon). True is formatted as ``t`` and both false and null are
72      formatted as ``nil``. As for JSON, the s-expression output is
73      always encoded as UTF-8.
74
75    mbox
76      All matching messages are output in the traditional, Unix mbox
77      format with each message being prefixed by a line beginning
78      with "From " and a blank line separating each message. Lines
79      in the message content beginning with "From " (preceded by
80      zero or more '>' characters) have an additional '>' character
81      added. This reversible escaping is termed "mboxrd" format and
82      described in detail here:
83
84        http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/mail-mbox-formats.html
85
86    raw (default if ``--part`` is given)
87      Write the raw bytes of the given MIME part of a message to
88      standard out. For this format, it is an error to specify a
89      query that matches more than one message.
90
91      If the specified part is a leaf part, this outputs the body of
92      the part after performing content transfer decoding (but no
93      charset conversion). This is suitable for saving attachments,
94      for example.
95
96      For a multipart or message part, the output includes the part
97      headers as well as the body (including all child parts). No
98      decoding is performed because multipart and message parts
99      cannot have non-trivial content transfer encoding. Consumers
100      of this may need to implement MIME decoding and similar
101      functions.
102
103 .. option:: --format-version=N
104
105    Use the specified structured output format version. This is
106    intended for programs that invoke :any:`notmuch(1)` internally. If
107    omitted, the latest supported version will be used.
108
109 .. option:: --part=N
110
111    Output the single decoded MIME part N of a single message. The
112    search terms must match only a single message. Message parts are
113    numbered in a depth-first walk of the message MIME structure, and
114    are identified in the 'json', 'sexp' or 'text' output formats.
115
116    Note that even a message with no MIME structure or a single body
117    part still has two MIME parts: part 0 is the whole message
118    (headers and body) and part 1 is just the body.
119
120 .. option:: --sort=(newest-first|oldest-first)
121
122    This option can be used to present results in either chronological
123    order (**oldest-first**) or reverse chronological order
124    (**newest-first**).
125
126    Only threads as a whole are reordered.  Ordering of messages within
127    each thread will not be affected by this flag, since that order is
128    always determined by the thread's replies.
129
130    By default, results will be displayed in reverse chronological
131    order, (that is, the newest results will be displayed first).
132
133 .. option:: --offset=[-]N
134
135    Skip displaying the first N results. With the leading '-', start
136    at the Nth result from the end.
137
138 .. option:: --limit=N
139
140    Limit the number of displayed results to N.
141
142 .. option:: --verify
143
144    Compute and report the validity of any MIME cryptographic
145    signatures found in the selected content (e.g., "multipart/signed"
146    parts). Status of the signature will be reported (currently only
147    supported with ``--format=json`` and ``--format=sexp``), and the
148    multipart/signed part will be replaced by the signed data.
149
150 .. option:: --decrypt=(false|auto|true|stash)
151
152    If ``true``, decrypt any MIME encrypted parts found in the
153    selected content (e.g., "multipart/encrypted" parts). Status of
154    the decryption will be reported (currently only supported
155    with ``--format=json`` and ``--format=sexp``) and on successful
156    decryption the multipart/encrypted part will be replaced by
157    the decrypted content.
158
159    ``stash`` behaves like ``true``, but upon successful decryption it
160    will also stash the message's session key in the database, and
161    index the cleartext of the message, enabling automatic decryption
162    in the future.
163
164    If ``auto``, and a session key is already known for the
165    message, then it will be decrypted, but notmuch will not try
166    to access the user's keys.
167
168    Use ``false`` to avoid even automatic decryption.
169
170    Non-automatic decryption (``stash`` or ``true``, in the absence of
171    a stashed session key) expects a functioning :manpage:`gpg-agent(1)` to
172    provide any needed credentials. Without one, the decryption will
173    fail.
174
175    Note: setting either ``true`` or ``stash`` here implies
176    ``--verify``.
177
178    Here is a table that summarizes each of these policies:
179
180    +------------------------+-------+------+------+-------+
181    |                        | false | auto | true | stash |
182    +========================+=======+======+======+=======+
183    | Show cleartext if      |       |  X   |  X   |   X   |
184    | session key is         |       |      |      |       |
185    | already known          |       |      |      |       |
186    +------------------------+-------+------+------+-------+
187    | Use secret keys to     |       |      |  X   |   X   |
188    | show cleartext         |       |      |      |       |
189    +------------------------+-------+------+------+-------+
190    | Stash any newly        |       |      |      |   X   |
191    | recovered session keys,|       |      |      |       |
192    | reindexing message if  |       |      |      |       |
193    | found                  |       |      |      |       |
194    +------------------------+-------+------+------+-------+
195
196    Note: ``--decrypt=stash`` requires write access to the database.
197    Otherwise, ``notmuch show`` operates entirely in read-only mode.
198
199    Default: ``auto``
200
201 .. option:: --exclude=(true|false)
202
203    Specify whether to omit threads only matching search.exclude\_tags
204    from the search results (the default) or not. In either case the
205    excluded message will be marked with the exclude flag (except when
206    output=mbox when there is nowhere to put the flag).
207
208    If ``--entire-thread`` is specified then complete threads are returned
209    regardless (with the excluded flag being set when appropriate) but
210    threads that only match in an excluded message are not returned
211    when ``--exclude=true.``
212
213    The default is ``--exclude=true.``
214
215 .. option:: --body=(true|false)
216
217    If true (the default) **notmuch show** includes the bodies of the
218    messages in the output; if false, bodies are omitted.
219    ``--body=false`` is only implemented for the text, json and sexp
220    formats and it is incompatible with ``--part > 0.``
221
222    This is useful if the caller only needs the headers as body-less
223    output is much faster and substantially smaller.
224
225 .. option:: --include-html
226
227    Include "text/html" parts as part of the output (currently
228    only supported with ``--format=text``, ``--format=json`` and
229    ``--format=sexp``). By default, unless ``--part=N`` is used to
230    select a specific part or ``--include-html`` is used to include all
231    "text/html" parts, no part with content type "text/html" is included
232    in the output.
233
234 A common use of **notmuch show** is to display a single thread of
235 email messages. For this, use a search term of "thread:<thread-id>" as
236 can be seen in the first column of output from the
237 :any:`notmuch-search(1)` command.
238
239 CONFIGURATION
240 =============
241
242 Structured output (json / sexp) is influenced by the configuration
243 option :nmconfig:`show.extra_headers`. See
244 :any:`notmuch-config(1)` for details.
245
246 EXIT STATUS
247 ===========
248
249 This command supports the following special exit status codes
250
251 ``20``
252     The requested format version is too old.
253
254 ``21``
255     The requested format version is too new.
256
257 SEE ALSO
258 ========
259
260 :any:`notmuch(1)`,
261 :any:`notmuch-config(1)`,
262 :any:`notmuch-count(1)`,
263 :any:`notmuch-dump(1)`,
264 :any:`notmuch-hooks(5)`,
265 :any:`notmuch-insert(1)`,
266 :any:`notmuch-new(1)`,
267 :any:`notmuch-reply(1)`,
268 :any:`notmuch-restore(1)`,
269 :any:`notmuch-search(1)`,
270 :any:`notmuch-search-terms(7)`,
271 :any:`notmuch-tag(1)`