[Logwatch-Devel] amavis patch

Felix Schwarz Felix.Schwarz at web.de
Mon Jan 16 11:10:25 MST 2006


Hi,

after I got the latest amavis script from CVS ("$Id: amavis,v 1.24
2005/12/07 19:15:56 bjorn Exp $"), I noticed that there seems to be a
little bug when using detail level 5 because virus names do not appear
in the report.

See this code:
>    } elsif (($Virus, $FromIP, $From) = ( $ThisLine =~ /^(?:Virus found - quarantined|INFECTED|Blocked INFECTED) \(([^\)]+$
        (...)
>
>       if ($Detail >= 5) {
>         $Virustypes{$Virus}++;
>       }; # if
> 
>       if ($Detail >= 10) {
>         $Viruses{$Virus}{$From}++;
>       }; # if

I think that virus names should be shown in the output if the detail
level is above/equals 5. For a detail greater/equal than 10
additionally the sender should be mentioned.

But during the report generation, %Viruses is used, not %Virustypes.
That means that the number of viruses and their name is only shown if
detail level is at least 10. My patch solves that.

--- /root/amavis        2006-01-16 21:45:53.000000000 +0100
+++ amavis      2006-01-16 21:46:43.000000000 +0100
@@ -252,9 +252,9 @@
    print "$Blacklisted messages were blacklisted.\n";
 };

-if ((keys %Viruses)) {
+if ((keys %Virustypes)) {
    print "\nViruses Detected:\n";
-   foreach $Virus (sort keys %Viruses) {
+   foreach $Virus (sort keys %Virustypes) {
       if ($Detail < 10 && $Detail >= 5) {
          print "   $Virus: $Virustypes{$Virus} Times(s)\n";
       } elsif ($Detail >= 10) {

-- 
Felix



More information about the Logwatch-Devel mailing list