Bug 7907 - Meta tests should be devolved to determine whether they apply to the header, body or both
Summary: Meta tests should be devolved to determine whether they apply to the header, ...
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Learner (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: 4.0.0
Assignee: SpamAssassin Developer Mailing List
Depends on:
Reported: 2021-05-10 18:37 UTC by Bert Van de Poel
Modified: 2022-04-03 08:20 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 Bert Van de Poel 2021-05-10 18:37:30 UTC
As outlined within bugs 7905 and 7906, meta tests are maltreated within the __get_autolearn_points, maybe_header_only and maybe_body_only functions. I suggest meta tests should be parsed further to determine whether they constitute a combination of only header tags, only body tags or a mix. If it is a mix, I would suggest a ratio is returned so the score can be partially attributed to header and partially to body.

However, I can think of certain meta rules I've written of a similar form to "if more than 3 of the following 10 tests succeed, then attribute this score", it may sometimes prove difficult to clearly indicate whether a test is actually header, body or a specific ratio of both. Therefore it's maybe worth considering having meta rules report their own categorization, for example with tflags like autolearn_header autolearn_body autolearn_both and the existing noautolearn for those to difficult to categorise.
Comment 1 Henrik Krohns 2022-04-03 08:20:06 UTC
Added autolearn_header and autolearn_body tflags support on top of previous Bug 7905 and Bug 7906 fixes.

Sending        trunk/UPGRADE
Sending        trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm
Sending        trunk/lib/Mail/SpamAssassin/Plugin/AutoLearnThreshold.pm
Transmitting file data ...done
Committing transaction...
Committed revision 1899526.