Bug 3854 - [review] _TESTSSCORES_ doesn't list anything for no hit rules
Summary: [review] _TESTSSCORES_ doesn't list anything for no hit rules
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Libraries (show other bugs)
Version: 3.0.0
Hardware: Other other
: P5 normal
Target Milestone: 3.0.1
Assignee: Theo Van Dinter
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-01 12:18 UTC by Theo Van Dinter
Modified: 2004-10-07 07:24 UTC (History)
1 user (show)



Attachment Type Modified Status Actions Submitter/CLA Status
suggested patch patch None Theo Van Dinter [HasCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Theo Van Dinter 2004-10-01 12:18:28 UTC
When no rules are hit, _TESTS_ results in "none".  However, _TESTSSCORES_ results in blank output ("").

ie:

add_header all Test tests=_TESTS_ testsscores=_TESTSSCORES_

and no hits equals:

X-Spam-Test: tests=none testsscores=
Comment 1 Theo Van Dinter 2004-10-01 12:19:23 UTC
BTW, I believe this behavior has been this way since adding in TESTSSCORES.  It's in 2.64 at 
least, I didn't go back further.
Comment 2 Theo Van Dinter 2004-10-01 12:21:54 UTC
Created attachment 2400 [details]
suggested patch

trivial patch to return "none" if no rules hit
Comment 3 Theo Van Dinter 2004-10-01 12:23:07 UTC
may as well put it in 3.0.1
Comment 4 Malte S. Stretz 2004-10-02 06:02:23 UTC
+1 on this fix going into 3.0.1. 
 
But maybe it should return "none=0" to make it easier for possible scripts to 
parse that line? 
Comment 5 Theo Van Dinter 2004-10-02 10:49:28 UTC
Subject: Re:  [review] _TESTSSCORES_ doesn't list anything for no hit rules

On Sat, Oct 02, 2004 at 06:02:24AM -0700, bugzilla-daemon@bugzilla.spamassassin.org wrote:
> But maybe it should return "none=0" to make it easier for possible scripts to 
> parse that line? 

I thought about that, but decided that "none" ought to be a special token.
I'll go either way if there's a strong enough desire to do that though.

Comment 6 Michael Parker 2004-10-02 11:10:40 UTC
+1
Comment 7 Duncan Findlay 2004-10-02 12:32:10 UTC
-0.5 for 3.0.1

Is this really necessary? It's cosmetic, but it could cause scripts that parse
it to barf, which is not what we want for a minor release.
Comment 8 Theo Van Dinter 2004-10-02 12:35:53 UTC
Subject: Re:  [review] _TESTSSCORES_ doesn't list anything for no hit rules

On Sat, Oct 02, 2004 at 12:32:11PM -0700, bugzilla-daemon@bugzilla.spamassassin.org wrote:
> -0.5 for 3.0.1
> 
> Is this really necessary? It's cosmetic, but it could cause scripts that parse
> it to barf, which is not what we want for a minor release.

It's the difference between a bug and a feature IMO.

The behavior has been there since 2.6x, but is documented (and expected)
to work "same as _TESTS_", which it doesn't.

Comment 9 Justin Mason 2004-10-02 16:23:25 UTC
+1
Comment 10 Theo Van Dinter 2004-10-07 15:24:50 UTC
committed.  r54023