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