Bug 7577 - FreeMail.pm is keeping hits between different messages
Summary: FreeMail.pm is keeping hits between different messages
Status: RESOLVED DUPLICATE of bug 6617
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Plugins (show other bugs)
Version: 3.4 SVN branch
Hardware: PC Windows NT
: P2 normal
Target Milestone: 3.4.3
Assignee: SpamAssassin Developer Mailing List
Depends on:
Reported: 2018-04-23 11:23 UTC by Kevin A. McGrail
Modified: 2018-10-25 08:35 UTC (History)
2 users (show)

Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
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:


    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?

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.