Silence Object and IFrame

Julian Field mailscanner at ecs.soton.ac.uk
Mon May 19 10:15:38 IST 2003


At 10:07 19/05/2003, you wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>On Monday 19 May 2003 10:50, Julian Field wrote:
> > At 09:35 19/05/2003, you wrote:
> > >Is there a way, in MailScanner.conf, to suppress the warning messages that
> > >are sent when a message HTML Object (or Iframe, if enabled) is blocked?
> > >
> > >I mean, besides editing the code in SweepContent.pm as suggested by Julian
> > > in a message last January. I was thinking to a string to be added to the
> > > list of Silent Viruses.
> >
> > Not at the moment. Is this a big problem? What does anyone else think?
>
>For me the problem is that several blocked Object warnings are for dead or
>fake addresses, so they are immediately rejected (and I receive the error
>message), or they are from almost legit mailing lists, so I suppose they
>really do not care for the warnings I generate.
>
>Editing the code is not a big issue (I noticed that the instructions are
>already there, commented), besides the fact that I should/must remember to
>re-edit it at every upgrade.

Here is a nicer patch:

--- SweepContent.pm     2003-05-18 16:25:28.000000000 +0100
+++ SweepContent.pm.new 2003-05-19 10:12:31.000000000 +0100
@@ -280,7 +280,7 @@
    my($message, $id, $filename, $allowiframes, $allowobjects,
       $stripdangerous) = @_;

-  my($fh, $counter);
+  my($fh, $counter, $silentviruses);
    $counter = 0;
    $fh = new FileHandle;
    if ($fh->open("$filename")) {
@@ -308,6 +308,12 @@
        $inobject = 0 if /\<\/object/i;
      }
      $fh->close();
+
+    # Get this so we can set the silent flag if they don't want reports
+    # about IGrames or Object-Codebases
+    $silentviruses = ' ' .  MailScanner::Config::Value('silentviruses',
+                     $message) . ' ';
+
      if ($iframefound) {
        # Log the <IFrame>
        MailScanner::Log::InfoLog("HTML IFrame tag found in message %s from
%s",
@@ -325,7 +331,7 @@
            MailScanner::Config::LanguageValue($message, 'foundiframe') . "\n";
          $message->{othertypes}{"$attach"}   .= "v";
          $message->{otherinfected}++;
-        #$message->{silent} = 1;
+        $message->{silent} = 1 if $silentviruses =~ / HTML-IFrame /i;
          $counter++;
        }
      }
@@ -342,7 +348,7 @@
            MailScanner::Config::LanguageValue($message, 'foundobject') . "\n";
          $message->{othertypes}{"$attach"}   .= "v";
          $message->{otherinfected}++;
-        #$message->{silent} = 1;
+        $message->{silent} = 1 if $silentviruses =~ / HTML-Codebase /i;
          $counter++;
        }
      }

This depends on "HTML-IFrame" and/ot "HTML-Codebase" appearing in the
"Silent Viruses" list in the MailScanner.conf file.

If other people would like this ability as well, then I'll put it in the
distribution.
--
Julian Field
www.MailScanner.info
Professional Support Services at www.MailScanner.biz
MailScanner thanks transtec Computers for their support



More information about the MailScanner mailing list