Bug 5959 - do not de-duplicate eval rules
Summary: do not de-duplicate eval rules
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Plugins (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: Other All
: P5 normal
Target Milestone: 3.3.0
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-13 00:14 UTC by Duncan Findlay
Modified: 2008-08-15 11:53 UTC (History)
0 users



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 Duncan Findlay 2008-08-13 00:14:44 UTC
Internally, the URIDetail plugin converts each "uri_detail" rule to a body eval rule that runs "check_uri_detail()". Different invocations of this function give different results because it checks $pms->{current_rule_name} and it uses the rule name to look up the actual definition of the rule in the config.

The "merge duplicate rules" code, as it's currently implemented, merges together rules with the same "definition", so only one uri_detail rule ever gets run. Obviously, this is a bad thing. It's pretty straightforward to fix the URIDetail plugin, but it's likely that there are third party plugins that work the same way, and it's definitely a gotcha for Plugin creators.

I would suggest that the "merge duplicates" code should be limited to regex rules. It seems useful to have multiple (different) rules that run the same eval rule code with the same (or no) arguments.
Comment 1 Justin Mason 2008-08-13 01:42:05 UTC
'I would suggest that the "merge duplicates" code should be limited to regex
rules. It seems useful to have multiple (different) rules that run the same
eval rule code with the same (or no) arguments.'

ok, I can see that being valid -- +1
Comment 2 Duncan Findlay 2008-08-15 11:53:26 UTC
duncf@orange:~/svn/apache/spamassassin$ svn commit
Sending        lib/Mail/SpamAssassin/Conf/Parser.pm
Sending        t/duplicates.t
Transmitting file data ..
Committed revision 686317.