https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6162

           Summary: Template TAGS don't allow underscores
           Product: Spamassassin
           Version: 3.2.5
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: trivial
          Priority: P5
         Component: Libraries
        AssignedTo: [email protected]
        ReportedBy: [email protected]


$pms->set_tag ('TAG_WITH_UNDERSCORE', 'value');

does return the actual value, suggesting the tag indeed has been defined, as
per M::SA::PerMsgStatus set_tag() documentation, since the returned value is
not undef.

Using a a template with underscores however, is not expanded to the value, but
used literally.

  add_header all  Foo  _TAG_WITH_UNDERSCORES_

results in the following header in the mail.

  X-Spam-Foo: _TAG_WITH_UNDERSCORES_


$pms->{tag_data}->{TAG_WITH_UNDERSCORES} does hold the correct 'value'. And the
winner is...

Somewhere between _process_header(), _replace_tags() and _get_tag(), it seems.
After quite a long hunt, I believe I finally got the little bugger.

PerMsgStatus _replace_tags(), who came up with *that* wonderful line of code?

  $text =~ s{(_(\w+?)(?:\((.*?)\))?_)}{

The fact that RE is not anchored, but the $2 match is not greedy, results in
the RE missing TAG_WITH_UNDERSCORE. Did not test this, though, because...

Any fix, if any, needs to carefully consider bug 4793.

-- 
Configure bugmail: 
https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Reply via email to