spamassassin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gbec...@apache.org
Subject svn commit: r1826771 - /spamassassin/branches/3.4/masses/rule-qa/list-bad-rules
Date Thu, 15 Mar 2018 07:33:00 GMT
Author: gbechis
Date: Thu Mar 15 07:33:00 2018
New Revision: 1826771

URL: http://svn.apache.org/viewvc?rev=1826771&view=rev
Log:
If there are rules present in score but not in .cf files a warning is printed,
shut up the warning.
bz 7535

Modified:
    spamassassin/branches/3.4/masses/rule-qa/list-bad-rules

Modified: spamassassin/branches/3.4/masses/rule-qa/list-bad-rules
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/masses/rule-qa/list-bad-rules?rev=1826771&r1=1826770&r2=1826771&view=diff
==============================================================================
--- spamassassin/branches/3.4/masses/rule-qa/list-bad-rules (original)
+++ spamassassin/branches/3.4/masses/rule-qa/list-bad-rules Thu Mar 15 07:33:00 2018
@@ -221,7 +221,11 @@ foreach my $plistkey (sort keys %{$plist
   my $tfs = $mailsa->{conf}->{tflags}->{$name} || '';
 
   my $src = $mailsa->{conf}->{source_file}->{$name};
-  $count_rules{$src}++;
+  if ( defined $src ) {
+    $count_rules{$src}++;
+  } else {
+    $count_rules{'not_present'}++;
+  }
 
   # skip rules of these tflags, we cannot judge them without more data
   if ($tfs =~ /\b(?:userconf|learn|net)\b/) {
@@ -303,7 +307,11 @@ exit;
 sub badrule {
   my ($name, $reason) = @_;
   my $src = $mailsa->{conf}->{source_file}->{$name};
-  $killed_rules{$src}->{$name} = $reason;
+  if ( defined $src ) {
+    $killed_rules{$src}->{$name} = $reason;
+  } else {
+    $killed_rules{'not_present'}->{$name} = $reason;
+  }
 
   # if it's a subrule in a meta rule, note this
   # TODO: this only works reliably for lexically-previous meta rules;



Mime
View raw message