Here's a fun thing I did with mhn: I wrote a program, mail.weather.ext, which mails out a weather map image of the continental United States, a key to the weather symbols, and a corresponding satellite image.
The GIF files2 containing these images are obtained freely from an Internet site.
I view these messages on a Sun IPC workstation with a 17-inch color display. Other persons in offices next to mine can view the images on HP 9000/700 series workstations with 19-inch color displays or on their monochrome X terminals—although the maps don't look quite as nice in monochrome.
By using the UNIX cron facility, I've arranged for the maps to be mailed out every weekday morning at 10:30. This is the line in my crontab that does it:
30 10 * * 1-5 /home/jsweet/bin/mail.weather.ext weather-fiends \ >/dev/null 2>&1
Below is an example of an mhn draft template produced automatically by mail.weather.ext. The template contains two major pieces: an explanation, rendered in richtext format (we'll get to that by and by), of the images in the message, and a collection of external body parts that refer to GIF-format image files residing on a remote host.
To: weather-fiends Subject: weather report: 02/25 0900 GMT -------- #<text/richtext [explanation] <paragraph>You may FTP three images:</paragraph> <paragraph><indent><fixed> SA022509.GIF: surface analysis at 0900 GMT 02/25<nl> WXKEY.GIF: map symbol key<nl> CI022508.GIF: satellite photo at 0800 GMT 02/25 </fixed></indent></paragraph> # #begin [weather report: 02/25 0900 GMT] parallel #@image/gif [surface analysis + radar summary] \ access-type=anon-ftp; \ name="SA022509.GIF"; \ directory="wx"; \ site="vmd.cso.uiuc.edu"; \ expiration="26 Feb 93 09:00:00 GMT"; \ size=50000 #@image/gif [weather map symbol key] \ access-type=anon-ftp; \ name="WXKEY.GIF"; \ directory="wx"; \ site="vmd.cso.uiuc.edu"; \ size=18867 #@image/gif [satellite photo] \ access-type=anon-ftp; \ name="CI022508.GIF"; \ directory="wx"; \ site="vmd.cso.uiuc.edu"; \ expiration="26 Feb 93 09:00:00 GMT"; \ size=170000 #end
As you may have noted from the expiration attributes in the example above, these particular weather image files are long gone.
The structure of the message appears as follows, as shown using the command mhn -list, with some blank lines and indentation added for slightly easier reading:
msg part type/subtype size description 1 multipart/mixed 1541 1 text/richtext 288 explanation 2 multipart/parallel 939 weather report: 02/25 0900 GMT 2.1 message/external-body 78 image/gif surface analysis + radar summary 2.2 message/external-body 68 image/gif weather map symbol key 2.3 message/external-body 61 image/gif satellite photo
When this message is shown via the MH command show, message part 1, a richtext part giving an explanation of the contents of the message, is displayed.
Then a series of prompts is provided for retrieving the external bodies named in part 2. The retrieval is accomplished semi-automatically, using anonymous FTP, from Internet host vmd.cso.uiu.edu, where the weather images are stored.
Date: Thu, 25 Feb 1993 01:41:13 PST To: jsweet@irvine.com From: Jerry Sweet <jsweet@irvine.com> Subject: weather report: 02/25 0900 GMT Mime-Version: 1.0 You may FTP three images: SA022509.GIF: surface analysis at 0900 GMT 02/25 WXKEY.GIF: map symbol key CI022508.GIF: satellite photo at 0800 GMT 02/25 Press RETURN to continue (or 'q' to quit): Retrieve SA022509.GIF (content 2.1) using anonymous FTP from site vmd.cso.uiuc.edu (50000 octets)? y Make cached, publicly-accessible copy? y Retrieve WXKEY.GIF (content 2.2) using anonymous FTP from site vmd.cso.uiuc.edu (18867 octets)? y Make cached, publicly-accessible copy? y Retrieve CI022508.GIF (content 2.3) using anonymous FTP from site vmd.cso.uiuc.edu (170000 octets)? y Make cached, publicly-accessible copy? y
As the different external body parts are retrieved, the images pop up on the display (assuming that you have a graphical display). In my configuration, the xv application is given the task of showing the retrieved images on my X Window System display.
The prompts regarding ``cached, publicly-accessible'' copies have to
do with the caching feature of mhn which may or may not be
enabled at your site. You can enable caching for yourself with an
appropriate mhn profile entry, discussed in section .
If someone else at your site has already read the same message, and
has made cached, publicly-accessible copies of the images, then you
are likely to see prompts like this one instead:
Use cached copy /r/mhn-cache/<24860.731615403.1@fester.irvine.com> of size 25551 octets (content 2.1)?
In this example, the cache directory is /r/mhn-cache/. The horrible-looking file name surrounded by <angle brackets> corresponds to the unique Content-ID of the external body part. The most useful bit of information is the part number, 2.1 in this example. From the previous listing of the message structure, you can see that part 2.1 refers to the ``surface analysis + radar summary.''
If caching isn't enabled, then the relevant prompts don't appear; the external body parts have to be retrieved from the remote host every time you want to see them, and the external body parts are deleted as soon as you're done with viewing them.
The richtext part of the weather draft message above was this:
#<text/richtext [explanation] <paragraph>You may FTP three images:</paragraph> <paragraph><indent><fixed> SA022509.GIF: surface analysis at 0900 GMT 02/25<nl> WXKEY.GIF: map symbol key<nl> CI022508.GIF: satellite photo at 0800 GMT 02/25 </fixed></indent></paragraph> #
As you may have guessed, the richtext body part consists of text with some simple format commands, such as <fixed> and <indent>. You can see for yourself above what effects the richtext formatting commands have.
The richtext area of the message is delimited at the beginning by the mhn directive #<text/richtext and at the end by # alone on a line. In contrast, a text area of a message draft not specifically delimited by mhn directives is assumed to be of type text/plain.
The description of the richtext part is given in square brackets: [explanation]. The description shows up when the contents of a MIME message are listed via the mhn -list option.
A summary of richtext is given in appendix .
The weather map image retrieval information begins with this directive:
#begin [weather report: 02/25 0900 GMT] parallel
The #begin parallel directive (ignoring the description in square brackets shown above) allows all three images that follow to be displayed at the same time. Without the #begin parallel directive, each image would be shown one at a time, and you would have to quit the image display application (xv in my case) each time in order to see the next image.
The scope of the #begin directive is ended, naturally enough, with an #end directive.
As you probably guessed by reading the retrieval prompts above, the weather map images themselves are not included in the message. Instead, the message contains references to files available via anonymous FTP on a remote host, in this case, vmd.cso.uiuc.edu.
One of the external file references is this:
#@image/gif [surface analysis + radar summary] \ access-type=anon-ftp; \ name="SA022509.GIF"; \ directory="wx"; \ site="vmd.cso.uiuc.edu"; \ expiration="26 Feb 93 09:00:00 GMT"; \ size=50000
This directive contains these pieces:
More is said about external body parts in section .