Problem with SQL config on MailScanner

Steve Freegard steve.freegard at fsl.com
Wed Dec 1 11:04:10 GMT 2010


On 30/11/10 20:42, Eduardo Casarero wrote:
> Hi everybody! Today i started playing with the sql config options for
> MailScanner and i cant make it work.
>
> My "config" table definition:
>
> CREATE TABLE `config` (
>    `id` int(11) NOT NULL auto_increment,
>    `hostname` varchar(100) NOT NULL,
>    `value` varchar(100) NOT NULL,
>    `external` varchar(100) NOT NULL,
>    `options` varchar(100) NOT NULL,
>    PRIMARY KEY  (`id`)
> ) ENGINE=MyISAM
>
> MailScanner.conf:
>
> DB DSN = DBI:mysql:dbname=mailscanner;host=localhost;port=3306
> DB Username = root
> DB Password = password
> SQL Serial Number = SELECT value FROM config WHERE
> options='confserialnumber'
> SQL Quick Peek = SELECT value FROM config WHERE external=? AND hostname=?
> SQL Config = SELECT options, value FROM config WHERE hostname=?
> SQL Ruleset =
> SQL SpamAssassin Config =
> SQL Debug = yes
>
> this is the output i get:
>
> /opt/MailScanner/bin/MailScanner --debug --lint
>
> *Database functions disabled*
> Trying to setlogsock(unix)
>
> Reading configuration file /opt/MailScanner/etc/MailScanner.conf
> Read 865 hostnames from the phishing whitelist
> Read 5278 hostnames from the phishing blacklists
>
> Checking version numbers...
> Version number in MailScanner.conf (4.81.4) is correct.
> (...)
>
> Does anybody have any idea of what i am doing wrong?

Looking at the code:

+ # Disable database functions if required data not present
+ if (!$dsn || !$db_user || !$db_pass) {
+  $disabled = 1;
+  print STDERR "Database functions disabled\n" if $debug;
+  return undef;
+ }

It would appear that the functions think that 'DB DSN', 'DB Username' or 
'DB Password' fields evaluate to an empty value.

> Also, if the line "include" is enable at the end of MailScanner.conf
> with a valid config file all the DB config seems to dissapear, does
> anybody knows what is the precedence between the include and the db?

Not sure on this myself; personally I thought the whole include argument 
was weak, so I've never used it myself and never tested it with the 
database functions.  My advice would be to get the database functions 
working first by using MailScanner.conf only first.

Regards,
Steve.


More information about the MailScanner mailing list