On 02/01/2012 07:23 PM, 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 |
+---------------------+--------------------+
GTUBE works, TEST_SUBJECT does not
oh.. ok... stated
"My goal is to be able to score subjects through sql rules. "
not that you wanted to store the regex in SQL.
IIRC, that won't work.
you can store preferences in SQL, not rules.