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