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