Rules du jour

David du SERRE-TELMON david at xinus.net
Mon Nov 15 04:12:06 PST 2004


 > No, don't do this !
 > The linting process is very usefull for some real bugs (like an invalid
 > regex). If you want to do something, you might just disable the 
"description
 > is over 50 chars" and the "score set for non-existent rule" checks.

The lint_check function doesn't do any syntax tests :

sub lint_check {
   my ($self) = @_;
   my $conf = $self->{conf};
   my ($k, $v);

   if ($conf->{lint_rules})
   {
     # Check for description and score issues in lint fashion
     while ( ($k,$v) = each %{$conf->{descriptions}} ) {
       if (length($v) > 50) {
         warn "warning: description for $k is over 50 chars\n";
         $conf->{errors}++;
       }
       if (!exists $conf->{tests}->{$k}) {
         warn "warning: description exists for non-existent rule $k\n";
         $conf->{errors}++;
       }
     }

     while ( my($sk) = each %{$conf->{scores}} ) {
       if (!exists $conf->{tests}->{$sk}) {
         warn "warning: score set for non-existent rule $sk\n";
         $conf->{errors}++;
       }
     }
   }
}

This function just add some warnings about scores and descriptions.
It will not deal with invalid syntax in rules, so, I think it's a proper 
way !

Kind regards,

Maxime Ritter wrote:

> On Sun, Nov 14, 2004 at 07:39:37PM +0000, David du SERRE-TELMON wrote:
> 
>>Rules du jour doesn't work with SpamAssassin 3.x because of different
>>sanitity checks add with SA3.
>>After adding the new rules with Rules du jour, SA complains about errors
>>in the syntax of the rules :
>>- description is over 50 chars
> 
> 
> That's because of rulesets which weren't updated for SA 3.0. Like mine.
> (but I started shortening the description).
> 
> 
>>- description exists for non-existent rule
> 
> 
> This might hide a real bug. 
> 
> 
>>- score set for non-existent rule
> 
> 
> Yeah, must be with my airmax.cf. I change the score of some rulesets I
> really don't like, such as :
> score     SARE_FREE_WEBM_FrYahoo   0
> (can't understand the guy who wrote this kind of rule, because these
> free webmails aren't evil).
> Consequently, if you use airmax.cf (or my french ruleset), but you don't use 
> the ruleset which contains the rules I desactive (such as SARE header), the 
> linting process shows many of this warning.
> So, in the case you use airmax.cf, it might be safely ignored. 
> 
> IMHO, if the new given score is zero (ie desactivating the rule), the
> non-existent rule warning should not be shown. Or maybe adding a way to
> change the score only if it exist to SA ?
> 
> 
>>I think these warnings can be safely ignored. This can be done by
>>updating the SA Perl parser and disable the call of the function lint_check.
> 
> 
> No, don't do this !
> The linting process is very usefull for some real bugs (like an invalid
> regex). If you want to do something, you might just disable the "description 
> is over 50 chars" and the "score set for non-existent rule" checks.
> 
> 
>>I think, this tip should be add in the README file of Rule du Jour and
>>in the port of Rule du jour. This change the code of SA, I don't think
>>we could
> 
> 
> IMHO, the proper way to do it, would be to add an option to SA code to
> disable/enable these checks.
> 
> 
>>Also, this message is for Chris, it could be a good idea to add this
>>rule in the default script :
>>http://maxime.ritter.eu.org/Spam/french_rules.cf
> 
> 
> Of course, I agree, it would be a good idea. But please, don't do automatic 
> downloading on this host. Use the mirror instead :
> -> http://airmex.nerim.net/rule-get/french_rules.cf
> The mirror is upgraded in real time.
> 
> 
>>This one is also very good for all spams :
>>http://maxime.ritter.eu.org/Spam/airmax.cf
> 
> 
> -> http://airmex.nerim.net/rule-get/airmax.cf
> 




More information about the freebsd-ports mailing list