MailScanner trouble with DBD-MYSQL

Discussion in 'Server Operation' started by sergio.arnaldo, Aug 19, 2009.

  1. sergio.arnaldo

    sergio.arnaldo New Member

    Dear all

    I am recently installed MailScanner+MailWatch following the "The Perfect SpamSkane Ubuntu Jaunty Jackalope".
    I notice in logs that MailScanner keeps restarting all the time.
    I set debug = yes in MailScaner.conf and when I restart it the error I see is "Undefined subroutine &MailScanner::CustomConfig::SQLWhitelist called at /opt/MailScanner/lib/MailScanner/Config.pm line 171.

    I have reinstalled MailScanner 3 times because I couldn't get rid of the above error.
    I googled so many times because of it and it seems it is as issue with DBD-MySQL not being installed correctly. I tried to install is via apt-get but the error continues. I also tried to install it via CPAN but still I get errors.

    Below is part of mail.log:
    MailScanner E-Mail Virus Scanner version 4.75.11 starting...
    Aug 19 06:26:24 spamsnake MailScanner[11277]: Read 855 hostnames from the phishing whitelist
    Aug 19 06:26:24 spamsnake MailScanner[11277]: Read 5874 hostnames from the phishing blacklist
    Aug 19 06:26:24 spamsnake MailScanner[11277]: Config: calling custom init function SQLBlacklist
    Aug 19 06:26:24 spamsnake MailScanner[11277]: Config: calling custom init function MailWatchLogging
    Aug 19 06:26:24 spamsnake MailScanner[11277]: Config: calling custom init function SQLWhitelist
    Aug 19 06:26:24 spamsnake MailScanner[11277]: Using SpamAssassin results cache
    Aug 19 06:26:24 spamsnake MailScanner[11277]: Connected to SpamAssassin cache database
    Aug 19 06:26:24 spamsnake MailScanner[11277]: Enabling SpamAssassin auto-whitelist functionality...
    Aug 19 06:26:29 spamsnake MailScanner[11279]: MailScanner E-Mail Virus Scanner version 4.75.11 starting...
    Aug 19 06:26:29 spamsnake MailScanner[11279]: Read 855 hostnames from the phishing whitelist
    Aug 19 06:26:29 spamsnake MailScanner[11279]: Read 5874 hostnames from the phishing blacklist
    Aug 19 06:26:29 spamsnake MailScanner[11279]: Config: calling custom init function SQLBlacklist
    Aug 19 06:26:29 spamsnake MailScanner[11279]: Config: calling custom init function MailWatchLogging
    Aug 19 06:26:29 spamsnake MailScanner[11279]: Config: calling custom init function SQLWhitelist
    Aug 19 06:26:29 spamsnake MailScanner[11279]: Using SpamAssassin results cache
    Aug 19 06:26:29 spamsnake MailScanner[11279]: Connected to SpamAssassin cache database
    Aug 19 06:26:29 spamsnake MailScanner[11279]: Enabling SpamAssassin auto-whitelist functionality...
    Aug 19 06:26:29 spamsnake MailScanner[11277]: Connected to processing-messages database
    Aug 19 06:26:29 spamsnake MailScanner[11277]: Found 377577 messages in the processing-messages database
    Aug 19 06:26:29 spamsnake MailScanner[11277]: Using locktype = flock
    Aug 19 06:26:30 spamsnake MailScanner[11277]: Making attempt 2 at processing message 57C52B1C475.99C72
    Aug 19 06:26:30 spamsnake MailScanner[11277]: New Batch: Scanning 26 messages, 7565410 bytes
    Aug 19 06:26:31 spamsnake MailScanner[11279]: Connected to processing-messages database
    Aug 19 06:26:31 spamsnake MailScanner[11279]: Found 377602 messages in the processing-messages database
    Aug 19 06:26:31 spamsnake MailScanner[11279]: Using locktype = flock
    Aug 19 06:26:32 spamsnake MailScanner[11279]: New Batch: Scanning 26 messages, 7565410 bytes
    Aug 19 06:26:34 spamsnake MailScanner[11283]: MailScanner E-Mail Virus Scanner version 4.75.11 starting...
    Aug 19 06:26:34 spamsnake MailScanner[11283]: Read 855 hostnames from the phishing whitelist
    Aug 19 06:26:34 spamsnake MailScanner[11283]: Read 5874 hostnames from the phishing blacklist
    Aug 19 06:26:34 spamsnake MailScanner[11283]: Config: calling custom init function SQLBlacklist
    Aug 19 06:26:34 spamsnake MailScanner[11283]: Config: calling custom init function MailWatchLogging
    Aug 19 06:26:34 spamsnake MailScanner[11283]: Config: calling custom init function SQLWhitelist
    Aug 19 06:26:34 spamsnake MailScanner[11283]: Using SpamAssassin results cache
    Aug 19 06:26:34 spamsnake MailScanner[11283]: Connected to SpamAssassin cache database
    Aug 19 06:26:34 spamsnake MailScanner[11283]: Enabling SpamAssassin auto-whitelist functionality...
    Aug 19 06:26:36 spamsnake MailScanner[11283]: Connected to processing-messages database
    Aug 19 06:26:36 spamsnake MailScanner[11283]: Found 377628 messages in the processing-messages database
    Aug 19 06:26:36 spamsnake MailScanner[11283]: Using locktype = flock
    Aug 19 06:26:37 spamsnake MailScanner[11283]: Making attempt 2 at processing message 86FD6B1C487.584DC
    Aug 19 06:26:37 spamsnake MailScanner[11283]: New Batch: Scanning 26 messages, 7565410 bytes
    Aug 19 06:26:39 spamsnake MailScanner[11286]: MailScanner E-Mail Virus Scanner version 4.75.11 starting...
    Aug 19 06:26:39 spamsnake MailScanner[11286]: Read 855 hostnames from the phishing whitelist
    Aug 19 06:26:39 spamsnake MailScanner[11286]: Read 5874 hostnames from the phishing blacklist
    Aug 19 06:26:39 spamsnake MailScanner[11286]: Config: calling custom init function SQLBlacklist
    Aug 19 06:26:39 spamsnake MailScanner[11286]: Config: calling custom init function MailWatchLogging
    Aug 19 06:26:39 spamsnake MailScanner[11286]: Config: calling custom init function SQLWhitelist
    Aug 19 06:26:39 spamsnake MailScanner[11286]: Using SpamAssassin results cache
    Aug 19 06:26:39 spamsnake MailScanner[11286]: Connected to SpamAssassin cache database
    Aug 19 06:26:39 spamsnake MailScanner[11286]: Enabling SpamAssassin auto-whitelist functionality...
    Aug 19 06:26:41 spamsnake MailScanner[11286]: Connected to processing-messages database
    Aug 19 06:26:41 spamsnake MailScanner[11286]: Found 377653 messages in the processing-messages database
    Aug 19 06:26:41 spamsnake MailScanner[11286]: Using locktype = flock
    Aug 19 06:26:42 spamsnake MailScanner[11286]: New Batch: Scanning 26 messages, 7565410 bytes
    Aug 19 06:26:44 spamsnake MailScanner[11289]: MailScanner E-Mail Virus Scanner version 4.75.11 starting...
    Aug 19 06:26:44 spamsnake MailScanner[11289]: Read 855 hostnames from the phishing whitelist
    Aug 19 06:26:44 spamsnake MailScanner[11289]: Read 5874 hostnames from the phishing blacklist
    Aug 19 06:26:44 spamsnake MailScanner[11289]: Config: calling custom init function SQLBlacklist
    Aug 19 06:26:44 spamsnake MailScanner[11289]: Config: calling custom init function MailWatchLogging
    Aug 19 06:26:44 spamsnake MailScanner[11289]: Config: calling custom init function SQLWhitelist
    Aug 19 06:26:44 spamsnake MailScanner[11289]: Using SpamAssassin results cache

    Via CPAN I follow the steps:
    perl -MCPAN -e shell
    look DBD::mysql
    perl Makefile.PL --testdb=test --testuser=root --testpassword=supersecret --testhost=localhost
    make
    make test
    make install

    But in make test there are errors like these:
    t/40blobs.t 255 65280 ?? ?? ??
    33 tests skipped.
    Failed 1/35 test scripts. 0/6 subtests failed.
    Files=35, Tests=6, 3 wallclock secs ( 1.93 cusr + 0.26 csys = 2.19 CPU)
    Failed 1/35 test programs. 0/6 subtests failed.
    make: *** [test_dynamic] Error 255

    And If I insist on make install the output is following:
    root@spamsnake:~/.cpan/build/DBD-mysql-4.012-aIxLSX# make install
    Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
    Installing /usr/local/lib/perl/5.10.0/auto/DBD/mysql/mysql.so
    Writing /usr/local/lib/perl/5.10.0/auto/DBD/mysql/.packlist
    Appending installation info to /usr/local/lib/perl/5.10.0/perllocal.pod


    It seems installation goes ok.... but I am not sure.
    I still get the "Undefined subroutine &MailScanner::CustomConfig::SQLWhitelist called at /opt/MailScanner/lib/MailScanner/Config.pm line 171" whet I run MailScanner on debug mode.

    Whould anyone please help me to correct this?
     
  2. sergio.arnaldo

    sergio.arnaldo New Member

    Some updates....

    I fixed the problem with DBD-MYSQL installation by removing all DBD and DBI files and directories and reinstalling them again via CPAN.

    But I still get the error: "Undefined subroutine MailScanner::CustomConfig::SQLWhitelist called at /opt/MailScanner/lib/MailScanner/Config.pm line 171" when I try to run MislScanner on debug mode.

    MailScanner is not working at all,

    Please help!!
     
  3. sergio.arnaldo

    sergio.arnaldo New Member

    More updates...

    I notice that the problem is associated with the lines
    Is Definitely Not Spam = &SQLWhitelist
    Is Definitely Spam = &SQLBlacklist
    in MailScanner.conf
    When I comment these 2 line everythig seems to work ok.

    Any help????
     
  4. sergio.arnaldo

    sergio.arnaldo New Member

    Well I guess I won't have any help with this, so I rolled back to the original setting in MailScanner.com ie:

    Is Definitely Not Spam = %rules-dir%/spam.whitelist.rules
    Is Definitely Spam = no

    Afterall The &SQLBlacklist and &SQLWhitelist settings were intended to integrate SQL Blacklist /Whitelist within MailWath for Administrative purposes.... I guess...

    So as I mentioned I did a rollback to the original setttings and everything seems to work fine now.

    Should anyone come up with any ideas I would appreciate.
    I am very novice to all these stuff.
    Thank you.
    /Sergio Arnaldo
     
  5. Rocky

    Rocky New Member

    Hey,
    I'll try to figure out what's happening as I've come across that before.

    rocky
     
  6. sergio.arnaldo

    sergio.arnaldo New Member

    Hey Rocky

    Thanks for you reply.

    You know, yesterday I tried to reinstall mailwatch. I dropped and recreated the databases (mailscanner and sa_bayes), and now I notice that I have an error. when I run " spamassassin -x -D -p /opt/MailScanner/etc/spam.assassin.prefs.conf --lint" I get an error with bayes database:
    dbg: bayes: database connection established
    dbg: bayes: _get_db_version: SQL error: Table 'sa_bayes.bayes_global_vars' doesn't exist
    dbg: bayes: found bayes db version 0
    warn: bayes: database version 0 is different than we understand (3), aborting! at /usr/share/perl5/Mail/SpamAssassin/BayesStore/SQL.pm line 136

    And now Iam really stuck!!...
    The reason I did this is that I couldn't see any records withi MailWatch....
    Please help!!
     
  7. Rocky

    Rocky New Member

    Hey,

    Well, I think if you recreate sa_bayes.bayes_global_vars table, you should be fine.
     
  8. sergio.arnaldo

    sergio.arnaldo New Member

    Rocky,

    Please forgive my ignorance...
    You're definitely right.

    I am back to business now.
    But I still don't see any messages with MailWatch, only the queues.
    On Recent Messages I get: No rows retrieved
    And I get erros like "Error: no rows retrieved from database " when I try to access Reports...

    From What I have read this could be an issue with permissions, is that correct?
    How can I over come this?
     
  9. Rocky

    Rocky New Member

    Hey,

    You are correct about the problems being permission related. Redo sections 17.11 and 17.13. You should be fine after that.

    Rocky
     
  10. sergio.arnaldo

    sergio.arnaldo New Member

    Rocky,

    I went through sections 17.11 and 17.13 again but I still see no records.
    You know, I am really not sure if Mailscanner is logging to MySQL...

    How would I test that?
     
  11. Rocky

    Rocky New Member

    Hey,

    I believe you missed something from section 17, maybe the mailwatch logging part. Verify that section and if you like, I can take a remote ssh look to see what's going on.

    Rocky
     
  12. sergio.arnaldo

    sergio.arnaldo New Member

    Rocky

    I am going through whole section 17 again....
    I cannot understand what is going wrong.
    When I go to Tools/Links --> MySQL Database Status with MailWatch I notice that there is nothing in the tables... why aren't those tables been filled with data?
     

Share This Page