mhonarc-users

Re: Unknown Content-Types & crashes

1996-07-17 13:12:17
Well, as Achim Bohnet pointed out to me, you can have MHonArc print
out unknown content types by using the meathod I was trying
but you just have to type it correctly.

 > <MIMEFILTERS>
 > X-sun-attachment:h2m_text_plain'filter:mhtxtplain.pl
 > </MIMEFILTERS>
                    ^^^  should be m2h

I'm also going to try next:

<MIMEFILTERS>
*:m2h_text_plain'filter:mhtxtplain.pl
</MIMEFILTERS>

You use "*/*" instead of "*"

so that all unknown types will default to plain text printouts.  Anyone
see a down side to this?

Using "*/*" is dangerous becuase it possible that the data is non-text
and would cause garbage to be generated in the html.  A better
approach, but could still cause some problems, is to do catches based
upon the base type.  Example:

<MIMEFILTERS>
text/*:m2h_text_plain'filter:mhtxtplain.pl
</MIMEFILTERS>

For text/* content-types, you are fairly safe to use mhtxtplain.pl
if desired (assuming the charset is reasonable).  For image and
application types, it would be dangerous since the data is probably
binary.

To be safe, use mhexternal.pl.  mhexternal.pl is designed to be a
catch-all filter.  You can register it as the "*/*" filter.  What it
will do is extract the data into an external file and create a link to
it.  The HTML will have the message "Unrecognized Data" but it will be
hyperlinked to the data extracted.  Hence, the following may be
useful:

<MIMEFILTERS>
*/*:m2h_external'filter:mhexternal.pl
</MIMEFILTERS>

However, when possible, try to define more reasonable filters as
content-types become known.

        --ewh

P.S.  Does anyone see a problem with having mhexternal.pl process
unknown-content types by default (ie. The setting is built into
mhonarc)?  I can add the content-type specification to the
"Unrecognized Data" string to at least give the reader a clue to what
the data type is and they will still have the option of access the
data.

----
    Earl Hood                  |   ISOGEN INTERNATIONAL CORP
    ehood(_at_)isogen(_dot_)com           |   dba Highland Consulting
    Phone: 214-953-0004 x127   |   2200 North Lamar #230
    FAX: 214-953-3152          |   Dallas, TX  75202

<Prev in Thread] Current Thread [Next in Thread>