http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4698

           Summary: "meta TEST 0" doesn't work
           Product: Spamassassin
           Version: SVN Trunk (Latest Devel Version)
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Libraries
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


Per a conversation on the dev@ list, it came up that a meta test with a numeric 
value only generates a 
warning:  "warn: Found = in conditional, should be == ..."

>From Dallas Engelken:
i would agree that this should not be a SA issue, except the
documentation spells out the usage of meta very clearly as

meta SYMBOLIC_TEST_NAME boolean expression

and 'meta TEST 0' follows those guidelines.

the problem with deleting a rule is if other meta's depended on that
rule, your lint would fail and your RDJ would fail to update.  the more
elegant solution may be to leave the original rule in place and 0 out
the score?

but, either the code should be changed to support 'meta TEST 0' or the
documentation should be updated.


My response:
Hrm.  Just to note, it's not as easy as looking for a number, all of these
result in the same problem:

0
0 <OP> 0
(0)
(0 <OP> 0)

an easy solution would be to change the code from:

if (my $result = ( $self->{'tests_already_hit'}->{'__HTML_LENGTH_384'} &&
$self->{'tests_already_hit'}->{'__TAG_EXISTS_CENTER'} ) ) { 
$self->got_hit(q#HTML_SHORT_CENTER#, "", 
$result);
}

to:

$result = ( $self->{'tests_already_hit'}->{'__HTML_LENGTH_384'} &&
$self->{'tests_already_hit'}->{'__TAG_EXISTS_CENTER'} );
if ($result) { $self->got_hit(q#HTML_SHORT_CENTER#, "", $result); }

that way the original version would become:

$result = 0;
if ($result) { $self->got_hit(q#SARE_OBFU_OBLIGATION#, "", $result); }

and do the "my $result" before the tests run.



This should be an easy patch (I'll see if I can put one up rsn).  There's a 
further issue, which IMO should 
be a separate discussion, about if there's a better way to deprecate a rule 
without triggering a --lint 
error for scores set for non-existant rules.



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

Reply via email to