Re: Problem with rft attachements

1996-09-18 12:18:00
This is how Qualcomm's Eudora mail client specifies file names in its
embedded MIME-compliant (?) attachments:

Content-Type: application/rtf; charset="us-ascii"
Content-Disposition: attachment; filename="d44-21.rtf"

That complies with RFC1806.  There are *lots* of Eudoras out there.

Achim pointed out how MHonarc parses out the file name for an attached file:

from MhonArc/lib/

   ## See if name argument is to be used
   ($nameparm) = $fields{'content-type'} =~ /name=(\S+)/i;

                        ^^^^^^^^^^^^^^      ^^^^^

   $nameparm =~ s/['"]//g;
   $nameparm =~ s/.*[\/\\:]//;
   if ($args =~ /usename/i) {
       $name = $nameparm;

as indicated by '^'s: Mhonarc is looking for filename in Content-Type
header field and not for in content-disposition.  You may try (untested
/unverified/unproven...) to use instead 

   (($nameparm) = $fields{'content-type'} =~ /name=(\S+)/i) ||
      (($nameparm) = $fields{'content-disposition'} =~ /name=(\S+)/i);

May I suggest:

   (($nameparm) = $fields{'content-disposition'} =~ /filename=(\S+)/i) ||
      (($nameparm) = $fields{'content-type'} =~ /name=(\S+)/i);

to give priority to RFC1806 and allow for the deprecated "name=" in RFC1521. 

-- SP

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