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