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

[email protected]
Newsgroups gmane.mail.spam.spamassassin.cvs
Message-ID <176539167998.3372073.17890654671105591757@svn02-us-east.apache.org>
Author: gbechis
Date: Wed Dec 10 18:34:38 2025
New Revision: 1930436

Log:
make it possible to use \. as a replacement in Mail::SpamAssassin::Plugin::HashBL::check_hashbl_bodyre

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

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/ReplaceTags.pm
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/ReplaceTags.pm	Wed Dec 10 16:52:36 2025	(r1930435)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/ReplaceTags.pm	Wed Dec 10 18:34:38 2025	(r1930436)
@@ -187,8 +187,15 @@ sub replace_result {
       if ($tag_name) {
         my $replacement = $conf->{replace_tag}->{$tag_name};
         if (defined $replacement) {
-          if($replacement =~ /^\(\?\:(.{1})/) {
+          if($replacement =~ /^\(\?\:(.{1,2})/) {
             my $subst = $1;
+	    # if the char that we need to substitute is escaped, remove the escape char
+	    # otherwise take the first char
+	    if($subst =~ /\\(.)/) {
+	      $subst = $1;
+	    } else {
+	      $subst = substr($subst, 0, 1);
+	    }
             my ($rec, $err) = compile_regexp($replacement, 0);
             if(!$rec) {
               dbg("Invalid regexp $replacement");
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.