mhonarc-users

Re: content-disposition parsing incorrect

1999-04-13 18:21:54
On April 12, 1999 at 13:33, Rob Nagler wrote:

Following patch fixes inline images with content dispositions sent
from Netscape 4.5.  The mime header was:

    Content-Type: image/gif;
     name="foo.gif"
    Content-Transfer-Encoding: base64
    Content-Disposition: inline;
     filename="foo.gif"

The ";" was deleted in the original code.  I changed it to replace
it with a space.

This is not the proper fix since the return value of the function does
not contain the proper value for the first list item.  Ie.  $disp does
not contain just "inline" but "inline filename="foo.gif"" (or
inlinefilename="foo.gif" w/o the patch).  Your quick fix works because
the mhexternal.pl filter uses a regex to check the value instead of
using the eq operator.

The proper fix is to deal with the case when the following can
occur:

    Content-Disposition: inline;filename="foo.gif"

BTW, this is how the field will look when unfolded.  readmail.pl
made the assumption that there would always be a space after the
semi-colon if a semi-colon is present.

In sum, first try extraction assuming there is a semi-colon.  If it
fails, then there is a disposition value w/o a filename parameter, or
any other parameters.

        --ewh

----
             Earl Hood              | University of California: Irvine
      ehood(_at_)medusa(_dot_)acs(_dot_)uci(_dot_)edu      |      Electronic 
Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME

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