little patch for reports

Mariano Absatz mailscanner at LISTS.COM.AR
Fri Sep 12 21:31:11 IST 2003


Hi,

I'm using a function (partially stolen from SQLLogging) that creates a text
log with different entries.

I usually have in MailScanner.conf:
Include Scanner Name In Reports = yes

and in .../languages.conf
MailScanner = MailScanner

The point is that sometimes (e.g. when a filename _AND_ a filetype generate a
report), I get 2 lines, but only the first one has the "MailScanner:" prefix
in it, like:

McAfee: application.pif        Found the W32/Sobig.f at MM virus !!!
MailScanner: Shortcuts to MS-Dos programs are very dangerous in email \
(application.pif)
No programs allowed (application.pif)


I wanted every line to be prefixed so the report would look like:
McAfee: application.pif        Found the W32/Sobig.f at MM virus !!!
MailScanner: Shortcuts to MS-Dos programs are very dangerous in email \
(application.pif)
MailScanner: No programs allowed (application.pif)


So I did a slight modification that does it... (see patch below)

Does anybody else like it? Will it break something for someone?
(so as to ask Julian to add it to the next release)

Thanx to everyone...




--- Message.pm.orig     Wed Sep 10 10:27:53 2003
+++ Message.pm  Fri Sep 12 15:57:35 2003
@@ -995,6 +995,7 @@
   }
   while (($file, $text) = each %{$this->{namereports}}) {
     #print STDERR "Adding file $file report $text\n";
+    $text =~ s/\n(.)/\n$Name$1/g;
     $this->{allreports}{$file} .= $Name . $text;
   }
   while (($file, $text) = each %{$this->{nametypes}}) {








--
Mariano Absatz
El Baby
----------------------------------------------------------
Why was I with her? She reminds me of you.
In fact, she reminds me more of you than you do!
      -- Groucho Marx



More information about the MailScanner mailing list