https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8116
Henrik Krohns <apa...@hege.li> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |apa...@hege.li --- Comment #1 from Henrik Krohns <apa...@hege.li> --- If you look at the code of PerMsgStatus->check(), it's pretty clear that you are not supposed to call got_hit() anymore, as check() already calculated score and spam status and called "check_end" to plugins. The code looks the same on 3.4 and 4.0. Admittedly the documentation is bad in this regard. To feed hits to the parser before message scan is started, you can use the poorly documented suppl_attrib to parse(), this is the API that amavisd uses too to register hits. If you need to register hits during SA scan, then the correct option is simply to create normal SA plugin for this purpose. Leaving this bug open if someone wants to document that check() for all purposes finishes the scan and got_hit() etc should not be called after that. -------------- require Mail::SpamAssassin; my $spamtest = Mail::SpamAssassin->new(); open(my $message, '<', "testmsg.small") or die "Could not open file '$filename' $!"; my $mail = $spamtest->parse($message, suppl_attrib => { rule_hits => [ { rule => 'MY_TEST_CHECK', descr => "This is a test", score => 100 }, ] } ); my $status = $spamtest->check($mail); print("\$status->get_report()\n"); print($status->get_report()); $status->finish(); $mail->finish(); $spamtest->finish(); -- You are receiving this mail because: You are the assignee for the bug.