HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   MailWatch Error: no rows retrieved from database (http://www.howtoforge.com/forums/showthread.php?t=38571)

sergio.arnaldo 28th August 2009 09:27

MailWatch Error: no rows retrieved from database
 
Hello Guys,

I have recently installed MailScanner SpamSnake from the howto provided in HowtoForge.

I believe I have followed the howto correctly but at the end I see no messages with MailWatch. The error is: "Error: No rows retrieved from database". I have been thinking this has to do with permissions and with meaningful help of Rocky I went through some steps again but with success.

I also think that MailScanner is not logging into MySQL... Well, I am not sure...

Details of my system are:
Ubuntu Server 9.04
MailScanner 4.75.11
MaiWatch 1.0.4
MySQL-Sever 5.1.30really5.0.75-0ubuntu10.2
Spamassassin 3.2.5-4
ClamAV 0.95.1+dfsg-1ubuntu1.2

Everything else seems to work fine....
Please help

Rocky 29th August 2009 05:17

Hey,

What's in your postfix log?

sergio.arnaldo 31st August 2009 10:27

Hello Rick,
Please find below my postfix log (mail.log):

Aug 31 10:07:07 spamsnake postfix/smtpd[25236]: connect from unknown[201.240.5.184]
Aug 31 10:07:08 spamsnake postfix/smtpd[24855]: connect from unknown[95.58.39.60]
Aug 31 10:07:08 spamsnake postfix/smtpd[24459]: connect from mail.hg.co.mz[196.28.239.152]
Aug 31 10:07:08 spamsnake postfix/pickup[26725]: F03C2B1C4A6: uid=0 from=<root>
Aug 31 10:07:08 spamsnake postfix/cleanup[24281]: F03C2B1C4A6: message-id=<20090831080708.F03C2B1C4A6@spamsnake.xxxxx.yyy .zz>
Aug 31 10:07:08 spamsnake postfix/qmgr[29408]: F03C2B1C4A6: from=<root@xxxxx.yyy.zz>, size=1333, nrcpt=1 (queue active)
Aug 31 10:07:09 spamsnake postfix/smtpd[26639]: connect from unknown[212.174.19.14]
Aug 31 10:07:09 spamsnake postfix/smtpd[24459]: NOQUEUE: reject: RCPT from mail.gg.com.zz[196.28.239.152]: 450 4.1.8 <sguivala@missionpharma.local>: Sender address rejected: Domain not found; from=<sguivala@missionpharma.local> to=<sergio.guivala@xxxxx.yyy.zz> proto=ESMTP helo=<SERVER.missionpharma.local>
Aug 31 10:07:09 spamsnake postfix/smtp[26165]: F03C2B1C4A6: to=<root@xxxxx.yyy.zz>, orig_to=<root>, relay=192.168.253.3[192.168.253.3]:25, delay=0.23, delays=0.03/0/0/0.2, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 93A0C1E1814E)
Aug 31 10:07:09 spamsnake postfix/qmgr[29408]: F03C2B1C4A6: removed
Aug 31 10:07:09 spamsnake postfix/policy-spf[26179]: handler sender_policy_framework: is decisive.
Aug 31 10:07:09 spamsnake postfix/policy-spf[26179]: : Policy action=PREPEND Received-SPF: neutral (artemisiastyle.com: Domain does not state whether sender is authorized to use 'Torri-ovaizarg@artemisiastyle.com' in 'mfrom' identity (mechanism '?all' matched)) receiver=spamsnake.xxxxx.yyy.zz; identity=mailfrom; envelope-from="Torri-ovaizarg@artemisiastyle.com"; helo=74-94-36-190-Philadelphia.hfc.comcastbusiness.net; client-ip=74.94.36.190
Aug 31 10:07:09 spamsnake MailScanner[26650]: SpamAssassin cache hit for message 1BB89B1C4A3.9C218
Aug 31 10:07:09 spamsnake postfix/smtpd[24459]: disconnect from mail.gg.com.zz[196.28.239.152]
Aug 31 10:07:09 spamsnake MailScanner[26601]: New Batch: Found 3 messages waiting
Aug 31 10:07:09 spamsnake MailScanner[26601]: New Batch: Scanning 1 messages, 292644 bytes
Aug 31 10:07:09 spamsnake MailScanner[26601]: Message 3AA90B1C470.5C779 from 196.38.50.4 (lucyl@stgroup.co.za) to insecm.go.zz is too big for spam checks (292644 > 200000 bytes)
Aug 31 10:07:09 spamsnake MailScanner[26650]: Virus and Content Scanning: Starting
Aug 31 10:07:09 spamsnake postfix/smtpd[25612]: connect from bzq-219-134-196.static.bezeqint.net[62.219.134.196]
Aug 31 10:07:09 spamsnake MailScanner[26601]: Virus and Content Scanning: Starting
Aug 31 10:07:09 spamsnake postfix/smtpd[25899]: disconnect from unknown[196.38.50.4]
Aug 31 10:07:09 spamsnake postfix/policy-spf[26705]: handler sender_policy_framework: is decisive.
Aug 31 10:07:09 spamsnake postfix/policy-spf[26705]: : Policy action=PREPEND Received-SPF: neutral (wnnlimited.com: Domain does not state whether sender is authorized to use 'arlowena2002@wnnlimited.com' in 'mfrom' identity (mechanism '?all' matched)) receiver=spamsnake.xxxxx.yyy.zz; identity=mailfrom; envelope-from="arlowena2002@wnnlimited.com"; helo=25-xdsl.anitex.by; client-ip=213.184.241.25
Aug 31 10:07:09 spamsnake MailScanner[26650]: Requeue: 1BB49B1C494.12EF4 to 0C8E3B1C4A5
Aug 31 10:07:09 spamsnake postfix/smtpd[25155]: NOQUEUE: reject: RCPT from 74-94-36-190-Philadelphia.hfc.comcastbusiness.net[74.94.36.190]: 554 5.7.1 Service unavailable; Client host [74.94.36.190] blocked using zen.spamhaus.org; http://www.spamhaus.org/query/bl?ip=74.94.36.190; from=<Torri-ovaizarg@artemisiastyle.com> to=<vmunguambe@mitssau.go.zz> proto=ESMTP helo=<74-94-36-190-Philadelphia.hfc.comcastbusiness.net>
Aug 31 10:07:09 spamsnake MailScanner[26650]: Requeue: 1BB89B1C4A3.9C218 to CBF5CB1C494
Aug 31 10:07:09 spamsnake MailScanner[26650]: Uninfected: Delivered 2 messages
Aug 31 10:07:09 spamsnake postfix/qmgr[29408]: 0C8E3B1C4A5: from=<amahuaie_2006@yahoo.com.br>, size=110585, nrcpt=1 (queue active)
Aug 31 10:07:09 spamsnake postfix/qmgr[29408]: CBF5CB1C494: from=<amahuaie_2006@yahoo.com.br>, size=110586, nrcpt=1 (queue active)
Aug 31 10:07:09 spamsnake MailScanner[26650]: Deleted 2 messages from processing-database
Aug 31 10:07:09 spamsnake MailScanner[26742]: MailScanner E-Mail Virus Scanner version 4.75.11 starting...
Aug 31 10:07:09 spamsnake MailScanner[26601]: Requeue: 3AA90B1C470.5C779 to A38EFB1C4A3
Aug 31 10:07:09 spamsnake postfix/qmgr[29408]: A38EFB1C4A3: from=<lucyl@stgroup.co.za>, size=292073, nrcpt=1 (queue active)
Aug 31 10:07:09 spamsnake MailScanner[26601]: Uninfected: Delivered 1 messages
Aug 31 10:07:09 spamsnake MailScanner[26601]: Deleted 1 messages from processing-database
Aug 31 10:07:10 spamsnake MailScanner[26742]: Read 856 hostnames from the phishing whitelist
Aug 31 10:07:10 spamsnake postfix/smtpd[25614]: connect from unknown[95.208.234.237]
Aug 31 10:07:10 spamsnake postfix/policy-spf[26720]: handler sender_policy_framework: is decisive.
Aug 31 10:07:10 spamsnake postfix/policy-spf[26720]: : Policy action=PREPEND Received-SPF: permerror (mitssau.go.zz: Junk encountered in mechanism 'a:mail') receiver=spamsnake.xxxxx.yyy.zz; identity=mailfrom; envelope-from="don@mitssau.goz.zz"; helo=ppp-124-120-34-116.revip2.asianet.co.th; client-ip=124.120.34.116
Aug 31 10:07:10 spamsnake MailScanner[26742]: Read 6124 hostnames from the phishing blacklist
Aug 31 10:07:10 spamsnake MailScanner[26742]: Config: calling custom init function MailWatchLogging
Aug 31 10:07:10 spamsnake postfix/smtp[26743]: A38EFB1C4A3: to=<bmatsule@gtadf.go.cd>, relay=192.168.253.3[192.168.253.3]:25, delay=37, delays=37/0.01/0/0.22, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 8BD0E1E1814E)
Aug 31 10:07:10 spamsnake postfix/qmgr[29408]: A38EFB1C4A3: removed
Aug 31 10:07:10 spamsnake MailScanner[26742]: Using SpamAssassin results cache
Aug 31 10:07:10 spamsnake MailScanner[26742]: Connected to SpamAssassin cache database
Aug 31 10:07:10 spamsnake MailScanner[26742]: Enabling SpamAssassin auto-whitelist functionality...
Aug 31 10:07:11 spamsnake postfix/smtp[26028]: 0C8E3B1C4A5: enabling PIX workarounds: disable_esmtp delay_dotcrlf for aa.b.cc.ss.rr

