Changing scores/rules on the fly when calling SpamAssassin from MailScanner

Matt Hampton matt at coders.co.uk
Wed Jul 11 17:23:26 IST 2007


Hi

I am looking at writing an extension to MailScanner so that we can allow
different settings to be applied.

My primary objective is to allow different username to be used for bayes.

If I am able to achieve scores and and rules as well this would be a bonus.

I have mocked something up which uses the $t->copy_config() and
$t->read_scoreonly_config().

I am saving the config (using freeze/thaws) to disk so that the other
MailScanner processes can share them (using tie with a Tie::DB_Lock).

I cause the tied hashfile to be recreated when MailScanner restarts
causing a reload of the primary files.

This is working but I was wondering if there was a better way to do it.

It looks like http://issues.apache.org/SpamAssassin/show_bug.cgi?id=3852
would help here but it doesn't look like any progress has been made :-)

If I just want to change the bayes username I can (I assume) just do this:

$f->signal_user_changed(username=>"newuser");

But how do I revert back to the default?

cheers

Matt



More information about the MailScanner mailing list