Bayes Rebuild

Eric Dantan Rzewnicki rzewnickie at RFA.ORG
Fri Apr 2 22:01:37 IST 2004


On Fri, Apr 02, 2004 at 10:48:25PM +0200, Peter Bonivart wrote:
> John Rudd wrote:
> >Matthew Baker wrote:
> >>would prevent it, but I'd like MailScanner to keep doing it.
> >the .spamassassin directory, does the expiry, and then re-starts
> >mailscanner.
> Since this has been debated a lot lately again and Julian explained the
> inner workings of how MS deals with this I have updated my FAQ entry. I
> think it now covers how to do it manually with no risks. If there are
> any errors please let me know so I can correct them.
> http://www.sng.ecs.soton.ac.uk/mailscanner/serve/cache/303.html
> As far as I know there's still a bug involved in expiring from MS and
> the SA guys have fixed it for the next release of SA. Please correct me
> on this one too if wrong.

This patch to SA.pm suggested by Julian fixes it from the MS side. This
is against 4.28.6. I don't know if this was included in the 4.29.x
stable release.

-Eric Rz.


--- SA.pm.old   Fri Mar 26 11:13:38 2004
+++ SA.pm       Mon Mar 29 12:27:50 2004
@@ -127,15 +127,21 @@

         # Do the actual expiry run
         MailScanner::Log::InfoLog('SpamAssassin Bayes database rebuild
starting');
-        $MailScanner::SA::SAspamtest->init_learner({
-                        force_expire => 1,
-                        learn_to_journal => 0,
-                        wait_for_lock => 1,
-                        caller_will_untie => 1});
-        $MailScanner::SA::SAspamtest->rebuild_learner_caches({
-                        verbose => 0,
-                        showdots => 0});
-        $MailScanner::SA::SAspamtest->finish_learner();
+        eval {
+          $MailScanner::SA::SAspamtest->init(1);
+          $MailScanner::SA::SAspamtest->init_learner({
+                          force_expire => 1,
+                          learn_to_journal => 0,
+                          wait_for_lock => 1,
+                          caller_will_untie => 1});
+          $MailScanner::SA::SAspamtest->rebuild_learner_caches({
+                          verbose => 0,
+                          showdots => 0});
+          $MailScanner::SA::SAspamtest->finish_learner();
+        };
+        MailScanner::Log::WarnLog("SpamAssassin Bayes database rebuild " .
+                                  "failed with error: %s", $@)
+          if $@;

         # Unlock the bayes rebuild lock file
         unlink($MailScanner::SA::BayesRebuildLock);



More information about the MailScanner mailing list