SA Bugzilla – Bug 8128
spamassassin --lint doesn't detect bogus rule modifier format
Last modified: 2023-05-12 09:11:41 UTC
This works as expected: From: kun0000 <from@xylass.com> header LW_FROM_NAME_NUMS From::name =~ /\b[\w_\.-]+\d{3,}\b/ This doesn't work, doesn't give a lint error, and is a hard-to-spot error. header LW_FROM_NAME_NUMS From:name =~ /\b[\w_\.-]+\d{3,}\b/
Hard to spot indeed, as I can't spot the error? If you are referring to "From::name", it does output lint error?
(In reply to Henrik Krohns from comment #1) > Hard to spot indeed, as I can't spot the error? > > If you are referring to "From::name", it does output lint error? "From::name" works, with 2 colons. "From:name", with 1 colon, does not work (gets no hits on the regex) and does not give a lint error. It should do one or the other, in my opinion.
(In reply to Loren Wilton from comment #2) > (In reply to Henrik Krohns from comment #1) > > Hard to spot indeed, as I can't spot the error? > > > > If you are referring to "From::name", it does output lint error? > > "From::name" works, with 2 colons. It's not possible for it to work as parse does not accept it. $ spamassassin --lint --cf 'header LW_FROM_NAME_NUMS From::name =~ /\b[\w_\.-]+\d{3,}\b/' May 12 09:37:41.247 [1138651] warn: config: invalid head test LW_FROM_NAME_NUMS: From::name =~ /\\b[\\w_\\.-]+\\d{3,}\\b/ May 12 09:37:42.150 [1138651] warn: lint: 1 issues detected, please rerun with debug enabled for more information > "From:name", with 1 colon, does not work (gets no hits on the regex) and > does not give a lint error. It should do one or the other, in my opinion. Works just fine, you are doing something wrong. $ echo 'From: kun0000 <from@xylass.com>' | spamassassin -t -D all --cf 'header LW_FROM_NAME_NUMS From:name =~ /\b[\w_\.-]+\d{3,}\b/' 2>&1 | grep LW_FROM_NAME_NUMS May 12 09:39:14.969 [1138814] dbg: config: no description set for rule LW_FROM_NAME_NUMS May 12 09:39:16.030 [1138814] dbg: rules: ran header rule LW_FROM_NAME_NUMS ======> got hit: "kun0000"
Ah, ok. It must have been a change between 3.4 and trunk. In 3.4 2 colons works, 1 colon doesn't, neither give a lint error. [wilton@thursday ~]$ spamassassin --lint --cf 'header LW_FROM_NAME_NUMS From::name =~ /\b[\w_\.-]+\d{2,}\b/' [wilton@thursday ~]$ spamassassin --lint --cf 'header LW_FROM_NAME_NUMS From:name =~ /\b[\w_\.-]+\d{2,}\b/' [wilton@thursday ~]$ spamassassin --version SpamAssassin version 3.4.0 running on Perl version 5.16.3
As you know 3.4 is not maintained anymore, this is too trivial to bother.