sergio.arnaldo 31st August 2009 11:00

I really cannot understand why I can't see any rows with MailWatch.
The only thing it reads are the logs...

With MailWatch I notice that all tables are empty except geoip_country and sa_rules. users and whitelist have 1 row erach (the mailwatch user and the 127.0.0.1 address to whitelist).
Why isn't the database been filled?
Can you help me to check whether mailscanner is logging MySQL????

Please help!!

topdog 31st August 2009 16:05

You need to check the configuration of your Mailwatch logging module, its being called by mailscanner but for some reason it does not actually log to DB.

Verify the username, password and database settings.

sergio.arnaldo 2nd September 2009 20:08

Guys, please help me... I went through all the steps again.
I re-cheked the username, password and database settings but I sitill see no rows with MailWatch... This is driving me crazy!!

In MailWatch.pm there is the following code:
my($dbh);
my($sth);
my($hostname) = hostname;
my $loop = inet_aton("127.0.0.1");
my $server_port = 11553;
my $timeout = 3600
;

I cannot see port 11553 open with nmap on localhost. Should this port be open on localhost?

Below is my mail.log - MailScanner is not logging into MySQL
Please, please help! I don't know what else I should do have this working.

Sep 2 19:47:52 spamsnake MailScanner[4400]: MailScanner E-Mail Virus Scanner version 4.75.11 starting...
Sep 2 19:47:52 spamsnake MailScanner[4400]: Read 856 hostnames from the phishing whitelist
Sep 2 19:47:52 spamsnake MailScanner[4400]: Read 6856 hostnames from the phishing blacklist
Sep 2 19:47:52 spamsnake MailScanner[4400]: Config: calling custom init function MailWatchLogging
Sep 2 19:47:52 spamsnake MailScanner[4400]: Using SpamAssassin results cache
Sep 2 19:47:52 spamsnake MailScanner[4400]: Connected to SpamAssassin cache database
Sep 2 19:47:52 spamsnake MailScanner[4400]: Expired 10 records from the SpamAssassin cache
Sep 2 19:47:52 spamsnake MailScanner[4400]: Enabling SpamAssassin auto-whitelist functionality...
Sep 2 19:47:54 spamsnake MailScanner[4400]: Connected to processing-messages database
Sep 2 19:47:54 spamsnake MailScanner[4400]: Found 459659 messages in the processing-messages database
Sep 2 19:47:54 spamsnake MailScanner[4400]: Using locktype = flock
Sep 2 19:47:57 spamsnake MailScanner[4403]: MailScanner E-Mail Virus Scanner version 4.75.11 starting...
Sep 2 19:47:57 spamsnake MailScanner[4403]: Read 856 hostnames from the phishing whitelist
Sep 2 19:47:57 spamsnake MailScanner[4403]: Read 6856 hostnames from the phishing blacklist
Sep 2 19:47:57 spamsnake MailScanner[4403]: Config: calling custom init function MailWatchLogging
Sep 2 19:47:57 spamsnake MailScanner[4403]: Using SpamAssassin results cache
Sep 2 19:47:57 spamsnake MailScanner[4403]: Connected to SpamAssassin cache database
Sep 2 19:47:57 spamsnake MailScanner[4403]: Enabling SpamAssassin auto-whitelist functionality...
Sep 2 19:47:59 spamsnake MailScanner[4403]: Connected to processing-messages database
Sep 2 19:47:59 spamsnake MailScanner[4403]: Found 459659 messages in the processing-messages database
Sep 2 19:47:59 spamsnake MailScanner[4403]: Using locktype = flock
Sep 2 19:48:02 spamsnake MailScanner[4406]: MailScanner E-Mail Virus Scanner version 4.75.11 starting...
Sep 2 19:48:02 spamsnake MailScanner[4406]: Read 856 hostnames from the phishing whitelist
Sep 2 19:48:02 spamsnake MailScanner[4406]: Read 6856 hostnames from the phishing blacklist
Sep 2 19:48:02 spamsnake MailScanner[4406]: Config: calling custom init function MailWatchLogging
Sep 2 19:48:02 spamsnake MailScanner[4406]: Using SpamAssassin results cache
Sep 2 19:48:02 spamsnake MailScanner[4406]: Connected to SpamAssassin cache database
Sep 2 19:48:02 spamsnake MailScanner[4406]: Enabling SpamAssassin auto-whitelist functionality...
Sep 2 19:48:04 spamsnake MailScanner[4406]: Connected to processing-messages database
Sep 2 19:48:04 spamsnake MailScanner[4406]: Found 459659 messages in the processing-messages database
Sep 2 19:48:04 spamsnake MailScanner[4406]: Using locktype = flock
Sep 2 19:48:07 spamsnake MailScanner[4409]: MailScanner E-Mail Virus Scanner version 4.75.11 starting...
Sep 2 19:48:07 spamsnake MailScanner[4409]: Read 856 hostnames from the phishing whitelist
Sep 2 19:48:07 spamsnake MailScanner[4409]: Read 6856 hostnames from the phishing blacklist
Sep 2 19:48:07 spamsnake MailScanner[4409]: Config: calling custom init function MailWatchLogging
Sep 2 19:48:07 spamsnake MailScanner[4409]: Using SpamAssassin results cache
Sep 2 19:48:07 spamsnake MailScanner[4409]: Connected to SpamAssassin cache database
Sep 2 19:48:07 spamsnake MailScanner[4409]: Enabling SpamAssassin auto-whitelist functionality...
Sep 2 19:48:09 spamsnake MailScanner[4409]: Connected to processing-messages database
Sep 2 19:48:09 spamsnake MailScanner[4409]: Found 459659 messages in the processing-messages database
Sep 2 19:48:09 spamsnake MailScanner[4409]: Using locktype = flock
Sep 2 19:48:12 spamsnake MailScanner[4412]: MailScanner E-Mail Virus Scanner version 4.75.11 starting...
Sep 2 19:48:12 spamsnake MailScanner[4412]: Read 856 hostnames from the phishing whitelist
Sep 2 19:48:12 spamsnake MailScanner[4412]: Read 6856 hostnames from the phishing blacklist
Sep 2 19:48:12 spamsnake MailScanner[4412]: Config: calling custom init function MailWatchLogging
Sep 2 19:48:12 spamsnake MailScanner[4412]: Using SpamAssassin results cache
Sep 2 19:48:12 spamsnake MailScanner[4412]: Connected to SpamAssassin cache database
Sep 2 19:48:12 spamsnake MailScanner[4412]: Enabling SpamAssassin auto-whitelist functionality...
Sep 2 19:48:14 spamsnake MailScanner[4412]: Connected to processing-messages database
Sep 2 19:48:14 spamsnake MailScanner[4412]: Found 459659 messages in the processing-messages database
Sep 2 19:48:14 spamsnake MailScanner[4412]: Using locktype = flock

