5 .TH MHSHOW %manext1% "%nmhdate%" MH.6.8 [%nmhversion%]
7 mhshow \- display MIME messages
21 .RB [ \-serialonly " | " \-noserialonly ]
22 .RB [ \-pause " | " \-nopause ]
29 .RB [ \-check " | " \-nocheck ]
35 command display contents of a MIME (multi-media)
36 message or collection of messages.
39 manipulates multi-media messages as specified in
40 RFC\-2045 thru RFC\-2049. Currently
43 encodings in message bodies, and does not support the encoding of
44 message headers as specified in RFC\-2047.
48 will display all parts of a multipart
56 to particular subparts (of a
57 multipart content) and/or particular content types.
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
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
74 be in mail drop format (to convert a file in
75 mail drop format to a folder of
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
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
90 switch will not prevent the content from being acted upon.
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.
96 A list of commonly used contents is briefly reproduced here:
100 .ta \w'application 'u
104 multipart mixed, alternative, digest, parallel
105 message rfc822, partial, external-body
106 application octet-stream, postscript
113 A legal MIME message must contain a subtype specification.
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
128 will remove each of the messages shown
129 from each sequence named by the profile entry.
130 .SS "Checking the Contents"
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
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 the
146 using the standard format file
148 You may specify an alternate format file with the
151 switch. If the format file
153 is specified, then the display
154 of the message headers is suppressed.
156 Next, the contents are extracted from the message and are stored in
157 a temporary file. Usually, the name of the temporary file is the
158 word \*(lqmhshow\*(rq followed by a string of characters. Occasionally,
159 the method used to display a content (described next), requires that
160 the file end in a specific suffix. For example, the
162 command (part of the StarOffice package) can be used to display
163 Microsoft Word content, but it uses the suffix to determine how to display
164 the file. If no suffix is present, the file is not correctly loaded.
165 Similarily, older versions of the
167 command append a \*(lq.ps\*(rq suffix to
168 the filename if one was missing. As a result, these cannot be used to read
169 the default temporary file.
171 To get around this, your profile can contain lines of the form:
174 mhshow-suffix-<type>/<subtype>: <suffix>
180 mhshow-suffix-<type>: <suffix>
183 to specify a suffix which can be automatically added to the temporary
184 file created for a specific content type. For example, the following
185 lines might appear in your profile:
189 mhshow-suffix-text: .txt
190 mhshow-suffix-application/msword: .doc
191 mhshow-suffix-application/PostScript: .ps
195 to automatically append a suffix to the temporary files.
197 The method used to display the different contents in the messages bodies
198 will be determined by a \*(lqdisplay string\*(rq. To find the display
201 will first search your profile for an entry of the form:
204 mhshow-show-<type>/<subtype>
207 to determine the display string. If this isn't found,
209 will search for an entry of the form:
215 to determine the display string.
217 If a display string is found, any escapes (given below) will be expanded.
218 The result will be executed under
219 \*(lq/bin/sh\*(rq, with the standard input
222 The display string may contain the following escapes:
227 %a Insert parameters from Content-Type field
228 %e exclusive execution
229 %f Insert filename containing content
230 %F %e, %f, and stdin is terminal not content
231 %l display listing prior to displaying content
232 %p %l, and ask for confirmation
233 %s Insert content subtype
234 %d Insert content description
235 %% Insert the character %
239 For those display strings containing the e- or F-escape,
242 execute at most one of these at any given time. Although the F-escape
243 expands to be the filename containing the content, the e-escape has no
244 expansion as far as the shell is concerned.
246 When the p-escape prompts for confirmation, typing INTR (usually
249 not to display that content.
250 The p-escape can be disabled by specifying the switch
254 is display a content, typing QUIT (usually
255 control-\\) will tell
257 to wrap things up immediately.
259 Note that if the content being displayed is multipart, but not one of
260 the subtypes listed above, then the f- and F-escapes expand to multiple
261 filenames, one for each subordinate content. Further, stdin is not
262 redirected from the terminal to the content.
264 If a display string is not found,
266 has several default values:
270 mhshow-show-text/plain: %pmoreproc '%F'
271 mhshow-show-message/rfc822: %pshow -file '%F'
275 If a subtype of type text doesn't have a profile entry, it will be
276 treated as text/plain.
279 has default methods for handling multipart messages of subtype
280 mixed, alternative, parallel, and digest. Any unknown subtype of type
281 multipart (without a profile entry), will be treated as multipart/mixed.
283 If none of these apply, then
285 will check to see if the message
286 has an application/octet-stream content with parameter \*(lqtype=tar\*(rq.
289 will use an appropriate command. If not,
293 Example entries might be:
297 mhshow-show-audio/basic: raw2audio 2>/dev/null | play
298 mhshow-show-image: xv '%f'
299 mhshow-show-application/PostScript: lpr -Pps
303 Note that when using the f- or F-escape, it's a good idea to use
304 single-quotes around the escape. This prevents misinterpretation by
305 the shell of any funny characters that might be present in the filename.
309 will process each message serially\0--\0it won't start
310 showing the next message until all the commands executed to display the
311 current message have terminated. In the case of a multipart content
312 (of any subtype listed above), the content contains advice indicating if
313 the parts should be displayed serially or in parallel. Because this may
314 cause confusion, particularly on uni-window displays, the
316 switch can be given to tell
318 to never display parts in parallel.
319 .SS "Showing Alternate Character Sets"
320 Because a content of type text might be in a non-ASCII character
323 encounters a \*(lqcharset\*(rq parameter for
324 this content, it checks if your terminal can display this character
327 checks this by examining the the environment
330 If the value of this environment variable is equal
331 to the value of the charset parameter, then
334 display this content without any additional setup. If this environment
337 will assume a value of \*(lqUS-ASCII\*(rq.
338 If the character set cannot be displayed natively, then
340 will look for an entry of the form:
343 mhshow-charset-<charset>
346 which should contain a command creating an environment to render
347 the character set. This command string should containing a single
348 \*(lq%s\*(rq, which will be filled-in with the command to display the
351 Example entries might be:
354 mhshow-charset-iso-8859-1: xterm -fn '-*-*-medium-r-normal-*-*-120-*-*-c-*-iso8859-*' -e %s
360 mhshow-charset-iso-8859-1: '%s'
363 The first example tells
368 appropriate character set for that message content. The second example
371 that your pager (or other program handling that content
372 type) can handle that character set, and that no special processing is
375 Note that many pagers strip off the high-order bit or have problems
376 displaying text with the high-order bit set. However, the pager
378 has support for single-octet character sets. The source
381 is available on many ftp sites carrying free software.
382 In order to view messages sent in the ISO-8859-1 character set using
385 put these lines in your
391 setenv LESSCHARSET latin1
398 to use the ISO-8859-1 definition for
399 determining whether a character is \*(lqnormal\*(rq, \*(lqcontrol\*(lq,
400 or \*(lqbinary\*(rq. The second line tells
403 if it encounters a file that has non-ASCII characters. Then, simply
409 called automatically. (To handle other single-octet character sets,
412 manual entry for information about the
414 environment variable.)
415 .SS "Messages of Type message/partial"
417 cannot directly display messages of type partial.
418 You must reassemble them first into a normal message using
420 Check the man page for
423 .SS "External Access"
424 For contents of type message/external-body,
426 supports these access-types:
439 For the \*(lqanon-ftp\*(rq and \*(lqftp\*(rq access types,
441 will look for the \*(lqnmh-access-ftp\*(rq
445 nmh-access-ftp: myftp.sh
448 to determine the pathname of a program to perform the FTP retrieval.
450 This program is invoked with these arguments:
454 domain name of FTP-site
460 \*(lqascii\*(rq or \*(lqbinary\*(rq
464 The program should terminate with an exit status of zero if the
465 retrieval is successful, and a non-zero exit status otherwise.
467 If this entry is not provided, then
470 built-in FTP client to perform the retrieval.
471 .SS "The Content Cache"
474 encounters an external content containing a
475 \*(lqContent-ID:\*(rq field, and if the content allows caching, then
476 depending on the caching behavior of
478 the content might be read from or written to a cache.
480 The caching behavior of
482 is controlled with the
486 switches, which define the policy for reading from,
487 and writing to, the cache, respectively. One of four policies may be
488 specified: \*(lqpublic\*(rq, indicating that
491 of a publically-accessible content cache; \*(lqprivate\*(rq, indicating
494 should make use of the user's private content cache;
495 \*(lqnever\*(rq, indicating that
497 should never make use of
498 caching; and, \*(lqask\*(rq, indicating that
502 There are two directories where contents may be cached: the profile entry
503 \*(lqnmh-cache\*(rq names a directory containing world-readable contents, and,
504 the profile entry \*(lqnmh-private-cache\*(rq names a directory containing
505 private contents. The former should be an absolute (rooted) directory
514 might be used if you didn't care that the cache got wiped after each
515 reboot of the system. The latter is interpreted relative to the user's
516 nmh directory, if not rooted, e.g.,
519 nmh-private-cache: .cache
522 (which is the default value).
523 .SS "User Environment"
524 Because the display environment in which
526 operates may vary for
529 will look for the environment variable
531 If present, this specifies the name of an additional
532 user profile which should be read. Hence, when a user logs in on a
533 particular display device, this environment variable should be set to
534 refer to a file containing definitions useful for the given display device.
535 Normally, only entries that deal with the methods to display different
536 content type and subtypes
540 mhshow-show-<type>/<subtype>
545 need be present in this additional profile. Finally,
547 will attempt to consult one other additional user profile,
551 %etcdir%/mhn.defaults
554 which is created automatically during
561 .ta \w'/usr/local/nmh/etc/ExtraBigFileName 'u
562 ^$HOME/\&.mh\(ruprofile~^The user profile
563 ^$MHSHOW~^Additional profile entries
564 ^%etcdir%/mhn.defaults~^System default MIME profile entries
565 ^%etcdir%/mhl.headers~^The headers template
568 .SH "PROFILE COMPONENTS"
572 .ta \w'ExtraBigProfileName 'u
573 ^Path:~^To determine the user's nmh directory
574 ^Current\-Folder:~^To find the default current folder
575 ^Unseen\-Sequence:~^To name sequences denoting unseen messages
576 ^mhlproc:~^Default program to display message headers
577 ^nmh-access-ftp:~^Program to retrieve contents via FTP
578 ^nmh-cache~^Public directory to store cached external contents
579 ^nmh-private-cache~^Personal directory to store cached external contents
580 ^mhshow-charset-<charset>~^Template for environment to render character sets
581 ^mhshow-show-<type>*~^Template for displaying contents
582 ^moreproc:~^Default program to display text/plain content
586 mhbuild(1), mhl(1), mhlist(1), mhstore(1), sendfiles(1)
590 .RB ` +folder "' defaults to the current folder"
591 .RB ` msgs "' defaults to cur"
593 .RB ` \-form mhl.headers '
597 .RB ` \-noserialonly '
603 If a folder is given, it will become the current folder. The last
604 message selected will become the current message.