https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8392

            Bug ID: 8392
           Summary: Debug logging only reports first capture tag when
                    multiple tags are present in a rule
           Product: Spamassassin
           Version: 4.0.2
          Hardware: All
                OS: All
            Status: NEW
          Severity: trivial
          Priority: P2
         Component: spamassassin
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: Undefined

Created attachment 6065
  --> https://bz.apache.org/SpamAssassin/attachment.cgi?id=6065&action=edit
suggested patch

When a rule contains multiple %{TAGNAME} placeholders, the debug message
"config: found named capture for rule..." is only logged for the first tag.
This is because the while loop in Conf/Parser.pm uses the /g modifier on the
substitution, which processes all placeholders in a single pass without
triggering the loop body for each individual match.

Removing the /g modifier causes the substitution to process one placeholder per
iteration, allowing the debug message to be logged for each tag found in the
rule.

This does not affect functionality - all tags are correctly registered in
capture_template_rules. The fix only improves debug output accuracy, which is
useful when diagnosing rules that depend on multiple capture tags.

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

Reply via email to