You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2007/09/27 00:26:29 UTC

[Bug 5606] spamc/spamd tests fail due to broken -x logic

http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5606





------- Additional Comments From jm@jmason.org  2007-09-26 15:26 -------
(In reply to comment #3)
> Ok, I've tracked it down. In version 3.2 spamd calls
> Mail::SpamAssassin::init_learner() and that calls $self->init(1) which reads in
> the user_pref file. In version 3.1 spamd doesn't call init_learner.

This was from the fix for bug 3466 ('RFE: split out opportunistic work from the
current check/scan functions'):

: jm 184...; svn diff -r490113:490114 spamd/spamd.raw
Index: spamd/spamd.raw
===================================================================
--- spamd/spamd.raw     (revision 490113)
+++ spamd/spamd.raw     (revision 490114)
@@ -844,6 +844,10 @@
   }
 );

+$spamtest->init_learner({
+  opportunistic_expire_check_only => 1,
+});
+
 # if $clients_per_child == 1, there's no point in copying configs around
 unless ($clients_per_child > 1) {
   # unset $copy_config_p so we don't bother trying to copy things back
@@ -1409,7 +1413,9 @@
   }

   # Go ahead and check the message
-  my $status = $spamtest->check($mail);
+  $spamtest->init(1);
+  my $status = Mail::SpamAssassin::PerMsgStatus->new($spamtest, $mail);
+  $status->check();

   my $msg_score     = sprintf( "%.1f", $status->get_score );
   my $msg_threshold = sprintf( "%.1f", $status->get_required_score );
@@ -1528,6 +1534,16 @@
   # bug 3808: log scan results to any listening plugins, too
   $spamtest->call_plugins("log_scan_result", { result => $log });

+  # bug 3466: handle the bayes expiry bits after the results were returned to
+  # the client.  keeps clients from timing out.  if bayes_expiry_due is set,
+  # then the opportunistic check has already checked.  go ahead and do another
+  # sync/expire run.
+  if ($status->{'bayes_expiry_due'}) {
+    dbg("spamd: bayes expiry was marked as due, running post-check");
+    $spamtest->rebuild_learner_caches();
+    $spamtest->finish_learner();
+  }
+
   $status->finish();    # added by jm to allow GC'ing
   $mail->finish();


Theo, any chance of a comment?  I'm guessing that moving the 

+$spamtest->init_learner({
+  opportunistic_expire_check_only => 1,
+});

call to after preload_modules() will fix this bug.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.