Bug 5781 - sandbox eval rules cause error message during make
Summary: sandbox eval rules cause error message during make
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Rules (Eval Tests) (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: Other other
: P5 normal
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-13 15:16 UTC by Sidney Markowitz
Modified: 2008-01-14 12:33 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 Sidney Markowitz 2008-01-13 15:16:55 UTC
I created an eval rule in my sandbox. If I commit it and svn update, or if I
manually edit my sandbox file in rulesrc, then do a make clean ; make, I see an
error message in the make test output that looks like this:

rules: failed to run T_SIDNEY_TEST__UNUSABLE_MSGID test, skipping:
	(Can't locate object method "check_messageid_not_usable" via package
"Mail::SpamAssassin::PerMsgStatus" at (eval 228) line 38.
)

In this example the rule I used was a copy of __UNUSABLE_MSGID, so it s not a
matter of something wrong with the rule itself

header T_SIDNEY_TEST__UNUSABLE_MSGID  eval:check_messageid_not_usable()

The rule itself appears to work once the make is done. make test runs fine.
Running make again without a make clean does not generate the error.
Comment 1 Justin Mason 2008-01-14 01:44:56 UTC
can you attach a patch that demos this?  there isn't really enough info there to
figure it out.
Comment 2 Sidney Markowitz 2008-01-14 02:37:43 UTC
(reply to comment #1)

It isn't really a matter of a patch. I thought that having an eval rule in my
sandbox was enough to trigger this bug, but I see that there are plenty of eval
rules in other people's sandboxes, yet I only see the problem with rules I put
in mine. I'm going to have to track this down more specifically.
Comment 3 Sidney Markowitz 2008-01-14 06:31:47 UTC
I have a rule that is triggering this checkd in to my sandbox, so unless this is
caused by something special in my environent, here's all you have to do to
reproduce it. In trunk, if I

 svn update
 make clean
 perl Makfile.PL
 make

than when make gets to buld/mkrules and processes my sandbox file in rulesrc I see

rulesrc/sandbox/sidney/70_other.cf: 0 active rules, 20 other
rules: failed to run T_SIDNEY__GATED_THROUGH_RCVD_REMOVER test, skipping:
	(Can't locate object method "gated_through_received_hdr_remover" via package
"Mail::SpamAssassin::PerMsgStatus" at (eval 227) line 19.
)


Do you not get the error?
Comment 4 Justin Mason 2008-01-14 08:23:34 UTC
yeah, I get it now ;)

This seems to fix it:



Index: rulesrc/sandbox/sidney/70_other.cf
===================================================================
--- rulesrc/sandbox/sidney/70_other.cf  (revision 611821)
+++ rulesrc/sandbox/sidney/70_other.cf  (working copy)
@@ -14,7 +14,9 @@
 header T_SIDNEY__LYRIS_EZLM_REMAILER  List-Unsubscribe =~
/<mailto:(?:leave-\S+|\S+-unsubscribe)\@\S+>$/

 # ezmlm again
+ifplugin Mail::SpamAssassin::Plugin::HeaderEval
 header T_SIDNEY__GATED_THROUGH_RCVD_REMOVER 
eval:gated_through_received_hdr_remover()
+endif

 # Allen notes this as 'Wacky sendmail version?'
 header T_SIDNEY__WACKY_SENDMAIL_VERSION Received =~ /\/CWT\/DCE\)/



basically, the build/mkrules linting code doesn't load any .pre files from the
files in rules/*.pre, so it hasn't loaded the HeaderEval plugin, hence the warning.
Comment 5 Sidney Markowitz 2008-01-14 12:33:40 UTC
Thanks.