[Bug 8061] Fix meta handling for $suppl_attrib->{rule_hits}

2022-10-12 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8061

Kevin A. McGrail  changed:

   What|Removed |Added

 CC||kmcgr...@apache.org

--- Comment #5 from Kevin A. McGrail  ---
+1 from me

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

[Bug 8061] Fix meta handling for $suppl_attrib->{rule_hits}

2022-10-12 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8061

spamassas...@arcsin.de changed:

   What|Removed |Added

 CC||spamassas...@arcsin.de

--- Comment #4 from spamassas...@arcsin.de ---
Many thanks, V2 works for us.

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

[Bug 8061] Fix meta handling for $suppl_attrib->{rule_hits}

2022-10-12 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8061

Henrik Krohns  changed:

   What|Removed |Added

   Attachment #5842|0   |1
is obsolete||

--- Comment #3 from Henrik Krohns  ---
Created attachment 5843
  --> https://bz.apache.org/SpamAssassin/attachment.cgi?id=5843=edit
Fix rule_hits, meta declaration V2

This V2 version should fix undefined warnings that result from () returning
undef.

(Note, currently parser accepts all sorts of funky things like "meta FOOBAR
&&", probably should be a bit more strict, but that's for another day and bug)

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

[Bug 8061] Fix meta handling for $suppl_attrib->{rule_hits}

2022-10-12 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8061

--- Comment #2 from Henrik Krohns  ---
Note, the above patch does not prevent using "meta __TRUNCATE 0" in the case of
rule_hits API, it will work too.

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

[Bug 8061] Fix meta handling for $suppl_attrib->{rule_hits}

2022-10-12 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8061

--- Comment #1 from Henrik Krohns  ---
Created attachment 5842
  --> https://bz.apache.org/SpamAssassin/attachment.cgi?id=5842=edit
Fix rule_hits, meta declaration

So the problem here is any rule that is not pre-declared in ruleset. If such
rule is used in a meta as dependency, it will be considered unrun and the whole
meta will not evaluate - unless of course got_hit() is called by rule_hits API.

A good real-world example is __TRUNCATE rule that amavisd may dynamically hit,
if a message is truncated.

meta FOOBAR  OTHER_RULE && !__TRUNCATE

In that case FOOBAR will never be run if __TRUNCATE does not hit.

In the case of rule_hits API, pre-declaring with "meta __TRUNCATE 0" could work
as rule_hits is processed right at the start of Check.pm, but that does not
work for other types of plugins that may dynamically hit some rule at later
stage.

So I propose a following format to be future-proof:

meta __TRUNCATE ()

That would be considered a declaration, which will not be evaluated immediately
(which other metas without dependencies currently do).

Attached patch for your consideration. May add tests and doc later.

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

[Bug 8061] Fix meta handling for $suppl_attrib->{rule_hits}

2022-10-11 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8061

Henrik Krohns  changed:

   What|Removed |Added

 Depends on||7735


Referenced Bugs:

https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7735
[Bug 7735] Meta rules need to handle missing/unrun dependencies
-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 8061] Fix meta handling for $suppl_attrib->{rule_hits}

2022-10-11 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8061

Henrik Krohns  changed:

   What|Removed |Added

   Target Milestone|Undefined   |4.0.0
 CC||apa...@hege.li

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