1MHSHOW(1)                    [nmh-1.2-20070115cvs]                   MHSHOW(1)
2
3
4

NAME

6       mhshow - display MIME messages
7

SYNOPSIS

9       mhshow [+folder] [msgs] [-file file] [-part number] ...  [-type con‐
10            tent] ...  [-serialonly | -noserialonly] [-pause | -nopause]
11            [-form formfile] [-rcache policy] [-wcache policy] [-check |
12            -nocheck] [-version] [-help]
13

DESCRIPTION

15       The mhshow command display contents of a MIME (multi-media) message  or
16       collection of messages.
17
18       mhshow  manipulates  multi-media messages as specified in RFC-2045 thru
19       RFC-2049.  Currently mhshow only supports encodings in message  bodies,
20       and  does  not  support the encoding of message headers as specified in
21       RFC-2047.
22
23       By default mhshow will display all parts of a  multipart  message.   By
24       using  the  -part and -type switches, you may limit the scope of mhshow
25       to particular subparts (of a multipart content) and/or particular  con‐
26       tent types.
27
28       The  option  -file file directs mhshow to use the specified file as the
29       source message, rather than a message from a folder.   If  you  specify
30       this  file  as  “-”,  then mhshow will accept the source message on the
31       standard input.  Note that the  file,  or  input  from  standard  input
32       should be a validly formatted message, just like any other nmh message.
33       It should NOT be in mail drop format (to convert a file  in  mail  drop
34       format to a folder of nmh messages, see inc(1)).
35
36       A part specification consists of a series of numbers separated by dots.
37       For example, in a multipart content containing three parts, these would
38       be  named as 1, 2, and 3, respectively.  If part 2 was also a multipart
39       content containing two parts, these would be  named  as  2.1  and  2.2,
40       respectively.   Note  that  the -part switch is effective for only mes‐
41       sages containing a multipart content.  If a message has some other kind
42       of  content,  or  if  the part is itself another multipart content, the
43       -part switch will not prevent the content from being acted upon.
44
45       A content specification consists of a content type and a subtype.   The
46       initial  list  of “standard” content types and subtypes can be found in
47       RFC-2046.
48
49       A list of commonly used contents is briefly reproduced here:
50
51            Type         Subtypes
52            ----         --------
53            text         plain, enriched
54            multipart    mixed, alternative, digest, parallel
55            message      rfc822, partial, external-body
56            application  octet-stream, postscript
57            image        jpeg, gif, png
58            audio        basic
59            video        mpeg
60
61       A legal MIME message must contain a subtype specification.
62
63       To specify a content, regardless of its subtype, just use the  name  of
64       the  content,  e.g.,  “audio”.  To specify a specific subtype, separate
65       the two with a slash, e.g., “audio/basic”.  Note that regardless of the
66       values given to the `-type' switch, a multipart content (of any subtype
67       listed above) is always acted upon.  Further note that if  the  `-type'
68       switch  is  used, and it is desirable to act on a message/external-body
69       content, then the `-type' switch must be  used  twice:  once  for  mes‐
70       sage/external-body and once for the content externally referenced.
71
72   Unseen Sequence
73       If  the  profile entry “Unseen-Sequence” is present and non-empty, then
74       mhshow will remove each of the messages shown from each sequence  named
75       by the profile entry.
76
77   Checking the Contents
78       The  -check  switch tells mhshow to check each content for an integrity
79       checksum.  If a content has such a checksum (specified as a Content-MD5
80       header  field), then mhshow will attempt to verify the integrity of the
81       content.
82
83   Showing the Contents
84       The headers of each message are displayed  with  the  mhlproc  (usually
85       mhl),  using  the standard format file mhl.headers.  You may specify an
86       alternate format file with the -form formfile switch.   If  the  format
87       file  mhl.null is specified, then the display of the message headers is
88       suppressed.
89
90       Next, the contents are extracted from the message and are stored  in  a
91       temporary  file.   Usually,  the name of the temporary file is the word
92       “mhshow” followed by a string of characters.  Occasionally, the  method
93       used  to display a content (described next), requires that the file end
94       in a specific suffix.  For example, the soffice command  (part  of  the
95       StarOffice  package) can be used to display Microsoft Word content, but
96       it uses the suffix to determine how to display the file.  If no  suffix
97       is  present,  the file is not correctly loaded.  Similarily, older ver‐
98       sions of the gs command append a “.ps” suffix to the  filename  if  one
99       was  missing.   As  a  result, these cannot be used to read the default
100       temporary file.
101
102       To get around this, your profile can contain lines of the form:
103
104            mhshow-suffix-<type>/<subtype>: <suffix>
105
106       or
107
108            mhshow-suffix-<type>: <suffix>
109
110       to specify a suffix which can be automatically added to  the  temporary
111       file  created  for a specific content type.  For example, the following
112       lines might appear in your profile:
113
114            mhshow-suffix-text: .txt
115            mhshow-suffix-application/msword: .doc
116            mhshow-suffix-application/PostScript: .ps
117
118       to automatically append a suffix to the temporary files.
119
120       The method used to display the different contents in the messages  bod‐
121       ies  will  be  determined  by  a “display string”.  To find the display
122       string, mhshow will first search your profile for an entry of the form:
123
124            mhshow-show-<type>/<subtype>
125
126       to determine the display string.  If  this  isn't  found,  mhshow  will
127       search for an entry of the form:
128
129            mhshow-show-<type>
130
131       to determine the display string.
132
133       If  a  display  string  is  found,  any  escapes  (given below) will be
134       expanded.  The result will be executed under “/bin/sh”, with the  stan‐
135       dard input set to the content.
136
137       The display string may contain the following escapes:
138
139            %a  Insert parameters from Content-Type field
140            %e  exclusive execution
141            %f  Insert filename containing content
142            %F  %e, %f, and stdin is terminal not content
143            %l  display listing prior to displaying content
144            %p  %l, and ask for confirmation
145            %s  Insert content subtype
146            %d  Insert content description
147            %%  Insert the character %
148
149       For  those  display  strings containing the e- or F-escape, mhshow will
150       execute at most one of these at any given time.  Although the  F-escape
151       expands  to be the filename containing the content, the e-escape has no
152       expansion as far as the shell is concerned.
153
154       When the p-escape prompts for confirmation, typing INTR  (usually  con‐
155       trol-C) will tell mhshow not to display that content.  The p-escape can
156       be disabled by specifying the switch -nopause.  Further, when mhshow is
157       display  a content, typing QUIT (usually control-\) will tell mhshow to
158       wrap things up immediately.
159
160       Note that if the content being displayed is multipart, but not  one  of
161       the subtypes listed above, then the f- and F-escapes expand to multiple
162       filenames, one for each subordinate content.   Further,  stdin  is  not
163       redirected from the terminal to the content.
164
165       If a display string is not found, mhshow has several default values:
166
167            mhshow-show-text/plain: %pmoreproc '%F'
168            mhshow-show-message/rfc822: %pshow -file '%F'
169
170       If  a  subtype  of  type  text doesn't have a profile entry, it will be
171       treated as text/plain.
172
173       mhshow has default methods for handling multipart messages  of  subtype
174       mixed,  alternative, parallel, and digest.  Any unknown subtype of type
175       multipart  (without  a  profile  entry),  will  be  treated  as  multi‐
176       part/mixed.
177
178       If  none  of  these apply, then mhshow will check to see if the message
179       has an application/octet-stream content with parameter “type=tar”.   If
180       so,  mhshow  will use an appropriate command.  If not, mhshow will com‐
181       plain.
182
183       Example entries might be:
184
185            mhshow-show-audio/basic: raw2audio 2>/dev/null | play
186            mhshow-show-image: xv '%f'
187            mhshow-show-application/PostScript: lpr -Pps
188
189       Note that when using the f- or F-escape, it's a good idea to  use  sin‐
190       gle-quotes  around  the escape.  This prevents misinterpretation by the
191       shell of any funny characters that might be present in the filename.
192
193       Finally, mhshow will process each message  serially -- it  won't  start
194       showing the next message until all the commands executed to display the
195       current message have terminated.  In the case of  a  multipart  content
196       (of  any  subtype listed above), the content contains advice indicating
197       if the parts should be displayed serially or in parallel.  Because this
198       may  cause  confusion,  particularly on uni-window displays, the -seri‐
199       alonly switch can be given to tell mhshow to  never  display  parts  in
200       parallel.
201
202   Showing Alternate Character Sets
203       Because  a  content of type text might be in a non-ASCII character set,
204       when mhshow encounters a  “charset”  parameter  for  this  content,  it
205       checks  if  your terminal can display this character set natively.  mhn
206       checks this by examining the the environment variable $MM_CHARSET.   If
207       the  value  of  this  environment variable is equal to the value of the
208       charset parameter, then mhshow assumes  it  can  display  this  content
209       without any additional setup.  If this environment variable is not set,
210       mhshow will assume a value of “US-ASCII”.  If the character set  cannot
211       be displayed natively, then mhshow will look for an entry of the form:
212
213            mhshow-charset-<charset>
214
215       which  should  contain  a command creating an environment to render the
216       character set.  This command string should containing  a  single  “%s”,
217       which will be filled-in with the command to display the content.
218
219       Example entries might be:
220
221            mhshow-charset-iso-8859-1:     xterm    -fn    '-*-*-medium-r-nor‐
222            mal-*-*-120-*-*-c-*-iso8859-*' -e %s
223
224       or
225
226            mhshow-charset-iso-8859-1: '%s'
227
228       The first example tells mhshow to start xterm and load the  appropriate
229       character  set  for  that  message  content.   The second example tells
230       mhshow that your pager (or other program handling  that  content  type)
231       can handle that character set, and that no special processing is needed
232       beforehand.
233
234       Note that many pagers strip off the high-order  bit  or  have  problems
235       displaying  text  with the high-order bit set.  However, the pager less
236       has support for single-octet character sets.  The  source  to  less  is
237       available  on  many ftp sites carrying free software.  In order to view
238       messages sent in the ISO-8859-1 character set using less,
239
240       put these lines in your .login file:
241
242            setenv LESSCHARSET latin1
243            setenv LESS "-f"
244
245       The first line tells less to use the ISO-8859-1 definition  for  deter‐
246       mining  whether  a  character is “normal”, “control“, or “binary”.  The
247       second line tells less not to warn you if it encounters a file that has
248       non-ASCII  characters.   Then, simply set the moreproc profile entry to
249       less, and it will get called automatically.  (To handle  other  single-
250       octet  character sets, look at the less(1) manual entry for information
251       about the $LESSCHARDEF environment variable.)
252
253   Messages of Type message/partial
254       mhshow cannot directly display messages  of  type  partial.   You  must
255       reassemble  them  first into a normal message using mhstore.  Check the
256       man page for mhstore(1) for details.
257
258   External Access
259       For contents  of  type  message/external-body,  mhshow  supports  these
260       access-types:
261
262       ·   afs
263
264       ·   anon-ftp
265
266       ·   ftp
267
268       ·   local-file
269
270       ·   mail-server
271
272       For  the  “anon-ftp”  and  “ftp” access types, mhshow will look for the
273       “nmh-access-ftp” profile entry, e.g.,
274
275            nmh-access-ftp: myftp.sh
276
277       to determine the pathname of a program to perform the FTP retrieval.
278
279       This program is invoked with these arguments:
280
281            domain name of FTP-site
282            username
283            password
284            remote directory
285            remote filename
286            local filename
287            “ascii” or “binary”
288
289       The program should terminate  with  an  exit  status  of  zero  if  the
290       retrieval is successful, and a non-zero exit status otherwise.
291
292       If  this  entry is not provided, then mhshow will use a simple built-in
293       FTP client to perform the retrieval.
294
295   The Content Cache
296       When mhshow encounters an external content containing  a  “Content-ID:”
297       field, and if the content allows caching, then depending on the caching
298       behavior of mhshow, the content might be read  from  or  written  to  a
299       cache.
300
301       The  caching  behavior  of  mhshow  is  controlled with the -rcache and
302       -wcache switches, which define the policy for reading from, and writing
303       to,  the  cache,  respectively.  One of four policies may be specified:
304       “public”, indicating that mhshow should make use of a publically-acces‐
305       sible  content cache; “private”, indicating that mhshow should make use
306       of the user's private content cache; “never”,  indicating  that  mhshow
307       should  never  make  use of caching; and, “ask”, indicating that mhshow
308       should ask the user.
309
310       There are two directories where contents may  be  cached:  the  profile
311       entry “nmh-cache” names a directory containing world-readable contents,
312       and, the profile entry “nmh-private-cache” names a directory containing
313       private  contents.  The former should be an absolute (rooted) directory
314       name.
315
316       For example,
317
318            nmh-cache: /tmp
319
320       might be used if you didn't care that the cache got  wiped  after  each
321       reboot of the system.  The latter is interpreted relative to the user's
322       nmh directory, if not rooted, e.g.,
323
324            nmh-private-cache: .cache
325
326       (which is the default value).
327
328   User Environment
329       Because the display environment in which mhshow operates may  vary  for
330       different  machines,  mhshow  will look for the environment variable If
331       present, this specifies the name of an additional  user  profile  which
332       should  be  read.   Hence,  when a user logs in on a particular display
333       device, this environment variable should be set to refer to a file con‐
334       taining  definitions  useful  for  the given display device.  Normally,
335       only entries that deal with the methods to  display  different  content
336       type and subtypes
337
338            mhshow-show-<type>/<subtype>
339            mhshow-show-<type>
340
341       need  be  present  in  this  additional  profile.  Finally, mhshow will
342       attempt to consult one other additional user profile, e.g.,
343
344            /etc/nmh/mhn.defaults
345
346       which is created automatically during nmh installation.
347
348

FILES

350       $HOME/.mh_profile          The user profile
351       $MHSHOW                    Additional profile entries
352       /etc/nmh/mhn.defaults      System default MIME profile entries
353       /etc/nmh/mhl.headers       The headers template
354
355

PROFILE COMPONENTS

357       Path:                To determine the user's nmh directory
358       Current-Folder:      To find the default current folder
359       Unseen-Sequence:     To name sequences denoting unseen messages
360       mhlproc:             Default program to display message headers
361       nmh-access-ftp:      Program to retrieve contents via FTP
362       nmh-cache            Public directory to store cached external contents
363       nmh-private-cache    Personal directory to store cached external contents
364       mhshow-charset-<charseTte>mplate for environment to render character sets
365       mhshow-show-<type>*  Template for displaying contents
366       moreproc:            Default program to display text/plain content
367
368

SEE ALSO

370       mhbuild(1), mhl(1), mhlist(1), mhstore(1), sendfiles(1)
371
372

DEFAULTS

374       `+folder' defaults to the current folder
375       `msgs' defaults to cur
376       `-nocheck'
377       `-formmhl.headers'
378       `-pause'
379       `-rcacheask'
380       `-realsize'
381       `-noserialonly'
382       `-noverbose'
383       `-wcacheask'
384
385

CONTEXT

387       If a folder is given, it will become the current folder.  The last mes‐
388       sage selected will become the current message.
389
390
391
392MH.6.8                            1 Jul 2003                         MHSHOW(1)
Impressum