Hi Tomasz

Hi Guys

If you want Logwatch to display clamav-milter logs - you can use the following files (a short description is located below the files):



Please specify a license for your scripts (in their headers) and we will include them in the contrib dir.



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


clamav-milter.conf: ------------------------------------------- ################################################################## # # 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
-------------------------------------------


clamav-milter: ------------------------------------------- #!/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);
-------------------------------------------


The files will be available on my webserver the next week or so: http://www.schimkat.dk/clamav


Regards Søren



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
Clamav-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/clamav-users

Reply via email to