Another MIME decoder improvement, and script tags

Ron Hahn (Senior Analyst) HahnR at SHB.IE
Tue Mar 9 16:21:51 GMT 2004


I would!

-----Original Message-----
From: Julian Field [mailto:mailscanner at ECS.SOTON.AC.UK]
Sent: 09 March 2004 16:07
To: MAILSCANNER at JISCMAIL.AC.UK
Subject: Another MIME decoder improvement, and script tags


For those of you who like to keep bang up to date on all these issues, I
have made another improvement to the MIME decoder which catches more rogue
MIME structures.

Please apply this to Message.pm:

-----SNIP-----
--- Message.pm.old 2004-03-08 18:35:44.000000000 +0000
+++ Message.pm 2004-03-09 10:01:52.000000000 +0000
@@ -1317,7 +1317,7 @@
        last unless defined $line;
        $nextpos += length $line;
        # Must have 2 lines of header
-      if ($prevline =~ /^[^:]+: / && $line =~ /(^\s+)|(^[^:]+ )|(^\s+.*=)/)
{
+      if ($prevline =~ /^[^:\s]+: / && $line =~ /(^\s+)|(^[^:]+
)|(^\s+.*=)/) {
          #print STDERR "Found header start at \"$prevline\"\n and
\"$line\"\n";
          $foundheader = 1;
          last;
@@ -1333,7 +1333,9 @@
      }

      # Rewind to the start of the header
-    $file->setpos($prevpos);
+    #$file->setpos($prevpos);
+    seek $file, $prevpos, 0;
+    #print STDERR "First line is \"" . <$file> . "\"\n";

      # Setup everything for the MIME parser
      my $parser = MIME::Parser->new;
-----SNIP-----

I don't think this is urgent enough to warrant release now, it can go into
the pot for the next one.

While I'm here, how many of you would like me to squash <script> tags in
HTML messages?
--
Julian Field
www.MailScanner.info
MailScanner thanks transtec Computers for their support

PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************



More information about the MailScanner mailing list