Miguel Fernandes wrote:
Just tested with this:

+--------------+---------------------+--------------------+
| username | preference | value |
+--------------+---------------------+--------------------+
| @fatias.pt | header TEST_SUBJECT | Subject =~ /test/i |
| @fatias.pt | score TEST_SUBJECT | 30 |
| @fatias.pt | score GTUBE | 10 |
+--------------+---------------------+--------------------+

Catched Mysql doing this:

SELECT preference, value FROM userpref WHERE username =
'ma...@fatias.pt' OR username = '$GLOBAL' OR username =
CONCAT('@','fatias.pt') ORDER BY username ASC
(I've changed the '%' for a '@', as I need exact domain matches, hence
the username entries with '@'domain)

result is:
+---------------------+--------------------+
| preference | value |
+---------------------+--------------------+
| header TEST_SUBJECT | Subject =~ /test/i |
| score TEST_SUBJECT | 30 |
| score GTUBE | 10 |
+---------------------+--------------------+

Right, but does SA actually trigger than rule? I'm pretty sure it won't, because regex rules are not allowed in userprefs unless you have allow_user_rules enabled.

What I've done where I really want/need a rule for a subset of users is to define the rule as usual in my local configuration, but set a score of 0. That way it won't fire by default. Then, add the "score TEST_SUBJECT 30" entry to the userprefs as you've got above, and the rule *will* trigger.

-kgd

Reply via email to