On 17 Jun 2019, at 16:41, Shreyansh Shrivastava. wrote:
Check_bayes() is declared in Bayes.pm. An object of Bayes.pm is made
in
init() sub of spamassassin.pm but check_bayes() isn't called there.
The 23_bayes.cf file has various configuration for check_bayes()
having
different min,max defined. Also check_bayes() is passed to
register_eval_rule() of Conf.pm. I am not able to connect these dots
to get
the entry point.
When the Mail::SpamAssassin object is initialized, it parses all of the
.cf files and constructs a subroutine from each "rule" line loaded. See
Mail::SpamAssassin::Conf::Parser, particularly add_test() and
finish_parsing().
The rule lines in 23_bayes.cf like this:
body BAYES_00 eval:check_bayes('0.00', '0.01')
body BAYES_05 eval:check_bayes('0.01', '0.05')
are each translated into a test subroutine that calls check_bayes(). The
pile of subroutines that is constructed from rules is called when
Mail::SpamAssassin->check() is called, by way of
Mail::SpamAssassin::PerMsgStatus->check() and
Mail::SpamAssassin::PerMsgStatus->check_timed().
Does that help?
--
Bill Cole
b...@scconsult.com or billc...@apache.org
(AKA @grumpybozo and many *@billmail.scconsult.com addresses)
Not Currently Available For Hire