[Logwatch-Devel] Patch Request for amavis script

Markus Lude lude at informatik.uni-tuebingen.de
Fri Nov 25 16:38:46 MST 2005


On Sun, Nov 20, 2005 at 09:15:39AM -0700, Who Knows wrote:
> depending upon local amavis configuration bad headers can be blocked or 
> passed.
> 
> the current logwatch 7.1 (and previous 7.0) only recognized "blocked" 
> bad headers allowing passed bad header messages to display in the 
> "unrecognized" section.
> 
> The patch below changes logwatch to recognize and report both blocked 
> and passed bad headers, although not differentiating between the two. 
> Hopefully an admin will know whether they configured amavis to pass or 
> block messages with bad headers.
> 
> --- services.orig/amavis        2005-11-16 18:49:39.000000000 -0700
> +++ services/amavis     2005-11-20 09:05:55.951378149 -0700
> @@ -134,7 +134,7 @@
>         $Spams{$Towards}{"<>"}++;
>       }; # if
> 
> -   } elsif (($FromIP, $From, $Why) = ( $ThisLine =~ /^(?:Blocked )?BAD[ -]HEADER(?: from|\,) (?:\[([^\]]*)\] )*[\(\<]([^\>\)]+)[\)\>](?: -\> 
> [\(\<](?:[^\>\)]+)[\)\>])[^\:]*(?:\: (.*) in message header)?/ )) {
> +   } elsif (($FromIP, $From, $Why) = ( $ThisLine =~ /^(?:Blocked|Passed )?BAD[ -]HEADER(?: from|\,) (?:\[([^\]]*)\] )*[\(\<]([^\>\)]+)[\)\>](?: -\> [\(\<](?:[^\>\)]+)[\)\>])[^\:]*(?:\: (.*) in message header)?/ )) {
>       $BadHeaders++;
> 
>       if (defined($From)){
> 

I don't have amavis logs around, but IMHO the line might better be

   } elsif (($FromIP, $From, $Why) = ( $ThisLine =~ /^(?:Blocked |Passed )?BAD[ -]HEADER(?: from|\,) (?:\[([^\]]*)\] )*[\(\<]([^\>\)]+)[\)\>](?: -\> [\(\<](?:[^\>\)]+)[\)\>])[^\:]*(?:\: (.*) in message header)?/ )) {

The space after "Blocked" seems to got lost.

Regards,
Markus Lude

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 185 bytes
Desc: not available
Url : http://www2.list.logwatch.org/pipermail/logwatch-devel/attachments/20051126/b2da23dc/attachment.bin


More information about the Logwatch-Devel mailing list