mhonarc-users

Re: MIME Filters

1996-04-22 03:36:44
[[  Btw. it always helps a lot if one add to an problem description:
        - mhonarc version
        - perl version
        - short example mail that fails so one could have a look at the
          mime headers 
          (a 'hello word' writen in application/msword would not hurt)
        - operation system
]]
Guillaume Mallet said:
Hi,

I've got a problem that's been driving me nuts all day, all the more as
I'm convinced it should be damn easy to fix but I just cannot get it to
work. If someone could email me back some advice, I'd be ever so
grateful.

I'm simply trying to get Mhonarc to recognize Msword documents and
create in-line links to them, just as it does by default with any old
rtf file foe example. Following the manual, I just added a couple of
lines to 'mhexternal.pl', declaring application/msword files with the
".doc" extension. Then I added those lines to my rcfile :

<MIMEFILTERS>
application/msword:m2h_external'filter:mhexternal.pl
</MIMEFILTERS>

<MIMEARGS>
application/msword:usename
</MIMEARGS>

I hope that you are aware that this could be a security hole.

Ok. Well, that doesn't do what I want. Using a file named
"Questions.doc" to test it out, I get a link to a file called
"Questions.doc;" (notice the semicolon), and what's more the file is not
recognized by Word and can't be opened. What on earth have I forgotten ?
I've tried lots of things  such as for instance editing mhexternal.pl to
trim that darn semicolon out of the filename, to no avail... :-(

A quick fix should be:

--- 1.2 1996/02/27 10:33:56
+++ mhexternal.pl       1996/04/22 08:14:40
@@ -212,6 +212,7 @@
     ## See if name argument is to be used
     if ($args =~ /usename/i) {
        ($name) = $fields{'content-type'} =~ /name=(\S+)/i;
+       $name =~ s/;$//;
        $name =~ s/['"]//g;
        $name =~ s/.*[\/\\:]//;
     }

I have not checked if other places also don't remove the trailing ';'
that seperates multiple attributes. Much to much regular work is waiting ...

Please, get me out of this hole...

Hope this helps,
Achim

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