http://bugzilla.spamassassin.org/show_bug.cgi?id=4136





------- Additional Comments From [EMAIL PROTECTED]  2005-02-20 17:34 -------
The --reuse feature in mass-check is very useful.  In order to have the reused
rules available to meta rules, I have modified the message check in mass-check
to push/hit the reused rules into the message prior to checking.

This may not be the cleanest approach since it calls into PerMsgStatus directly.
 It also relates to bug3650, since finish() will be called twice on the
resulting message (when $ma and $status are cleaned up), which will fail 
currently.

--- mass-check.orig     Wed Feb 16 16:39:55 2005
+++ mass-check  Mon Feb 21 12:11:50 2005
@@ -344,7 +341,26 @@

   } else {
     $before = time;
-    $status = $spamtest->check($ma);
+    #  If we have reuse rules, setup a message with reuse hits
+    if ($opt_reuse && grep { $reuse{$_}->{reuse} } @previous) {
+      #  Manually push/hit reuse rules onto the message
+      #  This will assist with meta rule evaluations
+      #  Structure of code taken from SpamAssassin::Check
+      local ($_);
+      $spamtest->init(1);
+      my $msg = Mail::SpamAssassin::PerMsgStatus->new($spamtest, $ma);
+      #  Add reuse hits from previous
+      for (grep { $reuse{$_}->{reuse} } @previous) {
+        $msg->Mail::SpamAssassin::PerMsgStatus::got_pattern_hit($_, "REUSE: ");
+      }
+      $msg->check();
+      #  Still require $ma and $status, but causes problems cleaning up later
+      $ma     = $msg;
+      $status = $msg;
+    }
+    else {
+      $status = $spamtest->check($ma);
+    }
     $after = time;
   }





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

Reply via email to