Bug 7577

Summary: FreeMail.pm is keeping hits between different messages
Product: Spamassassin Reporter: Kevin A. McGrail <kmcgrail>
Component: PluginsAssignee: SpamAssassin Developer Mailing List <dev>
Status: RESOLVED DUPLICATE    
Severity: normal CC: apache, kmcgrail
Priority: P2    
Version: 3.4 SVN branch   
Target Milestone: 3.4.3   
Hardware: PC   
OS: Windows NT   
Whiteboard:

Description Kevin A. McGrail 2018-04-23 11:23:30 UTC
Thanks to Paul Murphy for helping tracking this down.

The per-msg-status description for the rule is not being cleared between runs:

FreeMail.pm:

    if ($pms->{main}->{conf}->{freemail_add_describe_email}) {

        $email =~ s/\@/[at]/g;

        $pms->got_hit($rulename, "", description => $desc." ($email)", ruletype => 'eval');

    }

The new hits are appended to the old ones, which is fine in the same invocation, but when the SA process is persistent and handles multiple messages, something needs to reset the state in PMS once the message is fully processed.  It seems that the dynamic rule descriptions are persisting.
Comment 1 Henrik Krohns 2018-10-04 07:51:05 UTC
Isn't this fixed ages ago?
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=6617

I tested with current trunk and 3.4 spamd, and all works as designed (only ever see one email in the rule report). Checking and debugging code, got_hit() simply does not permanently save the description.

Without any concrete examples of the problem and running environment, I have to conclude this as duplicate.

*** This bug has been marked as a duplicate of bug 6617 ***
Comment 2 Henrik Krohns 2018-10-25 08:35:38 UTC
Ok I actually stumbled on this accidently... it seems to be in effect when running spamassassin for multiple files. Spamd didn't do it..

We should call test_log instead of hacking suffix to got_hit.

Sending        spamassassin-3.4/lib/Mail/SpamAssassin/Plugin/FreeMail.pm
Sending        spamassassin-3.4/lib/Mail/SpamAssassin/Plugin/HashBL.pm
Sending        spamassassin-3.4/lib/Mail/SpamAssassin/Plugin/Phishing.pm
Sending        trunk/lib/Mail/SpamAssassin/Plugin/FreeMail.pm
Sending        trunk/lib/Mail/SpamAssassin/Plugin/HashBL.pm
Sending        trunk/lib/Mail/SpamAssassin/Plugin/Phishing.pm
Transmitting file data ......done
Committing transaction...
Committed revision 1844813.