> -----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

Reply via email to