mhonarc-users

Re: Problem with rft attachements

1996-09-16 07:53:28
Hendrik Klompmaker said:
At 12:59 PM 9/16/96 +0000, you wrote:
 [...]

Achim,

Thanks for your reply (again). I found a way to control the mime mappings in
Eurdora 
(the mappings section in the ini file). Now it sends the rtf file as
application/rtf
but then MHonArc seems to have some problems with this type since it doesn't
seem to
be able to retreive the original file name. The HTML page shows a link 'RTF
file' 
pointing to a file rtf####.rtf (#### is a number).
The message contains the following:

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

Does this mean that the content type etc. is set wrong in this case or is it
some strange behavior of the m2h_external'filter.


from MhonArc/lib/mhexternal.pl:

    ## 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);

Nevertheless think twice before you use the filenames specified in
a mail message.

Achim
P.S. 2 cents: Maybe one should store the max counter for files in
    .mhonarc.db.  Scanning directories to get the current maximum
    is be expensive for bigger archives.  Mhonarc can provide a
    service routine to for all filters like: 
           $cur_max = incr_file_cnt ($ext);
    and decr_file_cnt to catch errors.

Hendrik

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