Hi Tomasz

Now i've attatched the files, so it should work. If it dosn't .. you can download the files here: http://www.schimkat.dk/clamav/ .. as 2 single files .. or both files in a .tar file.

Regards Søren



Tomasz Kojm wrote:

On Fri, 17 Oct 2003 08:54:59 +0200
Soren Schimkat <[EMAIL PROTECTED]> wrote:



Sounds like at good idea. Here are a new set of files:



Please send the scripts as attachments because some lines were reformatted by your MUA software.

Best regards,
Tomasz Kojm




#!/usr/bin/perl
##################################################################
#
# clamav-milter script ver. 0.1 for Logwatch.
#
# This scripts matches the following programs:
#    clamd ver. 0.60
#    clamav-milter ver. 0.55
#    Logwatch ver. 4.3.1
#
# Written by S. Schimkat <www.schimkat.dk>.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
##################################################################

$Detail = $ENV{'LOGWATCH_DETAIL_LEVEL'};

while (defined($ThisLine = <STDIN>)) {
   if (($ThisLine =~ /clean message from/)) {
      $CleanMessage++;
   } elsif (($ThisLine =~ /Intercepted virus/)) {
      $InfectedMessage++;
   } elsif (($Virus) = ($ThisLine =~ /^stream: (.*?) FOUND/i )) {
      $VirusList{$Virus}++;
   } elsif (($MailHost) = ($ThisLine =~ /^clamfi_connect: connection from (.*?)\n/i )) 
{
      $MailHostList{$MailHost}++;
   } else {
      # Comment the following line out if using verbose logging.
      # Note that doing that will result in not displaying the extra log.
      push @OtherList,$ThisLine;
   }
}


if ( (keys %MailHostList) ) {
   print "\nHost list:\n";
   foreach $MailHost (sort {$a cmp $b} keys %MailHostList) {
      print "\t" . $MailHost . " - ". $MailHostList{$MailHost} . " Time(s)\n";
   }
}

if ($CleanMessage) {
   print "\nClean messages: ". $CleanMessage." Message(s)\n";
}

if ($InfectedMessage) {
   print "\nInfected messages: ". $InfectedMessage." Message(s)\n";
}

if ( (keys %VirusList) ) {
   print "\nVirus list:\n";
   foreach $Virus (sort {$a cmp $b} keys %VirusList) {
      print "\t" . $Virus . " - ". $VirusList{$Virus} . " Time(s)\n";
   }
}

if (($#OtherList >= 0) and (not $IngoreUnmatched)){
   print "\n**Unmatched Entries**\n";
   print @OtherList;
}

exit(0);
##################################################################
#
# clamav-milter script ver. 0.1 for Logwatch.
#
# This scripts matches the following programs:
#    clamd ver. 0.60
#    clamav-milter ver. 0.55
#    Logwatch ver. 4.3.1
#
# Written by S. Schimkat <www.schimkat.dk>.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
##################################################################

Title = "Clamav-milter"
LogFile = maillog
*OnlyService = clamav-milter
*RemoveHeaders

Reply via email to