Subject: MIME

From: [email-masked] (Prof H.J. Leutheusser)
Date: Wed, 21 May 1997 17:26:26 -0400 (EDT)

Kindly advise how I can read a message sent to me in MIME format.
Thank you.
H.J. LEUTHEUSSER
[email-masked]

---

From: Robin S Socha <[email-masked]>
Date: Thu, 22 May 1997 00:11:09 +0200 (CEST)

-----BEGIN PGP SIGNED MESSAGE-----

On Wed, 21 May 1997, Prof H.J. Leutheusser wrote:

Dear Prof H.J. Leutheusser,

  >Kindly advise how I can read a message sent to me in MIME format.

that depends on what kind of MIME message you've received. MIME stands for
Multipurpose Internet Mail Extensions, which basically means that this
message my contain anything that's not strictly ascii --- even HTML is
considered MIME.

However, being one of the lucky few using pine, salvation is near --- it
comes in the guise of a file called mailcap, the entry for which can be
found either in M(ain), S(etup), C(onfig), or in the ~/.pinerc directly.
Check for these entries and make the appropriate changes (from my .pinerc):

     -------------8<--------- snip here -----8<------------------
# NOTE: colon delimited under UNIX, semi-colon delimited under DOS/Windows/OS2.
mailcap-search-path=/etc/mailcap

# Sets the search path for the mimetypes cofiguration file.
# NOTE: colon delimited under UNIX, semi-colon delimited under DOS/Windows/OS2.
mimetype-search-path=/etc/mailcap
     -------------8<--------- snip here -----8<------------------

Now, some trouble might occur in displaying HTML files. If you check this
list's archive, you'll find solutions for both lynx and netscape.

Here's what the entry in /etc/mailcap for lynx should look like:

     -------------8<--------- snip here -----8<------------------
        test=test -z "$DISPLAY" -a -z "$LYNX_VERSION"; needsterminal
        text/html; lynx force_html %s; needsterminal;
     -------------8<--------- snip here -----8<------------------

There was a short, pregnant and highly philosophical dispute about which way
to go with notscape, and I remember solving it, but I forget which
parameters had to be put in the mailcap file. Anyway, if you're using lynx,
the following is a Good Thing (tm) to have as a customized printer command:

     -------------8<--------- snip here -----8<------------------
#!/bin/sh -
FILE=$1
[ "$FILE" = "" ] && FILE=-

(
echo "<html>"
echo "<head>"
echo "<title>File $1</title>"
echo "</head>"
echo "<body><PRE>"

cat $FILE | sed \
  -e  's/>/ \&gt /g' -e  's/</ \&lt /g' \
  -e 's:http\://\([^"> ]*[^()\.,">& ]\):<A HREF=http\://\1>http\://\1</A>:g' \
  -e 's:ftp\://\([^"> ]*[^()\.,">& ]\):<A HREF=ftp\://\1>http\://\1</A>:g' \
  -e  's/ &gt /\&gt /g' -e  's/ &lt /\&lt /g'
    
echo '</PRE></body></html>'
) > /tmp/l_file.html
stty onlcr < /dev/tty
lynx -force_html /tmp/l_file.html < /dev/tty > /dev/tty 2>&1
echo 'done'
     -------------8<--------- snip here -----8<------------------

 Just put it in an executable file in your search path, and then say

 	prYnt
 	CustomPrint
 	<name of file into which you put the script>    

and *whoa!* you can view html inside pine. Thanks again to whoever made up
this script, it's *way* kewl >:->

HTH,
Robin

P.S. How come you're posting to the pine group if you're using Elm? >;->

- -- 
Robin S. Socha, M.A., Political Science Dept., Bonn University, Bonn
To get my pgp public key, send an e-mail with the subject "get pgp key"
GMC d++ s+:+ a- C++ UL++$>+++$ P+>++$ E>+ W- N+ o@ w--- M-- PS--- PE+++ Y+
PGP++>+++ t+() 5-- tv++(+) b+++ DI++ D+(++) G++>+++ e++>+++ h r++>+++ y+**

---

From: "Robert de Bath" <[email-masked]>
Date: Tue, 27 May 1997 22:22:40 +0100 (BST)

On Thu, 22 May 1997, Robin S Socha wrote:

>                                           ... Anyway, if you're using lynx,
<snip>
Thats the old buggy version (ftp: urls are broken), here's the new all 
singing, all ... yak, yak, yak, yawn!   
#-=-=-=-=-=-=-=-=-=-=-=-=-=snip-snip=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#!/bin/sh -
FILE=$1
[ "$FILE" = "" ] && FILE=-

(
echo "<html>"
[ "$FILE" != "-" ] && {
   echo "<head>"
   echo "<title>File $FILE</title>"
   echo "</head>"
}
echo "<body><PRE>"

expand $FILE | sed \
  -e 's/^/ /' -e  's/>/>@@/g' -e  's/</<@@/g' \
  -e 's:<@@URL\:\([a-z.-]*\:[^"<> ]*\)>@@: URL\: <A HREF="\1">\1</A>:g' \
  -e 's:\([^>"]\)\(ftp\://[^"<> ]*[^()\.,"<>& ]\):\1<A HREF="\2">\2</A>:g' \
  -e 's:\([^>"]\)\(http\://[^"<> ]*[^()\.,"<>& ]\):\1<A HREF="\2">\2</A>:g' \
  -e 's/>@@/\&gt;/g' -e 's/<@@/\&lt;/g' -e 's/^ //'

echo '</PRE></body></html>'
) > /tmp/l_file.html
stty onlcr < /dev/tty
lynx -force_html /tmp/l_file.html < /dev/tty > /dev/tty 2>&1
echo 'done'
#-=-=-=-=-=-=-=-=-=-=-=-=-=snip-snip=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

It also understands the <URL:mailto:[email-masked]> format.

> this script, it's *way* kewl >:->
You're welcome.    

-- 
Rob.                           (Robert de Bath <http://www.cix.co.uk/~mayday>)