thaks for testing all this and providing detailed help. Not sure why the wierd behavior, maybe someone else on the list can shed some light.
I am however having problems using "header" instead of "body". Is there some restriction in doing (using your example) instead of
preference= "body TEST_SQL" value="/TEST_SQL/i"
to replace those with
preference="header TEST_SQL" value="Subject =~ /TEST_SQL/i"
i would like to create rules for the subject, but the header tests seem to be not working.. Any ideas?
thanks adam
mysql> select * from userpref where username='[EMAIL PROTECTED]' ;
+----------------+--------------------+----------------------------- +--------+-------+
| username | preference | value | prefid | valid |
+----------------+--------------------+----------------------------- +--------+-------+
| [EMAIL PROTECTED] | rewrite_subject | 1 | 321 | NULL |
| [EMAIL PROTECTED] | report_safe | 2 | 273 | NULL |
| [EMAIL PROTECTED] | required_hits | 5 | 323 | NULL |
| [EMAIL PROTECTED] | header ADAM_TEST | Subject =~ /bogus/i | 335 | NULL |
| [EMAIL PROTECTED] | describe ADAM_TEST | STUPID TEST RULE | 334 | NULL |
| [EMAIL PROTECTED] | score ADAM_TEST | 100 | 333 | NULL |
+----------------+--------------------+----------------------------- +--------+-------+
On Monday, July 28, 2003, at 06:03 PM, Dallas L. Engelken wrote:
-----Original Message----- From: Adam Denenberg [mailto:[EMAIL PROTECTED] Sent: Monday, July 28, 2003 4:10 PM To: Dallas L. Engelken Cc: SA-Talk Subject: RE: [SAtalk] custom rules with mysql
dallas,
in order to make a rule like
Header L_s_casino Subject =~ /[EMAIL PROTECTED]/i describe L_s_casino Subject mentions a casino (RM) score L_s_casino 1.1
work, do you need to turn on allow_user_rules?
having some difficulty getting this to work with mysql per user.
adam
adam,
this may be slightly buggy.. if i have the custom rule already defined in local.cf, it is detected, and i can override the score and descript just fine via sql. however, if the custom rule name is not already defined in local.cf, the body rule disappears from the body_test hash....
i added some dbg code to PerMsgStatus.pm and when i have body TEST_SQL /TEST_SQL/i in local.cf, i see this debug output..
@400000003f259b0e0b9aae24 debug: Rule: TEST_SQL @400000003f259b0e0b9b8114 debug: Rule: TEST_SQL
i simply added if(\''.$rulename.'\'=~ /SQL/) { &dbg("Rule: '.$rulename.' "); } to line 1506 in PerMsgStatus.pm to achive that result.
now, when i remove the body rule from local.cf, and load it via SQL, i get no matching rules in for TEST_SQL in the $self->{conf}{body_tests}} hash... why did it not store it?? hmmm. well, allow_user_rules is 1 in local.cf, and my debug output shows the body rule is added because i have a dbg line showing that as well....
@400000003f259ca80788cb7c debug: add_test TEST_SQL /TEST_SQL/ig TYPE_BODY_TESTS @400000003f259ca8078b09b4 debug: add_test sub called. rule name: TEST_SQL - rule text: /TEST_SQL/ig - rule type: 10
still, the TEST_SQL rule does not exist in $self->{conf}{body_tests}}
i assume it has something to do with $self->{user_rules_to_compile} = 1 if $scoresonly; in Conf.pm, and when that value is 1, something else needs to be done for that body rule to be added to the body_tests hash??
i've dicked around long enough and now it's 5pm and time to go home... if someone can help shed some light on this, i would appreciate it.
dallas
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/ direct;at.aspnet_072303_01/01
_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk
------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ Spamassassin-talk mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/spamassassin-talk