Bug 7721 - Trying to set relative score no longer works, emits error in tests.
Summary: Trying to set relative score no longer works, emits error in tests.
Status: NEW
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Libraries (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: All All
: P2 normal
Target Milestone: 4.0.0
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-15 16:27 UTC by John Hardin
Modified: 2019-06-18 13:37 UTC (History)
2 users (show)



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description John Hardin 2019-06-15 16:27:56 UTC
The SA documentation states:

If any of the score values are surrounded by parenthesis '()', then all of 
the scores in the line are considered to be relative to the already set 
score. ie: '(3)' means increase the score for this rule by 3 points in all 
score sets. '(3) (0) (3) (0)' means increase the score for this rule by 3 
in score sets 0 and 2 only.

It looks like this feature isn't used much in the base rules, because I just added some score overrides like this to temporarily suppress stale net scores without affecting non-net scores:

    score FROM_IN_TO_AND_SUBJ    (0) 0.001 (0) 0.001
    score OBFU_TEXT_ATTACH       (0) 0.001 (0) 0.001

...and got this:

    not ok 1
    #   Failed test at t/SATest.pm line 786.
    # Looks like you failed 1 test of 1.
    1..2
    Argument "(0)" isn't numeric in numeric ne (!=) at t/basic_meta.t line 62.
    Argument "(0)" isn't numeric in numeric ne (!=) at t/basic_meta.t line 76.
    T_OBFU_ATTACH_MISSP depends on OBFU_TEXT_ATTACH with 0 score in set 0
    Argument "(0)" isn't numeric in numeric ne (!=) at t/basic_meta.t line 62.
    MIME_PHP_NO_TEXT depends on MIME_NO_TEXT with 0 score in set 0
    Argument "(0)" isn't numeric in numeric ne (!=) at t/basic_meta.t line 62.
    Argument "(0)" isn't numeric in numeric ne (!=) at t/basic_meta.t line 76.
    T_ZW_OBFU_FROMTOSUBJ depends on FROM_IN_TO_AND_SUBJ with 0 score in set 0
    Argument "(0)" isn't numeric in numeric ne (!=) at t/basic_meta.t line 62.
    Argument "(0)" isn't numeric in numeric ne (!=) at t/basic_meta.t line 62.
    Argument "(0)" isn't numeric in numeric ne (!=) at t/basic_meta.t line 62.
    Argument "(0)" isn't numeric in numeric ne (!=) at t/basic_meta.t line 62.
    Argument "(0)" isn't numeric in numeric ne (!=) at t/basic_meta.t line 62.
    Argument "(0)" isn't numeric in numeric ne (!=) at t/basic_meta.t line 76.
    T_OBFU_ATTACH_MISSP depends on OBFU_TEXT_ATTACH with 0 score in set 2
    Argument "(0)" isn't numeric in numeric ne (!=) at t/basic_meta.t line 62.
    Argument "(0)" isn't numeric in numeric ne (!=) at t/basic_meta.t line 62.
    MIME_PHP_NO_TEXT depends on MIME_NO_TEXT with 0 score in set 2
    Argument "(0)" isn't numeric in numeric ne (!=) at t/basic_meta.t line 62.
    Argument "(0)" isn't numeric in numeric ne (!=) at t/basic_meta.t line 62.
    Argument "(0)" isn't numeric in numeric ne (!=) at t/basic_meta.t line 62.
    Argument "(0)" isn't numeric in numeric ne (!=) at t/basic_meta.t line 76.
    T_ZW_OBFU_FROMTOSUBJ depends on FROM_IN_TO_AND_SUBJ with 0 score in set 2
    Argument "(0)" isn't numeric in numeric ne (!=) at t/basic_meta.t line 62.
    not ok 1
    #   Failed test at t/basic_meta.t line 92.
    ok 2
    # Looks like you failed 1 test of 2.

I'm not sure if this is an error in the test or in the interpretation of the `(n)` relative-score syntax.
Comment 1 John Hardin 2019-06-15 17:04:51 UTC
Ugh. Perhaps this is the issue:

  If **any** of the score values are surrounded by parenthesis '()', then **all** of 
  the scores in the line are considered to be relative...

This seems unnecessarily restrictive; it would be nice to be able to mix relative and specific scores...

Reducing severity.