https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8061

--- Comment #1 from Henrik Krohns <apa...@hege.li> ---
Created attachment 5842
  --> https://bz.apache.org/SpamAssassin/attachment.cgi?id=5842&action=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.

Reply via email to