mhshow/mhstore: Removed support for retrieving message/external-body parts.
[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 .SS "Unseen Sequence"
115 If the profile entry \*(lqUnseen\-Sequence\*(rq is present and
116 non\-empty, then
117 .B mhshow
118 will remove each of the messages shown
119 from each sequence named by the profile entry.
120 .SS "Showing the Contents"
121 The headers of each message are displayed with
122 .B mhl
123 using the standard format file
124 .IR mhl.headers .
125 You may specify an alternate format file with the
126 .B \-form
127 .I formfile
128 switch.  If the format file
129 .I mhl.null
130 is specified, then the display
131 of the message headers is suppressed.
132 .PP
133 Next, the contents are extracted from the message and are stored in
134 a temporary file.  Usually, the name of the temporary file is the
135 word \*(lqmhshow\*(rq followed by a string of characters.  Occasionally,
136 the method used to display a content (described next), requires that
137 the file end in a specific suffix.  For example, the
138 .B soffice
139 command (part of the StarOffice package) can be used to display
140 Microsoft Word content, but it uses the suffix to determine how to display
141 the file.  If no suffix is present, the file is not correctly loaded.
142 Similarily, older versions of the
143 .B gs
144 command append a \*(lq.ps\*(rq suffix to
145 the filename if one was missing.  As a result, these cannot be used to read
146 the default temporary file.
147 .PP
148 To get around this, your profile can contain lines of the form:
149 .PP
150 .RS 5
151 mhshow-suffix-<type>/<subtype>: <suffix>
152 .RE
153 .PP
154 or
155 .PP
156 .RS 5
157 mhshow-suffix-<type>: <suffix>
158 .RE
159 .PP
160 to specify a suffix which can be automatically added to the temporary
161 file created for a specific content type.  For example, the following
162 lines might appear in your profile:
163 .PP
164 .RS 5
165 .nf
166 mhshow-suffix-text: .txt
167 mhshow-suffix-application/msword: .doc
168 mhshow-suffix-application/PostScript: .ps
169 .fi
170 .RE
171 .PP
172 to automatically append a suffix to the temporary files.
173 .PP
174 The method used to display the different contents in the messages bodies
175 will be determined by a \*(lqdisplay string\*(rq.  To find the display
176 string,
177 .B mhshow
178 will first search your profile for an entry of the form:
179 .PP
180 .RS 5
181 mhshow-show-<type>/<subtype>
182 .RE
183 .PP
184 to determine the display string.  If this isn't found,
185 .B mhshow
186 will search for an entry of the form:
187 .PP
188 .RS 5
189 mhshow-show-<type>
190 .RE
191 .PP
192 to determine the display string.
193 .PP
194 If a display string is found, any escapes (given below) will be expanded.
195 The result will be executed under
196 \*(lq/bin/sh\*(rq, with the standard input
197 set to the content.
198 .PP
199 The display string may contain the following escapes:
200 .PP
201 .RS 5
202 .nf
203 .ta \w'%F  'u
204 %a      Insert parameters from Content-Type field
205 %e      exclusive execution
206 %f      Insert filename containing content
207 %F      %e, %f, and stdin is terminal not content
208 %l      display listing prior to displaying content
209 %p      synonym to %l
210 %s      Insert content subtype
211 %d      Insert content description
212 %%      Insert the character %
213 .fi
214 .RE
215 .PP
216 For those display strings containing the e- or F-escape,
217 .B mhshow
218 will
219 execute at most one of these at any given time.  Although the F-escape
220 expands to be the filename containing the content, the e-escape has no
221 expansion as far as the shell is concerned.
222 .PP
223 Further, when
224 .B mhshow
225 is display a content, typing QUIT (usually
226 control-\\) will tell
227 .B mhshow
228 to wrap things up immediately.
229 .PP
230 Note that if the content being displayed is multipart, but not one of
231 the subtypes listed above, then the f- and F-escapes expand to multiple
232 filenames, one for each subordinate content.  Further, stdin is not
233 redirected from the terminal to the content.
234 .PP
235 If a display string is not found,
236 .B mhshow
237 has the following default values:
238 .PP
239 .RS 5
240 .nf
241 mhshow-show-text/plain: %l<defaultpager> '%F'
242 mhshow-show-message/rfc822: %lshow \-file '%F'
243 .fi
244 .RE
245 .PP
246 If a subtype of type text doesn't have a profile entry, it will be
247 treated as text/plain.
248 .PP
249 .B mhshow
250 has default methods for handling multipart messages of subtype
251 mixed, alternative, parallel, and digest.  Any unknown subtype of type
252 multipart (without a profile entry), will be treated as multipart/mixed.
253 .PP
254 If none of these apply, then
255 .B mhshow
256 will complain.
257 .PP
258 Example entries might be:
259 .PP
260 .RS 5
261 .nf
262 mhshow-show-audio/basic: raw2audio 2>/dev/null | play
263 mhshow-show-image: xv '%f'
264 mhshow-show-application/PostScript: lpr -Pps
265 .fi
266 .RE
267 .PP
268 Note that when using the f- or F-escape, it's a good idea to use
269 single-quotes around the escape.  This prevents misinterpretation by
270 the shell of any funny characters that might be present in the filename.
271 .PP
272 Finally,
273 .B mhshow
274 will process each message serially \- it won't start
275 showing the next message until all the commands executed to display the
276 current message have terminated.  In the case of a multipart content
277 (of any subtype listed above), the content contains advice indicating if
278 the parts should be displayed serially or in parallel.  Because this may
279 cause confusion, particularly on uni-window displays,
280 .B mhshow
281 will never display parts in parallel.
282 .SS "Showing Alternate Character Sets"
283 Because a content of type text might be in a non-ASCII character
284 set, when
285 .B mhshow
286 encounters a \*(lqcharset\*(rq parameter for
287 this content, it checks if your terminal can display this character
288 set natively.
289 .B mhn
290 checks this by examining the the environment
291 variable
292 .BR $MM_CHARSET .
293 If the value of this environment variable is equal
294 to the value of the charset parameter, then
295 .B mhshow
296 assumes it can
297 display this content without any additional setup.  If this environment
298 variable is not set,
299 .B mhshow
300 will assume a value of \*(lqUS-ASCII\*(rq.
301 If the character set cannot be displayed natively, then
302 .B mhshow
303 will look for an entry of the form:
304 .PP
305 .RS 5
306 mhshow-charset-<charset>
307 .RE
308 .PP
309 which should contain a command creating an environment to render
310 the character set.  This command string should containing a single
311 \*(lq%s\*(rq, which will be filled-in with the command to display the
312 content.
313 .PP
314 Example entries might be:
315 .PP
316 .RS 5
317 mhshow-charset-iso-8859-1: xterm -fn '-*-*-medium-r-normal-*-*-120-*-*-c-*-iso8859-*' -e %s
318 .RE
319 .PP
320 or
321 .PP
322 .RS 5
323 mhshow-charset-iso-8859-1: '%s'
324 .RE
325 .PP
326 The first example tells
327 .B mhshow
328 to start
329 .B xterm
330 and load the
331 appropriate character set for that message content.  The second example
332 tells
333 .B mhshow
334 that your pager (or other program handling that content
335 type) can handle that character set, and that no special processing is
336 needed beforehand.
337 .PP
338 Note that many pagers strip off the high-order bit or have problems
339 displaying text with the high-order bit set.  However, the pager
340 .B less
341 has support for single-octet character sets.  The source
342 to
343 .B less
344 is available on many ftp sites carrying free software.
345 In order to view messages sent in the ISO-8859-1 character set using
346 .BR less ,
347 .PP
348 put these lines in your
349 .I \&.login
350 file:
351 .PP
352 .RS 5
353 .nf
354 setenv LESSCHARSET latin1
355 setenv LESS "-f"
356 .fi
357 .RE
358 .PP
359 The first line tells
360 .B less
361 to use the ISO-8859-1 definition for
362 determining whether a character is \*(lqnormal\*(rq, \*(lqcontrol\*(lq,
363 or \*(lqbinary\*(rq.  The second line tells
364 .B less
365 not to warn you
366 if it encounters a file that has non-ASCII characters.  Then,
367 set the
368 .I Pager
369 profile entry to
370 .BR less ,
371 and it will get
372 called automatically.  (To handle other single-octet character sets,
373 look at the
374 .BR less (1)
375 manual entry for information about the
376 .B $LESSCHARDEF
377 environment variable.)
378 .SS "Messages of Type message/partial"
379 .B mhshow
380 cannot directly display messages of type partial.
381 You must reassemble them first into a normal message using
382 .BR mhstore .
383 Check the man page for
384 .BR mhstore (1)
385 for details.
386 .SS "External Access"
387 .B Mhshow
388 does not automatically retrieve message/external-body parts (anymore),
389 but prints the relevant information to enable the user to retrieve
390 the files manually.
391 .SS "User Environment"
392 Because the display environment in which
393 .B mhshow
394 operates may vary for
395 different machines,
396 .B mhshow
397 will look for the environment variable
398 .BR $MHSHOW .
399 If present, this specifies the name of an additional
400 user profile which should be read.  Hence, when a user logs in on a
401 particular display device, this environment variable should be set to
402 refer to a file containing definitions useful for the given display device.
403 Normally, only entries that deal with the methods to display different
404 content type and subtypes
405 .PP
406 .RS 5
407 .nf
408 mhshow-show-<type>/<subtype>
409 mhshow-show-<type>
410 .fi
411 .RE
412 .PP
413 need be present in this additional profile. Finally,
414 .B mhshow
415 will attempt to consult one other additional user profile,
416 e.g.,
417 .PP
418 .RS 5
419 %etcdir%/mhn.defaults
420 .RE
421 .PP
422 which is created automatically during
423 .B nmh
424 installation.
425
426 .SH FILES
427 .fc ^ ~
428 .nf
429 .ta \w'%etcdir%/ExtraBigFileName  'u
430 ^$HOME/.mmh/profile~^The user profile
431 ^$MHSHOW~^Additional profile entries
432 ^%etcdir%/mhn.defaults~^System default MIME profile entries
433 ^%etcdir%/mhl.headers~^The headers template
434 .fi
435
436 .SH "PROFILE COMPONENTS"
437 .fc ^ ~
438 .nf
439 .ta 2.4i
440 .ta \w'ExtraBigProfileName  'u
441 ^Path:~^To determine the user's mail storage
442 ^Current\-Folder:~^To find the default current folder
443 ^Unseen\-Sequence:~^To name sequences denoting unseen messages
444 ^mhshow-charset-<charset>~^Template for environment to render character sets
445 ^mhshow-show-<type>*~^Template for displaying contents
446 ^Pager:~^Default program to display text/plain content
447 .fi
448
449 .SH "SEE ALSO"
450 mhbuild(1), mhl(1), mhlist(1), mhstore(1), sendfiles(1)
451
452 .SH DEFAULTS
453 .nf
454 .RB ` +folder "' defaults to the current folder"
455 .RB ` msgs "' defaults to cur"
456 .RB ` \-form \ mhl.headers'
457 .RB ` \-noverbose '
458 .fi
459
460 .SH CONTEXT
461 If a folder is given, it will become the current folder.  The last
462 message selected will become the current message.