]> git.notmuchmail.org Git - notmuch/blob - doc/man1/notmuch-show.rst
Import notmuch_0.27.orig.tar.gz
[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=(false|auto|true|stash)``
114     If ``true``, decrypt any MIME encrypted parts found in the
115     selected content (i.e. "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.
120
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
124     in the future.
125
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.
129
130     Use ``false`` to avoid even automatic decryption.
131
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
135     fail.
136
137     Note: setting either ``true`` or ``stash`` here implies
138     ``--verify``.
139
140     Here is a table that summarizes each of these policies:
141
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  |       |      |      |       |
155     | found                  |       |      |      |       |
156     +------------------------+-------+------+------+-------+
157
158     Note: ``--decrypt=stash`` requires write access to the database.
159     Otherwise, ``notmuch show`` operates entirely in read-only mode.
160
161     Default: ``auto``
162
163 ``--exclude=(true|false)``
164     Specify whether to omit threads only matching search.tag\_exclude
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).
168
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.``
173
174     The default is ``--exclude=true.``
175
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 json and sexp formats
180     and it is incompatible with ``--part > 0.``
181
182     This is useful if the caller only needs the headers as body-less
183     output is much faster and substantially smaller.
184
185 ``--include-html``
186     Include "text/html" parts as part of the output (currently only
187     supported with --format=json and --format=sexp). By default,
188     unless ``--part=N`` is used to select a specific part or
189     ``--include-html`` is used to include all "text/html" parts, no
190     part with content type "text/html" is included in the output.
191
192 A common use of **notmuch show** is to display a single thread of email
193 messages. For this, use a search term of "thread:<thread-id>" as can be
194 seen in the first column of output from the **notmuch search** command.
195
196 EXIT STATUS
197 ===========
198
199 This command supports the following special exit status codes
200
201 ``20``
202     The requested format version is too old.
203
204 ``21``
205     The requested format version is too new.
206
207 SEE ALSO
208 ========
209
210 **notmuch(1)**,
211 **notmuch-config(1)**,
212 **notmuch-count(1)**,
213 **notmuch-dump(1)**,
214 **notmuch-hooks(5)**,
215 **notmuch-insert(1)**,
216 **notmuch-new(1)**,
217 **notmuch-reply(1)**,
218 **notmuch-restore(1)**,
219 **notmuch-search(1)**,
220 **notmuch-search-terms(7)**,
221 **notmuch-tag(1)**