(Should this RFE be put into bugzilla?)

I'm building a spamassassin 3.0 installation in my organisation, and as
part of that I need to allow my users to easily update their
configuration (which I've stored in an SQL database). I realise there's
some web-based offerings out there, but I wanted a command-line based
tool with more functionality.

My sticky point has come when dealing with rules in the usepref table.
They look something like this:

preference      value
describe        RULE1 a description
score           RULE1 1.2

A quick look through the spamassassin code notes that the SQL parsing
does something similar to this for each row:

"preference \t value \n"

and joins them all together.

This means it's relatively trivial to parse the strings in the same way
that the existing code parses the text-based configuration files.

However, when working with this table directly with SQL (particularly
when it comes to updating - pulling data out is straightforward) I'm
having difficulty with the fact that there are multiple "describe"
preferences. The only way to differentiate them is by looking at the
start of the value field.

There are bound to be kludges round this, but a neat solution, I feel,
would be to do something like this:

preference      name    value
describe        RULE1   a description
score           RULE1   1.2
required_score          5.0

Looking at this from a SpamAssassin point of view the changes required
to do this would be purely in the Conf/SQL.pm, which is quite self
contained. Granted it would break existing tools which access this, but
3.0 seems like a good enough time to do it.

Any thoughts on doing this? I'm happy to work on a patch.

Cheers,
Tim.

-- 
Tim Bishop
http://www.bishnet.net/tim
PGP Key: 0x5AE7D984

Reply via email to