List:

I am not sure if this is the proper place for this question, so let me
apologize in advance and the put on my asbestos underwear....

Is there any way to load more than just scores from SQL?  Or flush
blacklists/whitelists from the prefs?

I am running SA inside of MimeDefang (MD).  I have re-written the SA calls
from MD to init the SA object with username.  I have a custom SQL setup, etc
and all is good.

BUT... (there's always a big but [sic])

The first MD thread loads the conf from the database.  Subsequent calls to
my modified spam_assassin_init() [an MD function that I blatantly stole
massive code from] checks if an SA object exists and, if so, calls
load_scoresonly_sql(username).  Eg:
        // in init
        if (!defined($SATester)) {
                $SATester = Mail::SpamAssassin->new( {
                        local_tests_only        => 1,
                        dont_copy_prefs => 1,
                        LOCAL_RULES_DIR => $LOCAL_RULES_DIR,
                        userprefs_filename => $opts->{config},
                ));
                $SATester->init(1);
                $SATester->compile_now(1);
        } else {
                $SATester->load_scoresonly_sql($username)
        }

Question:  Is this even right?  

Looking at the docs, it seams that I shouldn't be specifying the
userpref_filename if I want to switch users.  MD does it so...
Also complie_now(1) won't read the user prefs, but then you can only use
"scores only" - am I understanding this correctly?
Should I be using copy_config().  If so, how do I load up parts of the
config to modify? (e.g. the user's goodies from the database)

As it stands, it works (almost) great, the user's scores from the db
over-ride the scores from the initialized thread (which are the scores for
the first user when it was initialized).  However, "additive" goodies like
blacklist_from don't go away, only scores are changed for the general
blacklist score.  I could tell my users "whitelists & blacklists are global"
like I have since installing SA years ago :-)

I've tried to modify SpamAssassin.pm with an "hack" routine
clear_blacklist_from() which is:

sub clear_blacklist_from {
        my $self = shift;
        $self->{blacklist_from} = {};
}

If this works, swell, but then I still need to re-load the user's config,
which I don't see a routine for reloading the config.

I've been digging through the SA code for a few days now - anyone have
pointers?

Thanks.

-Tony

This email message and any attachments are for the sole use of the intended 
recipient(s) and contain confidential and/or proprietary information.  Any 
unauthorized review, use, disclosure or distribution is prohibited.  If you are 
not the intended recipient, please contact the sender by reply email and 
destroy all copies of the original message and any attachments.

Reply via email to