svn commit: r1936449 - spamassassin/trunk/lib/Mail/SpamAssassin/Plugin

[email protected] Wed, 22 Jul 2026 07:12:42 -0000
Newsgroups gmane.mail.spam.spamassassin.cvs
Message-ID <178470436260.402454.16004101102842132638@svn03-he-fi>
Author: gbechis
Date: Wed Jul 22 07:12:42 2026
New Revision: 1936449

Log:
remove start-of-string anchors and set the rule as lossy, it's a speed gain in any case

Modified:
   spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/BodyRuleBaseExtractor.pm

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/BodyRuleBaseExtractor.pm
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/BodyRuleBaseExtractor.pm	Wed Jul 22 07:10:58 2026	(r1936448)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/BodyRuleBaseExtractor.pm	Wed Jul 22 07:12:42 2026	(r1936449)
@@ -521,9 +521,10 @@ sub extract_hints {
   my $lossy = 0;
   $mods =~ s/L// and $lossy++;
 
-  # if there are anchors, give up; we can't get much 
-  # faster than these anyway
-  die "anchors" if $rule =~ /^\(?(?:\^|\\A)/;
+  # die "anchors" if $rule =~ /^\(?(?:\^|\\A)/;
+  # just remove start-of-string anchors; they're slow so could gain
+  # from our speedup
+  $rule =~ s/^\(?(?:\^|\\A)// and $lossy++;
 
   # die "anchors" if $rule =~ /(?:\$|\\Z)\)?$/;
   # just remove end-of-string anchors; they're slow so could gain