topdog 2nd September 2009 20:14

This is what you need to be checking
Code:

my($db_name) = 'mailscanner';
my($db_host) = 'localhost';
my($db_user) = 'mailwatch';
my($db_pass) = 'password';


sergio.arnaldo 3rd September 2009 08:32

topdog,
I really appreciate your reply.

As I mentioned before I've re-checked the username, password and database settings but I sitill see no rows with MailWatch...

How can I test or debug mailscanner logging into MySQL?
Are there any other tests that I should perform as regarding this issue?
Please help.

topdog 3rd September 2009 08:56

Yes you can, edit the MailWatch.pm file and uncomment DBI->trace as indicated below. Then restart MailScanner and look at the log file /root/dbitrace.log

Code:

# Trace settings - uncomment this to debug
DBI->trace(2,'/root/dbitrace.log');


sergio.arnaldo 3rd September 2009 16:51

Quote:

Originally Posted by topdog (Post 203064)
Yes you can, edit the MailWatch.pm file and uncomment DBI->trace as indicated below. Then restart MailScanner and look at the log file /root/dbitrace.log

Code:

# Trace settings - uncomment this to debug
DBI->trace(2,'/root/dbitrace.log');


topdog,

I can't get any logging in that file....


All times are GMT +2. The time now is 07:59.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.