4 .TH MHSHOW %manext1% "%nmhdate%" MH.6.8 [%nmhversion%]
6 mhshow \- display MIME messages
27 .RB [ \-check " | " \-nocheck ]
34 command display contents of a MIME (multi-media)
35 message or collection of messages.
38 manipulates multi-media messages as specified in
39 RFC\-2045 thru RFC\-2049. Currently
42 encodings in message bodies, and does not support the encoding of
43 message headers as specified in RFC\-2047.
47 will display all parts of a multipart
55 to particular subparts (of a
56 multipart content) and/or particular content types.
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
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
73 be in mail drop format (to convert a file in
74 mail drop format to a folder of
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
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
89 switch will not prevent the content from being acted upon.
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.
95 A list of commonly used contents is briefly reproduced here:
103 multipart mixed, alternative, digest, parallel
104 message rfc822, partial, external-body
105 application octet-stream, postscript
112 A legal MIME message must contain a subtype specification.
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
127 will remove each of the messages shown
128 from each sequence named by the profile entry.
129 .SS "Checking the Contents"
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
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
143 using the standard format file
145 You may specify an alternate format file with the
148 switch. If the format file
150 is specified, then the display
151 of the message headers is suppressed.
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
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
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.
168 To get around this, your profile can contain lines of the form:
171 mhshow-suffix-<type>/<subtype>: <suffix>
177 mhshow-suffix-<type>: <suffix>
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:
186 mhshow-suffix-text: .txt
187 mhshow-suffix-application/msword: .doc
188 mhshow-suffix-application/PostScript: .ps
192 to automatically append a suffix to the temporary files.
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
198 will first search your profile for an entry of the form:
201 mhshow-show-<type>/<subtype>
204 to determine the display string. If this isn't found,
206 will search for an entry of the form:
212 to determine the display string.
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
219 The display string may contain the following escapes:
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
230 %s Insert content subtype
231 %d Insert content description
232 %% Insert the character %
236 For those display strings containing the e- or F-escape,
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.
245 is display a content, typing QUIT (usually
246 control-\\) will tell
248 to wrap things up immediately.
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.
255 If a display string is not found,
257 has the following default values:
261 mhshow-show-text/plain: %l<defaultpager> '%F'
262 mhshow-show-message/rfc822: %lshow \-file '%F'
266 If a subtype of type text doesn't have a profile entry, it will be
267 treated as text/plain.
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.
274 If none of these apply, then
276 will check to see if the message
277 has an application/octet-stream content with parameter \*(lqtype=tar\*(rq.
280 will use an appropriate command. If not,
284 Example entries might be:
288 mhshow-show-audio/basic: raw2audio 2>/dev/null | play
289 mhshow-show-image: xv '%f'
290 mhshow-show-application/PostScript: lpr -Pps
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.
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,
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
312 encounters a \*(lqcharset\*(rq parameter for
313 this content, it checks if your terminal can display this character
316 checks this by examining the the environment
319 If the value of this environment variable is equal
320 to the value of the charset parameter, then
323 display this content without any additional setup. If this environment
326 will assume a value of \*(lqUS-ASCII\*(rq.
327 If the character set cannot be displayed natively, then
329 will look for an entry of the form:
332 mhshow-charset-<charset>
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
340 Example entries might be:
343 mhshow-charset-iso-8859-1: xterm -fn '-*-*-medium-r-normal-*-*-120-*-*-c-*-iso8859-*' -e %s
349 mhshow-charset-iso-8859-1: '%s'
352 The first example tells
357 appropriate character set for that message content. The second example
360 that your pager (or other program handling that content
361 type) can handle that character set, and that no special processing is
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
367 has support for single-octet character sets. The source
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
374 put these lines in your
380 setenv LESSCHARSET latin1
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
392 if it encounters a file that has non-ASCII characters. Then,
398 called automatically. (To handle other single-octet character sets,
401 manual entry for information about the
403 environment variable.)
404 .SS "Messages of Type message/partial"
406 cannot directly display messages of type partial.
407 You must reassemble them first into a normal message using
409 Check the man page for
412 .SS "External Access"
413 For contents of type message/external-body,
415 supports these access-types:
428 For the \*(lqanon-ftp\*(rq and \*(lqftp\*(rq access types,
430 will look for the \*(lqnmh-access-ftp\*(rq
434 nmh-access-ftp: myftp.sh
437 to determine the pathname of a program to perform the FTP retrieval.
439 This program is invoked with these arguments:
443 domain name of FTP-site
449 \*(lqascii\*(rq or \*(lqbinary\*(rq
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"
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
462 the content might be read from or written to a cache.
464 The caching behavior of
466 is controlled with the
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
475 of a publically-accessible content cache; \*(lqprivate\*(rq, indicating
478 should make use of the user's private content cache;
479 \*(lqnever\*(rq, indicating that
481 should never make use of
482 caching; and, \*(lqask\*(rq, indicating that
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
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.,
503 nmh-private-cache: .cache
506 (which is the default value).
507 .SS "User Environment"
508 Because the display environment in which
510 operates may vary for
513 will look for the environment variable
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
524 mhshow-show-<type>/<subtype>
529 need be present in this additional profile. Finally,
531 will attempt to consult one other additional user profile,
535 %etcdir%/mhn.defaults
538 which is created automatically during
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
552 .SH "PROFILE COMPONENTS"
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
569 mhbuild(1), mhl(1), mhlist(1), mhstore(1), sendfiles(1)
573 .RB ` +folder "' defaults to the current folder"
574 .RB ` msgs "' defaults to cur"
576 .RB ` \-form \ mhl.headers'
577 .RB ` \-rcache \ ask'
579 .RB ` \-wcache \ ask'
583 If a folder is given, it will become the current folder. The last
584 message selected will become the current message.