You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Tom Allison <to...@tacocat.net> on 2007/01/26 02:26:45 UTC
SQL Bayes Store -- initialization of database
I'm trying to initialize a database for Bayes from perl (DIY).
Using Test::More as a start I tried:
can_ok('Mail::SpamAssassin::BayesStore', ('tie_db_readonly'));
my $to = 'tom';
my $spamtest = Mail::SpamAssassin->new( {username => $to, debug=>'all'} );
isa_ok($spamtest, 'Mail::SpamAssassin');
my $bayes = Mail::SpamAssassin::BayesStore->new($spamtest->{bayes_store_module});
isa_ok($bayes, 'Mail::SpamAssassin::BayesStore');
$bayes->tie_db_readonly();
Everything passes...
Except for the '$bayes->tie_db_readonly()'
returns 'bayes: tie_db_readonly: not implemented'
I'm a little confused as to why.
Re: SQL Bayes Store -- initialization of database
Posted by Tom Allison <to...@tacocat.net>.
Tom Allison wrote:
> I'm trying to initialize a database for Bayes from perl (DIY).
>
I took the advice of others and removed much of this approach and just decide to
try running Mail::SpamAssassin as is and let it create the database entry for
the specified user.
It simply will not create an entry in the bayes tables until you force a sync or
learn on it... I was really hoping to avoid doing this since the idea was to
passively generate the entries necessary for new users in the system rather than
forcing a call for each one.
I've also set the user_prefs in SQL although the table is empty. At least now I
don't have errors with it trying to create files that can't exist.
Additionally, when I first run spamd -q -D there is something a little strange.
It actually tries to score one email. There aren't any. It's not connected
to anything. It also tries to score it as the user I'm starting as. Is this a
normal startup process to just dummy test everything?