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