Ok, so SA 2.21  sorts the rules by score in an attempt  to stop scanning the
message if the user specified a scan threshold
Unfortunately, this completely breaks rule dependencies. Granted, those are mostly 
(only?) RBL rules for now, but rule dependency is needed somewhere.

Let me quote 20_head_tests.cf:
                                                                                
# X prefix is so that these are run after RCVD_IN_*. tests are run in           
# alphanumerically-sorted order.  (These used to be Osirusoft.com-specific, but 
# now, other DNSBLs are using the same convention.)                             
header X_OSIRU_SPAM_SRC         eval:check_rbl_results_for('relay', '127.0.0.4')
describe X_OSIRU_SPAM_SRC       DNSBL: sender is Confirmed Spam Source


I just so happens  that I spent the last week overhauling  DNS RBL checks so
that they are  done properly wrt DUL checks and  checks across multiple RBLs
(see my proposed patch in the next message).
Of course, the new sort code not  only breaks the current behavior, but also
breaks my patch completely

For now, I've added the very dirty sort in run_eval_tests to negate the per
score sorting:

sub run_eval_tests {
  my ($self, $evalhash, $prepend2desc, @extraevalargs) = @_;
  my ($rulename, $pat, @args);
  local ($_);

  my @tests = keys %{$evalhash};
  my @negative_tests;
  my @positive_tests;
  # add negative tests;
  foreach my $test (@tests) {
    if ($self->{conf}{scores}{$test} < 0) {
      push @negative_tests, $test;
    }
    else {
      push @positive_tests, $test;
    }
  }
  @negative_tests = sort { $self->{conf}{scores}{$a} <=> $self->{conf}{scores}{$b} } 
@negative_tests;
  @positive_tests = sort { $self->{conf}{scores}{$b} <=> $self->{conf}{scores}{$a} } 
@positive_tests;

  foreach my $rulename (sort (@negative_tests, @positive_tests)) {
                        ^^^^
                        here

We need to  work out some way to  add rule dependency if you  really want to
sort by score

For  that matter,  my  other upcoming  patch  (not yet  written  due to  the
dependency problem)  is supposed  to start  all the DNS  RBL queries  in the
background at the beginning and read the result after all the rules have run
or after  10 seconds, whichever comes  last, and ignore the  results if they
haven't come in time (stuck DNS query)
Any direction  on how  this is  going to  be approached  would help  me with
writing the patch.

Thanks,
Marc
-- 
Microsoft is to operating systems & security ....
                                      .... what McDonalds is to gourmet cooking
  
Home page: http://marc.merlins.org/   |   Finger [EMAIL PROTECTED] for PGP key

_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to