f4b42eaac0fc7c1e023c06117840954c001edc13
[mmh] / man / mhshow.man
1 .\"
2 .\" %nmhwarning%
3 .\" $Id$
4 .\"
5 .\" include the -mh macro file
6 .so %etcdir%/tmac.h
7 .\"
8 .TH MHSHOW %manext1% MH.6.8 [%nmhversion%]
9 .SH NAME
10 mhshow \- display MIME messages
11 .SH SYNOPSIS
12 .in +.5i
13 .ti -.5i
14 mhshow \%[+folder] \%[msgs] \%[\-file file]
15 .br
16 \%[\-part number]... \%[\-type content]...
17 .br
18 \%[\-serialonly] \%[\-noserialonly]
19 \%[\-pause] \%[\-nopause]
20 .br
21 \%[\-check] \%[\-nocheck]
22 \%[\-form formfile]
23 .br
24 \%[\-rcache policy] \%[\-wcache policy]
25 .br
26 \%[\-verbose] \%[\-noverbose]
27 \%[\-version] \%[\-help]
28 .in -.5i
29
30 .SH DESCRIPTION
31 The \fImhshow\fR command display contents of a MIME (multi-media)
32 message or collection of messages.
33
34 \fImhshow\fR manipulates multi-media messages as specified in
35 RFC\-2045 thru RFC\-2049.  Currently \fImhshow\fR only supports
36 encodings in message bodies, and does not support the encoding of
37 message headers as specified in RFC\-2047.
38
39 By default \fImhshow\fR will display all parts of a multipart
40 message.  By using the `\-part' and `\-type' switches, you may
41 limit the scope of \fImhshow\fR to particular subparts (of a
42 multipart content) and/or particular content types.
43
44 The option `\-file\ file' directs \fImhshow\fR to use the specified file as
45 the source message, rather than a message from a folder.  If you specify
46 this file as \*(lq-\*(rq, then \fImhshow\fR will accept the source message
47 on the standard input.  Note that the file, or input from standard input
48 should be a validly formatted message, just like any other \fInmh\fR
49 message.  It should \fBNOT\fR be in mail drop format (to convert a file in
50 mail drop format to a folder of \fInmh\fR messages, see \fIinc\fR\0(1)).
51
52 A part specification consists of a series of numbers separated by dots.
53 For example, in a multipart content containing three parts, these
54 would be named as 1, 2, and 3, respectively.  If part 2 was also a
55 multipart content containing two parts, these would be named as 2.1 and
56 2.2, respectively.  Note that the `\-part' switch is effective for only
57 messages containing a multipart content.  If a message has some other
58 kind of content, or if the part is itself another multipart content, the
59 `\-part' switch will not prevent the content from being acted upon.
60
61 A content specification consists of a content type and a subtype.
62 The initial list of \*(lqstandard\*(rq content types and subtypes can
63 be found in RFC\-2046.
64 .ne 18
65 A list of commonly used contents is briefly reproduced here:
66 .sp
67 .nf
68 .in +.5i
69 .ta \w'application  'u
70 Type    Subtypes
71 ----    --------
72 text    plain, enriched
73 multipart       mixed, alternative, digest, parallel
74 message rfc822, partial, external-body
75 application     octet-stream, postscript
76 image   jpeg, gif, png
77 audio   basic
78 video   mpeg
79 .re
80 .in -.5i
81 .fi
82 .sp
83 A legal MIME message must contain a subtype specification.
84 .PP
85 To specify a content, regardless of its subtype, just use the
86 name of the content, e.g., \*(lqaudio\*(rq.  To specify a specific
87 subtype, separate the two with a slash, e.g., \*(lqaudio/basic\*(rq.
88 Note that regardless of the values given to the `\-type' switch, a
89 multipart content (of any subtype listed above) is always acted upon.
90 Further note that if the `\-type' switch is used, and it is desirable to
91 act on a message/external-body content, then the `\-type' switch must
92 be used twice: once for message/external-body and once for the content
93 externally referenced.
94
95 .Uh "Unseen Sequence"
96
97 If the profile entry \*(lqUnseen\-Sequence\*(rq is present and
98 non\-empty, then \fImhshow\fR will remove each of the messages shown
99 from each sequence named by the profile entry.
100
101 .Uh "Checking the Contents"
102 The `\-check' switch tells \fImhshow\fR to check each content for an
103 integrity checksum.  If a content has such a checksum (specified as a
104 Content-MD5 header field), then \fImhshow\fR will attempt to verify the
105 integrity of the content.
106
107 .Uh "Showing the Contents"
108 The headers of each message are displayed with the \fImhlproc\fR
109 (usually \fImhl\fR), using the standard format file \fImhl.headers\fR.
110 You may specify an alternate format file with the `\-form formfile'
111 switch.  If the format file \fImhl.null\fR is specified, then the display
112 of the message headers is suppressed.
113
114 Next, the contents are extracted from the message and are stored in
115 a temporary file.  Usually, the name of the temporary file the
116 word "mhshow" followed by a string of characters.  Occasionally,
117 the method used to display a content (described next), requires that
118 the file end in a specific suffix.  For example, the \fIsoffice\fR
119 command (part of the StarOffice package) can be used to display
120 MicroSoft Word content, but it uses the suffix to determine how to display
121 the file.  If no suffix is present, the file is not correctly loaded.
122 Similarily, older versions of the \fIgs\fR command append a ".ps" suffix to
123 the filename if one was missing.  As a result, these cannot be used to read
124 the default temporary file.
125
126 To get around this, your profile can contain lines of the form:
127 .sp
128 .in +.5i
129 mhshow-suffix-<type>/<subtype>: <suffix>
130 .in -.5i
131 .sp
132 or
133 .sp
134 .in +.5i
135 mhshow-suffix-<type>: <suffix>
136 .in -.5i
137 .sp
138 to specify a suffix which can be automatically added to the temporary
139 file created for a specific content type.  For example, the following
140 lines might appear in your profile:
141 .sp
142 .nf
143 .in +.5i
144 mhshow-suffix-text: .txt
145 mhshow-suffix-application/msword: .doc
146 mhshow-suffix-application/PostScript: .ps
147 .in -.5i
148 .fi
149 .sp
150 to automatically append a suffix to the temporary files.
151
152 The method used to display the different contents in the messages bodies
153 will be determined by a \*(lqdisplay string\*(rq.  To find the display
154 string, \fImhshow\fR will first search your profile for an entry of the
155 form:
156 .sp
157 .in +.5i
158 mhshow-show-<type>/<subtype>
159 .in -.5i
160 .sp
161 to determine the display string.  If this isn't found, \fImhshow\fR
162 will search for an entry of the form:
163 .sp
164 .in +.5i
165 mhshow-show-<type>
166 .in -.5i
167 .sp
168 to determine the display string.
169
170 If a display string is found, any escapes (given below) will be expanded.
171 The result will be executed under \fB/bin/sh\fR, with the standard input
172 set to the content.
173 .ne 16
174 The display string may contain the following escapes:
175 .sp
176 .nf
177 .in +.5i
178 .ta \w'%F  'u
179 %a      Insert parameters from Content-Type field
180 %e      exclusive execution
181 %f      Insert filename containing content
182 %F      %e, %f, and stdin is terminal not content
183 %l      display listing prior to displaying content
184 %p      %l, and ask for confirmation
185 %s      Insert content subtype
186 %d      Insert content description
187 %%      Insert the character %
188 .re
189 .in -.5i
190 .fi
191 .sp
192 .ne 10
193 For those display strings containing the e- or F-escape, \fImhshow\fR will
194 execute at most one of these at any given time.  Although the F-escape
195 expands to be the filename containing the content, the e-escape has no
196 expansion as far as the shell is concerned.
197
198 When the p-escape prompts for confirmation, typing INTR (usually
199 control-C) will tell \fImhshow\fR not to display that content.
200 The p-escape can be disabled by specifying the switch `\-nopause'.
201 Further, when \fImhshow\fR is display a content, typing QUIT (usually
202 control-\\) will tell \fImhshow\fR to wrap things up immediately.
203
204 Note that if the content being displayed is multipart, but not one of
205 the subtypes listed above, then the f- and F-escapes expand to multiple
206 filenames, one for each subordinate content.  Further, stdin is not
207 redirected from the terminal to the content.
208
209 If a display string is not found, \fImhshow\fR has several default values:
210 .sp
211 .nf
212 .in +.5i
213 mhshow-show-text/plain: %pmoreproc '%F'
214 mhshow-show-message/rfc822: %pshow -file '%F'
215 .in -.5i
216 .fi
217 .sp
218 If a subtype of type text doesn't have a profile entry, it will be
219 treated as text/plain.
220
221 \fImhshow\fR has default methods for handling multipart messages of subtype
222 mixed, alternative, parallel, and digest.  Any unknown subtype of type
223 multipart (without a profile entry), will be treated as multipart/mixed.
224
225 If none of these apply, then \fImhshow\fR will check to see if the message
226 has an application/octet-stream content with parameter \*(lqtype=tar\*(rq.
227 If so, \fImhshow\fR will use an appropriate command.  If not, \fImhshow\fR
228 will complain.
229
230 .ne 10
231 Example entries might be:
232 .sp
233 .nf
234 .in +.5i
235 mhshow-show-audio/basic: raw2audio 2>/dev/null | play
236 mhshow-show-image: xv '%f'
237 mhshow-show-application/PostScript: lpr -Pps
238 .in -.5i
239 .fi
240 .sp
241 Note that when using the f- or F-escape, it's a good idea to use
242 single-quotes around the escape.  This prevents misinterpretation by
243 the shell of any funny characters that might be present in the filename.
244
245 Finally, \fImhshow\fR will process each message serially\0--\0it won't start
246 showing the next message until all the commands executed to display the
247 current message have terminated.  In the case of a multipart content
248 (of any subtype listed above), the content contains advice indicating if
249 the parts should be displayed serially or in parallel.  Because this may
250 cause confusion, particularly on uni-window displays, the `\-serialonly'
251 switch can be given to tell \fImhshow\fR to never display parts in parallel.
252
253 .Uh "Showing Alternate Character Sets"
254 Because a content of type text might be in a non-ASCII character
255 set, when \fImhshow\fR encounters a \*(lqcharset\*(rq parameter for
256 this content, it checks if your terminal can display this character
257 set natively.  \fIMhn\fR checks this by examining the the environment
258 variable MM_CHARSET.  If the value of this environment variable is equal
259 to the value of the charset parameter, then \fImhshow\fR assumes it can
260 display this content without any additional setup.  If this environment
261 variable is not set, \fImhshow\fR will assume a value of \*(lqUS-ASCII\*(rq.
262 If the character set cannot be displayed natively, then \fImhshow\fR will
263 look for an entry of the form:
264 .sp
265 .in +.5i
266 mhshow-charset-<charset>
267 .in -.5i
268 .sp
269 which should contain a command creating an environment to render
270 the character set.  This command string should containing a single
271 \*(lq%s\*(rq, which will be filled-in with the command to display the
272 content.
273
274 Example entries might be:
275 .sp
276 .in +.5i
277 mhshow-charset-iso-8859-1: xterm -fn '-*-*-medium-r-normal-*-*-120-*-*-c-*-iso8859-*' -e %s
278 .in -.5i
279 or
280 .in +.5i
281 mhshow-charset-iso-8859-1: '%s'
282 .in -.5i
283 .sp
284 The first example tells \fImhshow\fR to start \fIxterm\fR and load the
285 appropriate character set for that message content.  The second example
286 tells \fImhshow\fR that your pager (or other program handling that content
287 type) can handle that character set, and that no special processing is
288 needed beforehand.
289 .sp
290 Note that many pagers strip off the high-order bit or have problems
291 displaying text with the high-order bit set.  However, the pager
292 \fIless\fR has support for single-octet character sets.  The source
293 to \fIless\fR is available on many ftp sites carrying free software.
294 In order to view messages sent in the ISO-8859-1 character set using
295 \fIless\fR,
296 .ne 9
297 put these lines in your \&.login file:
298 .sp
299 .nf
300 .in +.5i
301 setenv LESSCHARSET latin1
302 setenv LESS "-f"
303 .in -.5i
304 .fi
305 .sp
306 The first line tells \fIless\fR to use the ISO-8859-1 definition for
307 determining whether a character is \*(lqnormal\*(rq, \*(lqcontrol\*(lq,
308 or \*(lqbinary\*(rq.  The second line tells \fIless\fR not to warn you
309 if it encounters a file that has non-ASCII characters.  Then, simply
310 set the \fBmoreproc\fR profile entry to \fIless\fR, and it will get
311 called automatically.  (To handle other single-octet character sets,
312 look at the \fIless\fR\0(1) manual entry for information about the
313 \fBLESSCHARDEF\fR environment variable.)
314
315 .Uh "Messages of Type message/partial"
316 \fImhshow\fR cannot directly display messages of type partial.
317 You must reassemble them first into a normal message using
318 \fImhstore\fR.  Check the man page for \fImhstore\fR for details.
319
320 .Uh "External Access"
321 For contents of type message/external-body,
322 .ne 12
323 \fImhshow\fR supports these access-types:
324 .sp
325 .nf
326 .in +.5i
327 afs
328 anon-ftp
329 ftp
330 local-file
331 mail-server
332 .in -.5i
333 .fi
334 .sp
335 For the \*(lqanon-ftp\*(rq and \*(lqftp\*(rq access types,
336 \fImhshow\fR will look for the \fBnmh-access-ftp\fR
337 profile entry,
338 .ne 6
339 e.g.,
340 .sp
341 .in +.5i
342 nmh-access-ftp: myftp.sh
343 .in -.5i
344 .sp
345 to determine the pathname of a program to perform the FTP retrieval.
346 .ne 14
347 This program is invoked with these arguments:
348 .sp
349 .nf
350 .in +.5i
351 domain name of FTP-site
352 username
353 password
354 remote directory
355 remote filename
356 local filename
357 \*(lqascii\*(rq or \*(lqbinary\*(rq
358 .in -.5i
359 .fi
360 .sp
361 The program should terminate with an exit status of zero if the
362 retrieval is successful, and a non-zero exit status otherwise.
363
364 If this entry is not provided, then \fImhshow\fR will use a simple
365 built-in FTP client to perform the retrieval.
366
367 .Uh "The Content Cache"
368 When \fImhshow\fR encounters an external content containing a
369 \*(lqContent-ID:\*(rq field, and if the content allows caching, then
370 depending on the caching behavior of \fImhshow\fR, the content might be
371 read from or written to a cache.
372
373 The caching behavior of \fImhshow\fR is controlled with the `\-rcache'
374 and `\-wcache' switches, which define the policy for reading from,
375 and writing to, the cache, respectively.  One of four policies may be
376 specified: \*(lqpublic\*(rq, indicating that \fImhshow\fR should make use
377 of a publically-accessible content cache; \*(lqprivate\*(rq, indicating
378 that \fImhshow\fR should make use of the user's private content cache;
379 \*(lqnever\*(rq, indicating that \fImhshow\fR should never make use of
380 caching; and, \*(lqask\*(rq, indicating that \fImhshow\fR should ask
381 the user.
382
383 There are two directories where contents may be cached: the profile entry
384 \fBnmh-cache\fR names a directory containing world-readable contents, and,
385 the profile entry \fBnmh-private-cache\fR names a directory containing
386 private contents.  The former should be an absolute (rooted) directory
387 name.
388 .ne 6
389 For example,
390 .sp
391 .in +.5i
392 nmh-cache: /tmp
393 .in -.5i
394 .sp
395 might be used if you didn't care that the cache got wiped after each
396 reboot of the system.  The latter is interpreted relative to the user's
397 nmh directory, if not rooted,
398 .ne 6
399 e.g.,
400 .sp
401 .in +.5i
402 nmh-private-cache: .cache
403 .in -.5i
404 .sp
405 (which is the default value).
406
407 .Uh "User Environment"
408 Because the display environment in which \fImhshow\fR operates may vary for
409 different machines, \fImhshow\fR will look for the environment variable
410 \fB$MHSHOW\fR.  If present, this specifies the name of an additional
411 user profile which should be read.  Hence, when a user logs in on a
412 particular display device, this environment variable should be set to
413 refer to a file containing definitions useful for the given display device.
414 Normally, only entries that deal with the methods to display different
415 content type and subtypes
416 .sp
417 .in +.5i
418 mhshow-show-<type>/<subtype>
419 .br
420 mhshow-show-<type>
421 .in -.5i
422 .sp
423 need be present in this additional profile.
424 Finally,
425 \fImhshow\fR will attempt to consult one other additional user profile,
426 .ne 6
427 e.g.,
428 .sp
429 .in +.5i
430 %etcdir%/mhn.defaults
431 .in -.5i
432 .sp
433 which is created automatically during nmh installation.
434 .Fi
435 ^$HOME/\&.mh\(ruprofile~^The user profile
436 ^$MHSHOW~^Additional profile entries
437 ^%etcdir%/mhn.defaults~^System default MIME profile entries
438 ^%etcdir%/mhl.headers~^The headers template
439 .Pr
440 ^Path:~^To determine the user's nmh directory
441 .Ps
442 ^Current\-Folder:~^To find the default current folder
443 .Ps
444 ^Unseen\-Sequence:~^To name sequences denoting unseen messages
445 .Ps
446 ^mhlproc:~^Default program to display message headers
447 .Ps
448 ^nmh-access-ftp:~^Program to retrieve contents via FTP
449 .Ps
450 ^nmh-cache~^Public directory to store cached external contents
451 .Ps
452 ^nmh-private-cache~^Personal directory to store cached external contents
453 .Ps
454 ^mhshow-charset-<charset>~^Template for environment to render character sets
455 .Ps
456 ^mhshow-show-<type>*~^Template for displaying contents
457 .Ps
458 ^moreproc:~^Default program to display text/plain content
459 .Sa
460 mhbuild(1), mhl(1), mhlist(1), mhstore(1), sendfiles(1)
461 .br
462 RFC\-934:
463 .br
464    \fIProposed Standard for Message Encapsulation\fR,
465 .br
466 RFC\-2045:
467 .br
468    \fIMultipurpose Internet Mail Extensions (MIME) Part One:
469 .br
470    Format of Internet Message Bodies\fR,
471 .br
472 RFC\-2046:
473 .br
474    \fIMultipurpose Internet Mail Extensions (MIME) Part Two:
475 .br
476    Media Types\fR,
477 .br
478 RFC\-2047:
479 .br
480    \fIMultipurpose Internet Mail Extensions (MIME) Part Three:
481 .br
482    Message Header Extensions for Non-ASCII Text\fR,
483 .br
484 RFC\-2048:
485 .br
486    \fIMultipurpose Internet Mail Extensions (MIME) Part Four:
487 .br
488    Registration Procedures\fR,
489 .br
490 RFC\-2049:
491 .br
492    \fIMultipurpose Internet Mail Extensions (MIME) Part Five:
493 .br
494    Conformance Criteria and Examples\fR.
495 .De
496 `+folder' defaults to the current folder
497 .Ds
498 `msgs' defaults to cur
499 .Ds
500 `\-nocheck'
501 .Ds
502 `\-form mhl.headers'
503 .Ds
504 `\-pause'
505 .Ds
506 `\-rcache ask'
507 .Ds
508 `\-realsize'
509 .Ds
510 `\-noserialonly'
511 .Ds
512 `\-noverbose'
513 .Ds
514 `\-wcache ask'
515 .Co
516 If a folder is given, it will become the current folder.  The last
517 message selected will become the current message.
518 .En