Bug 7905

Summary: Meta tests that use networking should not be ignored in maybe_header_only and maybe_body_only
Product: Spamassassin Reporter: Bert Van de Poel <bert>
Component: LearnerAssignee: SpamAssassin Developer Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal CC: apache, bert, rwmaillists
Priority: P2    
Version: unspecified   
Target Milestone: 4.0.0   
Hardware: All   
OS: All   
Whiteboard:

Description Bert Van de Poel 2021-05-10 18:29:31 UTC
Currently when tests are evaluated for the header and body scores for Bayes autolearning, meta tests that define that they are network tests (tflags = net) are fully ignored. I would argue that this should not be the case. 

Specifically, the code within Conf.pm for maybe_header_only and maybe_body_only both contain code that when meta tests are passed to it, they are either not considered when the network tflag is set (which this bug is about) or always scored (which has other problems I will file another bug about).

I don't understand why requiring network functionality automatically disqualifies a meta test, but then does not disqualify a non-meta test. Considering that a meta test combines for example two URI tests that use external databases available through some sort of DNS or HTTP API, then both tests should set the network flag, as well as the meta test that derives from it (if I understand things correctly). I don't see why that inherently makes that test more or less relevant for defining whether or not it's relevant for autolearning.
Comment 1 Bert Van de Poel 2021-05-10 18:29:52 UTC
Bug 7906 is related to this https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7906
Comment 2 RW 2021-05-10 22:12:03 UTC
The network metarules are presumably ignored because there is usually a corresponding network eval rule with type header or body.
Comment 3 Bert Van de Poel 2021-05-10 22:14:04 UTC
I'm not sure I completely follow, RW. Could you perhaps give an example to explain? That way it may be easier for me to understand. Thank you in advance!
Comment 4 Henrik Krohns 2022-04-03 07:34:32 UTC
Rewrote autolearn logic. Meta points are now split between head/body, according to how many head/body rules it depends on (not recursive, just first deps are checked). If there are no head/body deps, nothing is added. No discrimination of network rules anymore.

Sending        trunk/lib/Mail/SpamAssassin/Conf.pm
Sending        trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm
Transmitting file data ..done
Committing transaction...
Committed revision 1899525.