SpamAssasin MySQL integration not selected. skipping.

Started by fendor, November 19, 2007, 05:46:59 AM

Previous topic - Next topic

fendor

Hi.

I am installing a mail toaster on a pristine FreeBSD 6.2-p8, ports up to date.
Mail toaster 5.06.

I am having trouble with the spamassassin db tables not being set up automatically and spamassassin is not creating the sql.cf for me.


This is what toaster_setup says when installing spamassassin (-s spamassassin)

root@mx1|ttyp0:/usr/local/src/Mail-Toaster-5.06# bin/toaster_setup.pl -s spamassassin
port_install: p5-Mail-SPF-Query.....................................ok (p5-Mail-SPF-Query-1.999.1)
port_install: p5-Mail-SpamAssassin..................................ok (p5-Mail-SpamAssassin-3.2.3)
port_install: maildrop..............................................ok (maildrop-2.0.4)
SpamAssasin MySQL integration not selected. skipping.

bin/toaster_setup.pl script execution complete.
root@mx1|ttyp0:/usr/local/src/Mail-Toaster-5.06#

I believe that I have configured toaster-watcher correctly, here is the relevant part:

install_spamassassin                = 1
install_spamassassin_flags        = -v -q -x   # Add -q for per user SQL prefs
install_spamassassin_sql           = 1       # use AWL, bayes, and per-user prefs from MySQL
install_spamassassin_dbuser     = spamassassin
install_spamassassin_dbpass     = mypassword
and
filtering_spamassassin_method      = user       # site | user | domain


What am I missing here ?

If more details are needed, don't hesitate to say what parts are of interest and I will provide it.


If I create/edit some of the sql.cf myself, for example for the userpref part, it does connect to and read the userpref correctly (I also create the userpref according to the spamassassin docs).
But I would very much appreciate to have toaster_setup generate it for me and also the userpref, bayes and awl tables.

With kind regards,
fendor.

fendor

#1
Hi again.

I have found a solution  :D

I believe I have found an error in the mail toaster setup script.
In Setup.pm in the section:
sub spamassassin_sql {

In the conditional code:
unless ( ! $conf->{'install_spamassassin_sql'} ) {
    print "SpamAssasin MySQL integration not selected. skipping.\n";
    return 0;
}

"if not not 'install_spamassassin_sql'"
so when you set install_spamassassin_sql = 1 it prints the warning and quits.

It should be:
unless ( $conf->{'install_spamassassin_sql'} ) {
    print "SpamAssasin MySQL integration not selected. skipping.\n";
    return 0;
}

Which makes the script work, wuuhuu.

Now the next step must be to make a diff patch and send it to Matt.
I'll go figure out how to do that.


IF you need to fix this right now, then do this:
(assuming you have installed the toaster script)
edit the file: /usr/local/lib/perl5/site_perl/5.8.8/Mail/Toaster/Setup.pm
Find the section:
sub spamassassin_sql {
remove the ' ! ' from the line:
unless ( ! $conf->{'install_spamassassin_sql'} ) {
so it looks like:
unless ( $conf->{'install_spamassassin_sql'} ) {
in the code part:
unless ( ! $conf->{'install_spamassassin_sql'} ) {
    print "SpamAssasin MySQL integration not selected. skipping.\n";
    return 0;
}


If you then run toaster_setup.pl -s spamassassin and setup the mysql userpref/awl/bayes and you already are running the mail toaster ie. the spamd is running, then remember to restart the spamd to have the new settings take effect: # /usr/local/etc/rc.d/sa-spamd restart
And make sure you have -q in rc.conf, somewhere along the lines of: spamd_flags="-v -q -x -u spamd"


Have a very nice day.

With kind regards,
fendor.

matt


fendor

Hi Matt.

That's very nice.

Have a fine day.

Kind regards,
fendor.