Miguel Fernandes wrote:
Hi!

I'm just wondering, is there a limitation on the type of rules that can
be added to the SpamassAssin rules table?
Because adding something like (subject scoring):

header TEST_SUBJECT Subject =~ /test/i (I've tried several combinations
of fields: preference & value, with no success)
score TEST_SUBJECT 30 (this one is possible)

Does not seem straightforward...

My goal is to be able to score subjects through sql rules.

It should be possible with something like (untested):

INSERT INTO userpref (username, preference, value) VALUES ('@GLOBAL','header TEST_SUBJECT','Subject =~ /test/i');

I don't know if @GLOBAL entries like that will be preloaded like the stock rules or any of the other file-based config, or if that's just a shortcut for something to be retrieved for all users on a userprefs lookup. If it's the latter (I'm pretty sure it is), you'll have to enable allow_user_rules.

FWIW, this is probably the wrong way to solve whatever problem you're seeing. If you can describe why you want to do this, someone can probably give you a better way to do it.

-kgd

Reply via email to