1 .TH MHSHOW %manext1% "February 18, 2014" "%nmhversion%"
6 mhshow \- display MIME messages
21 .RB [ \-serialonly " | " \-noserialonly ]
22 .RB [ \-pause " | " \-nopause ]
29 .RB [ \-check " | " \-nocheck ]
36 command display contents of a MIME (multi-media)
37 message or collection of messages.
40 manipulates multi-media messages as specified in
41 RFC 2045 to RFC 2049. Currently
44 encodings in message bodies, and does not support the encoding of
45 message headers as specified in RFC 2047.
49 will display all parts of a multipart
57 to particular subparts (of a
58 multipart content) and/or particular content types.
65 to use the specified file as
66 the source message, rather than a message from a folder. If you specify
67 this file as \*(lq-\*(rq, then
69 will accept the source message
70 on the standard input. Note that the file, or input from standard input
71 should be a validly formatted message, just like any other
75 be in mail drop format (to convert a file in
76 mail drop format to a folder of
81 A part specification consists of a series of numbers separated by dots.
82 For example, in a multipart content containing three parts, these
83 would be named as 1, 2, and 3, respectively. If part 2 was also a
84 multipart content containing two parts, these would be named as 2.1 and
85 2.2, respectively. Note that the
87 switch is effective for only
88 messages containing a multipart content. If a message has some other
89 kind of content, or if the part is itself another multipart content, the
91 switch will not prevent the content from being acted upon.
93 A content specification consists of a content type and a subtype.
94 The initial list of \*(lqstandard\*(rq content types and subtypes can
97 A list of commonly used contents is briefly reproduced here:
101 .ta \w'application 'u
105 multipart mixed, alternative, digest, parallel
106 message rfc822, partial, external-body
107 application octet-stream, postscript
114 A legal MIME message must contain a subtype specification.
116 To specify a content, regardless of its subtype, just use the
117 name of the content, e.g., \*(lqaudio\*(rq. To specify a specific
118 subtype, separate the two with a slash, e.g., \*(lqaudio/basic\*(rq.
119 Note that regardless of the values given to the `\-type' switch, a
120 multipart content (of any subtype listed above) is always acted upon.
121 Further note that if the `\-type' switch is used, and it is desirable to
122 act on a message/external-body content, then the `\-type' switch must
123 be used twice: once for message/external-body and once for the content
124 externally referenced.
125 .SS "Unseen Sequence"
126 If the profile entry \*(lqUnseen\-Sequence\*(rq is present and
129 will remove each of the messages shown
130 from each sequence named by the profile entry.
131 .SS "Checking the Contents"
136 to check each content for an
137 integrity checksum. If a content has such a checksum (specified as a
138 Content-MD5 header field), then
140 will attempt to verify the
141 integrity of the content.
142 .SS "Showing the Contents"
143 The headers of each message are displayed with the
147 using the standard format file
149 You may specify an alternate format file with the
152 switch. If the format file
154 is specified, then the display
155 of the message headers is suppressed.
157 Next, the contents are extracted from the message and are stored in
158 a temporary file. Usually, the name of the temporary file is the
159 word \*(lqmhshow\*(rq followed by a string of characters. Occasionally,
160 the method used to display a content (described next), requires that
161 the file end in a specific suffix. For example, the
163 command (part of the StarOffice package) can be used to display
164 Microsoft Word content, but it uses the suffix to determine how to display
165 the file. If no suffix is present, the file is not correctly loaded.
166 Similarily, older versions of the
168 command append a \*(lq.ps\*(rq suffix to
169 the filename if one was missing. As a result, these cannot be used to read
170 the default temporary file.
172 To get around this, your profile can contain lines of the form:
175 mhshow-suffix-<type>/<subtype>: <suffix>
181 mhshow-suffix-<type>: <suffix>
184 to specify a suffix which can be automatically added to the temporary
185 file created for a specific content type. For example, the following
186 lines might appear in your profile:
190 mhshow-suffix-text: .txt
191 mhshow-suffix-application/msword: .doc
192 mhshow-suffix-application/PostScript: .ps
196 to automatically append a suffix to the temporary files.
198 The method used to display the different contents in the messages bodies
199 will be determined by a \*(lqdisplay string\*(rq. To find the display
202 will first search your profile for an entry of the form:
205 mhshow-show-<type>/<subtype>
208 to determine the display string. If this isn't found,
210 will search for an entry of the form:
216 to determine the display string.
218 If a display string is found, any escapes (given below) will be expanded.
219 The result will be executed under
220 \*(lq/bin/sh\*(rq, with the standard input
223 The display string may contain the following escapes:
228 %a Insert parameters from Content-Type field
229 %{parameter} Insert the parameter value from the Content-Type field
230 %e exclusive execution
231 %f Insert filename containing content
232 %F %e, %f, and stdin is terminal not content
233 %l display listing prior to displaying content
234 %p %l, and ask for confirmation
235 %s Insert content subtype
236 %d Insert content description
237 %% Insert the character %
241 For those display strings containing the e- or F-escape,
244 execute at most one of these at any given time. Although the F-escape
245 expands to be the filename containing the content, the e-escape has no
246 expansion as far as the shell is concerned.
248 When the p-escape prompts for confirmation, typing INTR (usually
251 not to display that content.
252 The p-escape can be disabled by specifying the switch
256 is display a content, typing QUIT (usually
257 control-\\) will tell
259 to wrap things up immediately.
261 The {parameter} escape is typically used in a command line argument
262 that should only be present if it has a non-null value. Its value
263 will be wrapped with single quotes if the escape is not so wrapped.
264 Shell parameter expansion can construct the argument only when it is
269 mhshow-show-text/html: charset=%{charset};
270 w3m ${charset:+-I $charset} -T text/html %F
274 That example also shows the use of indentation to signify continuation:
275 the two text lines combine to form a single entry.
277 Note that if the content being displayed is multipart, but not one of
278 the subtypes listed above, then the f- and F-escapes expand to multiple
279 filenames, one for each subordinate content. Further, stdin is not
280 redirected from the terminal to the content.
282 If a display string is not found,
284 behaves as if these profile entries were supplied and supported:
288 mhshow-show-text/plain: %pmoreproc %F
289 mhshow-show-message/rfc822: %pshow -file %F
293 Note that \*(lqmoreproc\*(rq is not supported in user profile display
296 If a subtype of type text doesn't have a profile entry, it will be
297 treated as text/plain.
300 has default methods for handling multipart messages of subtype
301 mixed, alternative, parallel, and digest. Any unknown subtype of type
302 multipart (without a profile entry), will be treated as multipart/mixed.
304 If none of these apply, then
306 will check to see if the message
307 has an application/octet-stream content with parameter \*(lqtype=tar\*(rq.
310 will use an appropriate command. If not,
314 Example entries might be:
318 mhshow-show-audio/basic: raw2audio 2>/dev/null | play
319 mhshow-show-image: xv %f
320 mhshow-show-application/PostScript: lpr -Pps
324 If an f- or F-escape is not quoted with single quotes, its expansion
325 will be wrapped with single quotes.
329 will process each message serially\0--\0it won't start
330 showing the next message until all the commands executed to display the
331 current message have terminated. In the case of a multipart content
332 (of any subtype listed above), the content contains advice indicating if
333 the parts should be displayed serially or in parallel. Because this may
334 cause confusion, particularly on uni-window displays, the
336 switch can be given to tell
338 to never display parts in parallel.
339 .SS "Showing Alternate Character Sets"
344 then all text/plain parts of the message(s) will be displayed using
345 the character set of the current locale. To convert text parts other
346 than text/plain, or if
350 an external program can be used, as described next.
352 Because a content of type text might be in a non-ASCII character
355 encounters a \*(lqcharset\*(rq parameter for
356 this content, it checks if your terminal can display this character
359 checks this by examining the current character set defined by the
361 environment variables.
362 If the value of the locale character set is equal
363 to the value of the charset parameter, then
366 display this content without any additional setup. If the locale is not
369 will assume a value of \*(lqUS-ASCII\*(rq.
370 If the character set cannot be displayed natively, then
372 will look for an entry of the form:
375 mhshow-charset-<charset>
378 which should contain a command creating an environment to render
379 the character set. This command string should containing a single
380 \*(lq%s\*(rq, which will be filled-in with the command to display the
383 Example entries might be:
386 mhshow-charset-iso-8859-1: xterm -fn '-*-*-medium-r-normal-*-*-120-*-*-c-*-iso8859-*' -e %s
392 mhshow-charset-iso-8859-1: '%s'
395 The first example tells
400 appropriate character set for that message content. The second example
403 that your pager (or other program handling that content
404 type) can handle that character set, and that no special processing is
407 Note that many pagers strip off the high-order bit or have problems
408 displaying text with the high-order bit set. However, the pager
410 has support for single-octet character sets. For example, messages
411 encoded in the ISO-8859-1 character set can be view using
413 with these environment variable settings:
423 The first setting tells
425 to use the ISO-8859-1 definition for
426 determining whether a character is \*(lqnormal\*(rq, \*(lqcontrol\*(lq,
427 or \*(lqbinary\*(rq. The second setting tells
430 if it encounters a file that has non-ASCII characters. Then, simply
436 called automatically. (To handle other single-octet character sets,
439 manual entry for information about the
441 environment variable.)
442 .SS "Messages of Type message/partial"
444 cannot directly display messages of type partial.
445 You must reassemble them first into a normal message using
447 Check the man page for
450 .SS "External Access"
451 For contents of type message/external-body,
453 supports these access-types:
468 For the \*(lqanon-ftp\*(rq and \*(lqftp\*(rq access types,
470 will look for the \*(lqnmh-access-ftp\*(rq
474 nmh-access-ftp: myftp.sh
477 to determine the pathname of a program to perform the FTP retrieval.
479 This program is invoked with these arguments:
483 domain name of FTP-site
489 \*(lqascii\*(rq or \*(lqbinary\*(rq
493 The program should terminate with an exit status of zero if the
494 retrieval is successful, and a non-zero exit status otherwise.
496 For the \*(lqurl\*(rq access\-type,
498 will look for the \*(lqnmh-access-url\*(rq
503 .SS "The Content Cache"
506 encounters an external content containing a
507 \*(lqContent-ID:\*(rq field, and if the content allows caching, then
508 depending on the caching behavior of
510 the content might be read from or written to a cache.
512 The caching behavior of
514 is controlled with the
518 switches, which define the policy for reading from,
519 and writing to, the cache, respectively. One of four policies may be
520 specified: \*(lqpublic\*(rq, indicating that
523 of a publically-accessible content cache; \*(lqprivate\*(rq, indicating
526 should make use of the user's private content cache;
527 \*(lqnever\*(rq, indicating that
529 should never make use of
530 caching; and, \*(lqask\*(rq, indicating that
534 There are two directories where contents may be cached: the profile entry
535 \*(lqnmh-cache\*(rq names a directory containing world-readable contents, and,
536 the profile entry \*(lqnmh-private-cache\*(rq names a directory containing
537 private contents. The former should be an absolute (rooted) directory
546 might be used if you didn't care that the cache got wiped after each
547 reboot of the system. The latter is interpreted relative to the user's
548 nmh directory, if not rooted, e.g.,
551 nmh-private-cache: .cache
554 (which is the default value).
555 .SS "User Environment"
556 Because the display environment in which
558 operates may vary for
561 will look for the environment variable
563 If present, this specifies the name of an additional
564 user profile which should be read. Hence, when a user logs in on a
565 particular display device, this environment variable should be set to
566 refer to a file containing definitions useful for the given display device.
567 Normally, only entries that deal with the methods to display different
568 content type and subtypes
572 mhshow-show-<type>/<subtype>
577 need be present in this additional profile. Finally,
579 will attempt to consult one other additional user profile,
583 %etcdir%/mhn.defaults
586 which is created automatically during
591 looks for all format files and mhn.defaults in multiple locations:
592 absolute pathnames are accessed directly, tilde expansion is done on
593 usernames, and files are searched for in the user's
595 directory as specified in their profile. If not found there, the directory
596 .RI \*(lq %etcdir% \*(rq
601 .ta \w'%etcdir%/ExtraBigFileName 'u
602 ^$HOME/\&.mh\(ruprofile~^The user profile
603 ^$MHSHOW~^Additional profile entries
604 ^%etcdir%/mhn.defaults~^System default MIME profile entries
605 ^%etcdir%/mhl.headers~^The headers template
607 .SH "PROFILE COMPONENTS"
611 .ta \w'ExtraBigProfileName 'u
612 ^Path:~^To determine the user's nmh directory
613 ^Current\-Folder:~^To find the default current folder
614 ^Unseen\-Sequence:~^To name sequences denoting unseen messages
615 ^mhlproc:~^Default program to display message headers
616 ^nmh-access-ftp:~^Program to retrieve contents via FTP
617 ^nmh-access-url:~^Program to retrieve contents via HTTP
618 ^nmh-cache~^Public directory to store cached external contents
619 ^nmh-private-cache~^Personal directory to store cached external contents
620 ^mhshow-charset-<charset>~^Template for environment to render character sets
621 ^mhshow-show-<type>*~^Template for displaying contents
622 ^moreproc:~^Default program to display text/plain content
633 .RB ` +folder "' defaults to the current folder"
634 .RB ` msgs "' defaults to cur"
636 .RB ` \-form\ mhl.headers '
638 .RB ` \-rcache\ ask '
639 .RB ` \-noserialonly '
640 .RB ` \-wcache\ ask '
643 If a folder is given, it will become the current folder. The last
644 message selected will become the current message.