Allow Multiple HTML Signatures, not working?

Markus Nilsson markus at markusoft.se
Mon Mar 21 07:38:02 GMT 2011


> >> Hi!
> >>
> >> I am having problems with
> >>
> >> Allow Multiple HTML Signatures = no
> >>
> >> I always get multiple image signatures in my mails Looks like the
> >> same
> >> problems as
> >>
> >> http://article.gmane.org/gmane.mail.virus.mailscanner/73770/match=multiple+inline+html+signatures
> >>
> >>

...

> >>
> >>
> >
> > Hi,
> >
> > I'm not sure if I am alone with this problem, but I worked a bit
> > with this on my end, and have come up with a patch to get it to
> > work.
> >
> > The problem as I see it, is that the HTML parser runs in one thread,
> > and does not tell the main thread about the signature finding. This
> > patch below adds information about the found signature to the pipe
> > from the parser, and sets the global variable in the main thread.
> >

...

> >
> >
> Without commenting on the merit of your patch (I'm a tad too tipsy to
> do that:-), I know that unlesss you start doing proper context diffs,
> noone (most prominently Jules) will look at them;).
> 
> Cheers
> --
> -- Glenn

Hi,

Thanks Glenn, you are right, that wasn't very helpful. Sorry for that!
I'm blaming the friday afternoon :)

I hope this is better, and please tell me if I should send it in another format!

This diff is against the Message.pm in 4.83.3-1

--- Message.pm	2011-03-21 08:31:47.000000000 +0100
+++ Message.pm.patched	2011-03-21 08:33:56.000000000 +0100
@@ -6856,39 +6856,42 @@
         default_h   => [ sub { print @_; },     "text"],
                      )
         ->parse_file($oldname)
         or MailScanner::Log::WarnLog("HTML disarming, can't open file %s: %s",
                                      $oldname, $!);
     }
     # Dump the contents of %DisarmDoneSomething down the pipe
     foreach my $ddskey (keys %DisarmDoneSomething) {
       print $pipe "$ddskey\n";
     }
+    #Add SignatureImageIsFound Magic text if the sig is found
+    print $pipe "SignatureImageIsFound\n" if ($SigImageFound == 1);
     print $pipe "ENDENDEND\n";
     $pipe->close;
     $pipe = undef;
     exit 0;
     # The child will never get here.
   }
 
   # In the parent.
   my @DisarmDoneSomething;
   eval {
     $pipe->reader();
     local $SIG{ALRM} = sub { die "Command Timed Out" };
     alarm MailScanner::Config::Value('spamassassintimeout');
     # Read the contents of %DisarmDoneSomething from the pipe
     my($pipedata);
     while (defined($pipedata = <$pipe>)) {
       last if $pipedata eq "ENDENDEND\n";
       chomp $pipedata;
-      push @DisarmDoneSomething, $pipedata;
+      $SigImageFound = 1 if($pipedata eq "SignatureImageIsFound");
+      push @DisarmDoneSomething, $pipedata unless ($pipedata eq "SignatureImageIsFound");
       #print STDERR "DisarmDoneSomething $pipedata\n";
     }
     waitpid $pid, 0;
     $pipe->close;
     $PipeReturn = $?;
     alarm 0;
     $pid = 0;
   };
   alarm 0;
   # Workaround for bug in perl shipped with Solaris 9,



BR/
Markus

 
 
--
This message has been scanned for viruses and dangerous content by CronLab
(www.cronlab.com), and is believed to be clean.



More information about the MailScanner mailing list