<br><br><div class="gmail_quote">2010/12/1 Steve Freegard <span dir="ltr"><<a href="mailto:steve.freegard@fsl.com">steve.freegard@fsl.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On 30/11/10 20:42, Eduardo Casarero wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi everybody! Today i started playing with the sql config options for<br>
MailScanner and i cant make it work.<br>
<br>
My "config" table definition:<br>
<br>
CREATE TABLE `config` (<br>
`id` int(11) NOT NULL auto_increment,<br>
`hostname` varchar(100) NOT NULL,<br>
`value` varchar(100) NOT NULL,<br>
`external` varchar(100) NOT NULL,<br>
`options` varchar(100) NOT NULL,<br>
PRIMARY KEY (`id`)<br>
) ENGINE=MyISAM<br>
<br>
MailScanner.conf:<br>
<br>
DB DSN = DBI:mysql:dbname=mailscanner;host=localhost;port=3306<br>
DB Username = root<br>
DB Password = password<br>
SQL Serial Number = SELECT value FROM config WHERE<br>
options='confserialnumber'<br>
SQL Quick Peek = SELECT value FROM config WHERE external=? AND hostname=?<br>
SQL Config = SELECT options, value FROM config WHERE hostname=?<br>
SQL Ruleset =<br>
SQL SpamAssassin Config =<br>
SQL Debug = yes<br>
<br>
this is the output i get:<br>
<br>
/opt/MailScanner/bin/MailScanner --debug --lint<br>
<br>
*Database functions disabled*<br>
Trying to setlogsock(unix)<br>
<br>
Reading configuration file /opt/MailScanner/etc/MailScanner.conf<br>
Read 865 hostnames from the phishing whitelist<br>
Read 5278 hostnames from the phishing blacklists<br>
<br>
Checking version numbers...<br>
Version number in MailScanner.conf (4.81.4) is correct.<br>
(...)<br>
<br>
Does anybody have any idea of what i am doing wrong?<br>
</blockquote>
<br></div></div>
Looking at the code:<br>
<br>
+ # Disable database functions if required data not present<br>
+ if (!$dsn || !$db_user || !$db_pass) {<br>
+ $disabled = 1;<br>
+ print STDERR "Database functions disabled\n" if $debug;<br>
+ return undef;<br>
+ }<br>
<br>
It would appear that the functions think that 'DB DSN', 'DB Username' or 'DB Password' fields evaluate to an empty value.<div class="im"><br>
<br></div></blockquote><div><br></div><div>The problem was the empty password! thanks!</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Also, if the line "include" is enable at the end of MailScanner.conf<br>
with a valid config file all the DB config seems to dissapear, does<br>
anybody knows what is the precedence between the include and the db?<br>
</blockquote>
<br></div>
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.<br>
<br>
Regards,<br>
Steve.<br><font color="#888888">
-- <br>
MailScanner mailing list<br>
<a href="mailto:mailscanner@lists.mailscanner.info" target="_blank">mailscanner@lists.mailscanner.info</a><br>
<a href="http://lists.mailscanner.info/mailman/listinfo/mailscanner" target="_blank">http://lists.mailscanner.info/mailman/listinfo/mailscanner</a><br>
<br>
Before posting, read <a href="http://wiki.mailscanner.info/posting" target="_blank">http://wiki.mailscanner.info/posting</a><br>
<br>
Support MailScanner development - buy the book off the website! </font></blockquote></div><br>