1 .TH MHSHOW %manext1% "February 9, 2014" "%nmhversion%"
6 mhshow \- display MIME messages
21 .RB [ \-serialonly " | " \-noserialonly ]
22 .RB [ \-pause " | " \-nopause ]
27 .RB "| " \-notextcharset ]
32 .RB [ \-check " | " \-nocheck ]
39 command display contents of a MIME (multi-media)
40 message or collection of messages.
43 manipulates multi-media messages as specified in
44 RFC 2045 to RFC 2049. Currently
47 encodings in message bodies, and does not support the encoding of
48 message headers as specified in RFC 2047.
52 will display all parts of a multipart
60 to particular subparts (of a
61 multipart content) and/or particular content types.
68 to use the specified file as
69 the source message, rather than a message from a folder. If you specify
70 this file as \*(lq-\*(rq, then
72 will accept the source message
73 on the standard input. Note that the file, or input from standard input
74 should be a validly formatted message, just like any other
78 be in mail drop format (to convert a file in
79 mail drop format to a folder of
84 A part specification consists of a series of numbers separated by dots.
85 For example, in a multipart content containing three parts, these
86 would be named as 1, 2, and 3, respectively. If part 2 was also a
87 multipart content containing two parts, these would be named as 2.1 and
88 2.2, respectively. Note that the
90 switch is effective for only
91 messages containing a multipart content. If a message has some other
92 kind of content, or if the part is itself another multipart content, the
94 switch will not prevent the content from being acted upon.
96 A content specification consists of a content type and a subtype.
97 The initial list of \*(lqstandard\*(rq content types and subtypes can
100 A list of commonly used contents is briefly reproduced here:
104 .ta \w'application 'u
108 multipart mixed, alternative, digest, parallel
109 message rfc822, partial, external-body
110 application octet-stream, postscript
117 A legal MIME message must contain a subtype specification.
119 To specify a content, regardless of its subtype, just use the
120 name of the content, e.g., \*(lqaudio\*(rq. To specify a specific
121 subtype, separate the two with a slash, e.g., \*(lqaudio/basic\*(rq.
122 Note that regardless of the values given to the `\-type' switch, a
123 multipart content (of any subtype listed above) is always acted upon.
124 Further note that if the `\-type' switch is used, and it is desirable to
125 act on a message/external-body content, then the `\-type' switch must
126 be used twice: once for message/external-body and once for the content
127 externally referenced.
128 .SS "Unseen Sequence"
129 If the profile entry \*(lqUnseen\-Sequence\*(rq is present and
132 will remove each of the messages shown
133 from each sequence named by the profile entry.
134 .SS "Checking the Contents"
139 to check each content for an
140 integrity checksum. If a content has such a checksum (specified as a
141 Content-MD5 header field), then
143 will attempt to verify the
144 integrity of the content.
145 .SS "Showing the Contents"
146 The headers of each message are displayed with the
150 using the standard format file
152 You may specify an alternate format file with the
155 switch. If the format file
157 is specified, then the display
158 of the message headers is suppressed.
160 Next, the contents are extracted from the message and are stored in
161 a temporary file. Usually, the name of the temporary file is the
162 word \*(lqmhshow\*(rq followed by a string of characters. Occasionally,
163 the method used to display a content (described next), requires that
164 the file end in a specific suffix. For example, the
166 command (part of the StarOffice package) can be used to display
167 Microsoft Word content, but it uses the suffix to determine how to display
168 the file. If no suffix is present, the file is not correctly loaded.
169 Similarily, older versions of the
171 command append a \*(lq.ps\*(rq suffix to
172 the filename if one was missing. As a result, these cannot be used to read
173 the default temporary file.
175 To get around this, your profile can contain lines of the form:
178 mhshow-suffix-<type>/<subtype>: <suffix>
184 mhshow-suffix-<type>: <suffix>
187 to specify a suffix which can be automatically added to the temporary
188 file created for a specific content type. For example, the following
189 lines might appear in your profile:
193 mhshow-suffix-text: .txt
194 mhshow-suffix-application/msword: .doc
195 mhshow-suffix-application/PostScript: .ps
199 to automatically append a suffix to the temporary files.
201 The method used to display the different contents in the messages bodies
202 will be determined by a \*(lqdisplay string\*(rq. To find the display
205 will first search your profile for an entry of the form:
208 mhshow-show-<type>/<subtype>
211 to determine the display string. If this isn't found,
213 will search for an entry of the form:
219 to determine the display string.
221 If a display string is found, any escapes (given below) will be expanded.
222 The result will be executed under
223 \*(lq/bin/sh\*(rq, with the standard input
226 The display string may contain the following escapes:
231 %a Insert parameters from Content-Type field
232 %e exclusive execution
233 %f Insert filename containing content
234 %F %e, %f, and stdin is terminal not content
235 %l display listing prior to displaying content
236 %p %l, and ask for confirmation
237 %s Insert content subtype
238 %d Insert content description
239 %% Insert the character %
243 For those display strings containing the e- or F-escape,
246 execute at most one of these at any given time. Although the F-escape
247 expands to be the filename containing the content, the e-escape has no
248 expansion as far as the shell is concerned.
250 When the p-escape prompts for confirmation, typing INTR (usually
253 not to display that content.
254 The p-escape can be disabled by specifying the switch
258 is display a content, typing QUIT (usually
259 control-\\) will tell
261 to wrap things up immediately.
263 Note that if the content being displayed is multipart, but not one of
264 the subtypes listed above, then the f- and F-escapes expand to multiple
265 filenames, one for each subordinate content. Further, stdin is not
266 redirected from the terminal to the content.
268 If a display string is not found,
270 behaves as if these profile entries were supplied and supported:
274 mhshow-show-text/plain: %pmoreproc '%F'
275 mhshow-show-message/rfc822: %pshow -file '%F'
279 Note that \*(lqmoreproc\*(rq is not supported in user profile display
282 If a subtype of type text doesn't have a profile entry, it will be
283 treated as text/plain.
286 has default methods for handling multipart messages of subtype
287 mixed, alternative, parallel, and digest. Any unknown subtype of type
288 multipart (without a profile entry), will be treated as multipart/mixed.
290 If none of these apply, then
292 will check to see if the message
293 has an application/octet-stream content with parameter \*(lqtype=tar\*(rq.
296 will use an appropriate command. If not,
300 Example entries might be:
304 mhshow-show-audio/basic: raw2audio 2>/dev/null | play
305 mhshow-show-image: xv '%f'
306 mhshow-show-application/PostScript: lpr -Pps
310 Note that when using the f- or F-escape, it's a good idea to use
311 single-quotes around the escape. This prevents misinterpretation by
312 the shell of any funny characters that might be present in the filename.
316 will process each message serially\0--\0it won't start
317 showing the next message until all the commands executed to display the
318 current message have terminated. In the case of a multipart content
319 (of any subtype listed above), the content contains advice indicating if
320 the parts should be displayed serially or in parallel. Because this may
321 cause confusion, particularly on uni-window displays, the
323 switch can be given to tell
325 to never display parts in parallel.
326 .SS "Showing Alternate Character Sets"
331 then all text/plain parts of the message(s) will be displayed
332 using the character set of the current locale. This character
333 set can be overridden with the
335 switch. To convert text parts other than text/plain, or if
339 an external program can be used, as described next.
341 Because a content of type text might be in a non-ASCII character
344 encounters a \*(lqcharset\*(rq parameter for
345 this content, it checks if your terminal can display this character
348 checks this by examining the current character set defined by the
350 environment variables.
351 If the value of the locale character set is equal
352 to the value of the charset parameter, then
355 display this content without any additional setup. If the locale is not
358 will assume a value of \*(lqUS-ASCII\*(rq.
359 If the character set cannot be displayed natively, then
361 will look for an entry of the form:
364 mhshow-charset-<charset>
367 which should contain a command creating an environment to render
368 the character set. This command string should containing a single
369 \*(lq%s\*(rq, which will be filled-in with the command to display the
372 Example entries might be:
375 mhshow-charset-iso-8859-1: xterm -fn '-*-*-medium-r-normal-*-*-120-*-*-c-*-iso8859-*' -e %s
381 mhshow-charset-iso-8859-1: '%s'
384 The first example tells
389 appropriate character set for that message content. The second example
392 that your pager (or other program handling that content
393 type) can handle that character set, and that no special processing is
396 Note that many pagers strip off the high-order bit or have problems
397 displaying text with the high-order bit set. However, the pager
399 has support for single-octet character sets. For example, messages
400 encoded in the ISO-8859-1 character set can be view using
402 with these environment variable settings:
412 The first setting tells
414 to use the ISO-8859-1 definition for
415 determining whether a character is \*(lqnormal\*(rq, \*(lqcontrol\*(lq,
416 or \*(lqbinary\*(rq. The second setting tells
419 if it encounters a file that has non-ASCII characters. Then, simply
425 called automatically. (To handle other single-octet character sets,
428 manual entry for information about the
430 environment variable.)
431 .SS "Messages of Type message/partial"
433 cannot directly display messages of type partial.
434 You must reassemble them first into a normal message using
436 Check the man page for
439 .SS "External Access"
440 For contents of type message/external-body,
442 supports these access-types:
457 For the \*(lqanon-ftp\*(rq and \*(lqftp\*(rq access types,
459 will look for the \*(lqnmh-access-ftp\*(rq
463 nmh-access-ftp: myftp.sh
466 to determine the pathname of a program to perform the FTP retrieval.
468 This program is invoked with these arguments:
472 domain name of FTP-site
478 \*(lqascii\*(rq or \*(lqbinary\*(rq
482 The program should terminate with an exit status of zero if the
483 retrieval is successful, and a non-zero exit status otherwise.
485 For the \*(lqurl\*(rq access\-type,
487 will look for the \*(lqnmh-access-url\*(rq
492 .SS "The Content Cache"
495 encounters an external content containing a
496 \*(lqContent-ID:\*(rq field, and if the content allows caching, then
497 depending on the caching behavior of
499 the content might be read from or written to a cache.
501 The caching behavior of
503 is controlled with the
507 switches, which define the policy for reading from,
508 and writing to, the cache, respectively. One of four policies may be
509 specified: \*(lqpublic\*(rq, indicating that
512 of a publically-accessible content cache; \*(lqprivate\*(rq, indicating
515 should make use of the user's private content cache;
516 \*(lqnever\*(rq, indicating that
518 should never make use of
519 caching; and, \*(lqask\*(rq, indicating that
523 There are two directories where contents may be cached: the profile entry
524 \*(lqnmh-cache\*(rq names a directory containing world-readable contents, and,
525 the profile entry \*(lqnmh-private-cache\*(rq names a directory containing
526 private contents. The former should be an absolute (rooted) directory
535 might be used if you didn't care that the cache got wiped after each
536 reboot of the system. The latter is interpreted relative to the user's
537 nmh directory, if not rooted, e.g.,
540 nmh-private-cache: .cache
543 (which is the default value).
544 .SS "User Environment"
545 Because the display environment in which
547 operates may vary for
550 will look for the environment variable
552 If present, this specifies the name of an additional
553 user profile which should be read. Hence, when a user logs in on a
554 particular display device, this environment variable should be set to
555 refer to a file containing definitions useful for the given display device.
556 Normally, only entries that deal with the methods to display different
557 content type and subtypes
561 mhshow-show-<type>/<subtype>
566 need be present in this additional profile. Finally,
568 will attempt to consult one other additional user profile,
572 %etcdir%/mhn.defaults
575 which is created automatically during
580 looks for all format files and mhn.defaults in multiple locations:
581 absolute pathnames are accessed directly, tilde expansion is done on
582 usernames, and files are searched for in the user's
584 directory as specified in their profile. If not found there, the directory
585 .RI \*(lq %etcdir% \*(rq
590 .ta \w'%etcdir%/ExtraBigFileName 'u
591 ^$HOME/\&.mh\(ruprofile~^The user profile
592 ^$MHSHOW~^Additional profile entries
593 ^%etcdir%/mhn.defaults~^System default MIME profile entries
594 ^%etcdir%/mhl.headers~^The headers template
596 .SH "PROFILE COMPONENTS"
600 .ta \w'ExtraBigProfileName 'u
601 ^Path:~^To determine the user's nmh directory
602 ^Current\-Folder:~^To find the default current folder
603 ^Unseen\-Sequence:~^To name sequences denoting unseen messages
604 ^mhlproc:~^Default program to display message headers
605 ^nmh-access-ftp:~^Program to retrieve contents via FTP
606 ^nmh-access-url:~^Program to retrieve contents via HTTP
607 ^nmh-cache~^Public directory to store cached external contents
608 ^nmh-private-cache~^Personal directory to store cached external contents
609 ^mhshow-charset-<charset>~^Template for environment to render character sets
610 ^mhshow-show-<type>*~^Template for displaying contents
611 ^moreproc:~^Default program to display text/plain content
622 .RB ` +folder "' defaults to the current folder"
623 .RB ` msgs "' defaults to cur"
625 .RB ` \-form\ mhl.headers '
627 .RB ` \-notextcharset '
628 .RB ` \-rcache\ ask '
629 .RB ` \-noserialonly '
630 .RB ` \-wcache\ ask '
633 If a folder is given, it will become the current folder. The last
634 message selected will become the current message.