Updated man page of mhshow(1) to recent changes.
[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 forms:
149 .PP
150 .RS 5
151 .nf
152 mhshow-suffix-<type>/<subtype>: <suffix>
153 mhshow-suffix-<type>: <suffix>
154 .fi
155 .RE
156 .PP
157 to specify a suffix which can be automatically added to the temporary
158 file created for a specific content type.  For example, the following
159 lines might appear in your profile:
160 .PP
161 .RS 5
162 .nf
163 mhshow-suffix-text: .txt
164 mhshow-suffix-application/msword: .doc
165 mhshow-suffix-application/PostScript: .ps
166 .fi
167 .RE
168 .PP
169 to automatically append a suffix to the temporary files.
170 .PP
171 The method used to display the different contents in the messages bodies
172 will be determined by a \*(lqdisplay string\*(rq.  To find the display
173 string,
174 .B mhshow
175 will first search your profile for an entry of the form:
176 .PP
177 .RS 5
178 mhshow-show-<type>/<subtype>
179 .RE
180 .PP
181 to determine the display string.  If this isn't found,
182 .B mhshow
183 will search for an entry of the form:
184 .PP
185 .RS 5
186 mhshow-show-<type>
187 .RE
188 .PP
189 to determine the display string.
190 .PP
191 If a display string is found, any escapes (given below) will be expanded.
192 The result will be executed under
193 \*(lq/bin/sh\*(rq, with the standard input
194 set to the content.
195 .PP
196 The display string may contain the following escapes:
197 .PP
198 .RS 5
199 .nf
200 .ta \w'%F  'u
201 %l      Display listing prior to displaying content
202 %f      Insert filename containing content
203 %F      %f, but stdin is terminal not content
204 %a      Insert parameters from Content-Type field
205 %s      Insert content subtype
206 %c      Insert foreign charset
207 %d      Insert content description
208 %%      The character %
209 .fi
210 .RE
211 .PP
212 .B Mhshow
213 processes the MIME parts serially, i.e. the next display process
214 is executed after the previous one has terminated.
215 .PP
216 Further, when
217 .B mhshow
218 is display a content, typing QUIT (usually
219 control-\\) will tell
220 .B mhshow
221 to wrap things up immediately.
222 .PP
223 Note that if the content being displayed is multipart, but not one of
224 the subtypes listed above, then the f- and F-escapes expand to multiple
225 filenames, one for each subordinate content.  Further, stdin is not
226 redirected from the terminal to the content.
227 .PP
228 If a display string is not found,
229 .B mhshow
230 has the following default values:
231 .PP
232 .RS 5
233 .nf
234 mhshow-show-text/plain: %liconv -f <source-charset>
235 mhshow-show-message/rfc822: %lshow \-file %F
236 .fi
237 .RE
238 .PP
239 If a subtype of type text doesn't have a profile entry, it will be
240 treated as text/plain.
241 .PP
242 .B mhshow
243 has default methods for handling multipart messages of subtype
244 mixed, alternative, parallel, and digest.  Any unknown subtype of type
245 multipart (without a profile entry), will be treated as multipart/mixed.
246 .PP
247 If none of these apply, then
248 .B mhshow
249 will complain.
250 .PP
251 Example entries might be:
252 .PP
253 .RS 5
254 .nf
255 mhshow-show-audio/basic: raw2audio 2>/dev/null | play
256 mhshow-show-image: xv %f
257 mhshow-show-application/PostScript: lpr -Pps
258 .fi
259 .RE
260 .PP
261 When expanding %f and %F escapes, the file names get wrapped in
262 single-quotes automatically.
263 .PP
264 Finally,
265 .B mhshow
266 will process each message serially \- it won't start
267 showing the next message until all the commands executed to display the
268 current message have terminated.  Although a multipart content may
269 contain advice to display the parts in parallel,
270 .B mhshow
271 will never do so.
272 .SS "Showing Alternate Character Sets"
273 Because a content of type text might be in a non-ASCII character
274 set, when
275 .B mhshow
276 encounters a \*(lqcharset\*(rq parameter for
277 this content, it checks if your terminal can display this character
278 set natively.
279 .B mhshow
280 checks this by first examining the the environment
281 variable
282 .B $MM_CHARSET
283 and if not set, taking the character encoding of the current locale.
284 .PP
285 If the character set of text/plain cannot be displayed natively, then
286 the default display method converts the content automatically by
287 piping it through:
288 .PP
289 .RS 5
290 iconv -f '<foreign-charset>'
291 .RE
292 .PP
293 Note that if you have a custom `mhshow-show-*' display string, you
294 need to care yourself for converting the encodings.
295 (The foreign charset is available through the %c escape.)
296 .PP
297 The tool
298 .B iconv
299 needs to be available.
300 .PP
301 `mhshow-charset-*' profile entries are not supported anymore.
302 .SS "Messages of Type message/partial"
303 .B mhshow
304 cannot directly display messages of type partial.
305 You must reassemble them first into a normal message using
306 .BR mhstore .
307 Check the man page for
308 .BR mhstore (1)
309 for details.
310 .SS "External Access"
311 .B Mhshow
312 does not automatically retrieve message/external-body parts (anymore),
313 but prints the relevant information to enable the user to retrieve
314 the files manually.
315 .SS "User Environment"
316 Because the display environment in which
317 .B mhshow
318 operates may vary for
319 different machines,
320 .B mhshow
321 will look for the environment variable
322 .BR $MHSHOW .
323 If present, this specifies the name of an additional
324 user profile which should be read.  Hence, when a user logs in on a
325 particular display device, this environment variable should be set to
326 refer to a file containing definitions useful for the given display device.
327 Normally, only entries that deal with the methods to display different
328 content type and subtypes
329 .PP
330 .RS 5
331 .nf
332 mhshow-show-<type>/<subtype>
333 mhshow-show-<type>
334 .fi
335 .RE
336 .PP
337 need be present in this additional profile. Finally,
338 .B mhshow
339 will attempt to consult one other additional user profile,
340 e.g.,
341 .PP
342 .RS 5
343 %etcdir%/mhn.defaults
344 .RE
345 .PP
346 which is created automatically during
347 .B nmh
348 installation.
349
350 .SH FILES
351 .fc ^ ~
352 .nf
353 .ta \w'%etcdir%/ExtraBigFileName  'u
354 ^$HOME/.mmh/profile~^The user profile
355 ^$MHSHOW~^Additional profile entries
356 ^%etcdir%/mhn.defaults~^System default MIME profile entries
357 ^%etcdir%/mhl.headers~^The headers template
358 .fi
359
360 .SH "PROFILE COMPONENTS"
361 .fc ^ ~
362 .nf
363 .ta 2.4i
364 .ta \w'ExtraBigProfileName  'u
365 ^Path:~^To determine the user's mail storage
366 ^Current\-Folder:~^To find the default current folder
367 ^Unseen\-Sequence:~^To name sequences denoting unseen messages
368 ^mhshow-show-<type>*~^Template for displaying contents
369 ^Pager:~^Default program to display text/plain content
370 .fi
371
372 .SH "SEE ALSO"
373 mhbuild(1), mhl(1), mhlist(1), mhstore(1), sendfiles(1)
374
375 .SH DEFAULTS
376 .nf
377 .RB ` +folder "' defaults to the current folder"
378 .RB ` msgs "' defaults to cur"
379 .RB ` \-form \ mhl.headers'
380 .RB ` \-noverbose '
381 .fi
382
383 .SH CONTEXT
384 If a folder is given, it will become the current folder.  The last
385 message selected will become the current message.