Res: Res: Problems in write maillog to SQL

tlum mailscanner.info at tedworld.com
Thu Mar 13 22:01:25 GMT 2008


Interesting!!!

In MailWatch.pm enable:

DBI->trace(2,'/tmp/dbitrace.log'); (remove the '#').

Make sure the log points to some place where the MailScanner user has 
access to write. If this is a busy server then enable it only as long as 
necessary as the file can grow quite large quite quickly.

Examine the resulting log for problems. Be aware that a lot of unrelated 
transaction will also be logged and that some errors are normal. Below 
is an example of a correct transaction:

mysql_st_internal_execute MYSQL_VERSION_ID 50022
 >parse_params statement INSERT INTO maillog (timestamp, id, size, 
from_address, from_domain, to_address, to_domain, subject, clientip, 
archive, isspam, ishighspam, issaspam, isrblspam, spamwhitelisted, 
spamblacklisted, sascore, spamreport, virusinfected, nameinfected, 
otherinfected, report, ismcp, ishighmcp, issamcp, mcpwhitelisted, 
mcpblacklisted, mcpsascore, mcpreport, hostname, date, time, headers, 
quarantined) VALUES 
(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
Binding parameters: INSERT INTO maillog (timestamp, id, size, 
from_address, from_domain, to_address, to_domain, subject, clientip, 
archive, isspam, ishighspam, issaspam, isrblspam, spamwhitelisted, 
spamblacklisted, sascore, spamreport, virusinfected, nameinfected, 
otherinfected, report, ismcp, ishighmcp, issamcp, mcpwhitelisted, 
mcpblacklisted, mcpsascore, mcpreport, hostname, date, time, headers, 
quarantined) VALUES ('2008-03-11 
15:48:28','B025390101.C8002','22822','mailscanner-bounces at lists.mailscanner.info','lists.mailscanner.info','mailscanner.info at tedworld.com','tedworld.com','RE: 
Strange message !
...
[truncated for readability]
...
 mailscanner-bounces at lists.mailscanner.info','0')
 <- dbd_st_execute returning imp_sth->row_num 1
    <- execute= 1 at MailWatch.pm line 133

It is at this point the mysql insert is happening.



Bernardo Goulart de Faria wrote:
> The MailScanner not write in MySQL...
>
> Is empity:
>
> mysql> select count(*) from mailscanner.maillog;
> +----------+
> | count(*) |
> +----------+
> |        0 |
> +----------+
> 1 row in set (0.00 sec)
>
>
> Tanks
> Faria, Bernardo
>
> ----- Mensagem original ----
> De: tlum <mailscanner.info at tedworld.com>
> Para: MailScanner discussion <mailscanner at lists.mailscanner.info>
> Enviadas: Quinta-feira, 13 de Março de 2008 16:48:31
> Assunto: Re: Res: Problems in write maillog to SQL
>
> CORRECTION: I meant to say:
>
> At this point I would bet you have a problem with MailWatch retrieving
> the data from the database.
>
> tlum wrote:
> > Are you sure the record is not in the database and its not a MailWatch
> > issue? If you got that far so silently - no errors - then it almost
> > certainly has put the record in the table. I would check the database.
> >
> > # mysql -u <username> -p (if the db is not local you need -h
> > <hostname> also)
> > Enter password: <enter the password you created>
> > Welcome to the MySQL monitor.  Commands end with ; or \g.
> > Your MySQL connection id is 19266 to server version: 5.0.22
> >
> > Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
> >
> > mysql>
> >
> > then try "select count(*) from <database>.maillog;"
> >
> > and you'll get something like this:
> >
> > mysql> select count(*) from mailscanner.maillog;
> > +----------+
> > | count(*) |
> > +----------+
> > |    1875 |
> > +----------+
> > 1 row in set (0.01 sec)
> >
> > mysql>
> >
> > At this point I would bet you have a problem with MailScanner
> > retrieving the data from the database.
> >
> > Bernardo Goulart de Faria wrote:
> >> Hi,
> >>
> >>        I have these three messages on my maillog:
> >>
> >> Mar 12 13:08:23 angra-ms MailScanner[7185]: Config: calling custom
> >> init function MailWatchLogging
> >> Mar 12 13:08:23 angra-ms MailScanner[7185]: Started SQL Logging child
> >> Mar 12 13:17:56 angra-ms MailScanner[7147]: Logging message
> >> 562BB168F42.D55BE to SQL
> >>
> >> What perl module might be missing?
> >>
> >> Tanks
> >> Faria, Bernardo
> >>
> >> ----- Mensagem original ----
> >> De: tlum <mailscanner.info at tedworld.com 
> <mailto:mailscanner.info at tedworld.com>>
> >> Para: MailScanner discussion <mailscanner at lists.mailscanner.info 
> <mailto:mailscanner at lists.mailscanner.info>>
> >> Enviadas: Quinta-feira, 13 de Março de 2008 12:59:07
> >> Assunto: Re: Problems in write maillog to SQL
> >>
> >> When MailScanner starts up you should see message similar to following
> >> in maillog:
> >>
> >> Mar 13 11:22:25 ms1srvp01 MailScanner[23349]: Started SQL Logging child
> >>
> >> When mail is received you should see message similar to following in
> >> maillog:
> >>
> >> Mar 13 11:22:47 ms1srvp01 MailScanner[23336]: Logging message
> >> 4A8CC900F9.7D18D to SQL
> >> Mar 13 11:22:47 ms1srvp01 MailScanner[23338]: 4A8CC900F9.7D18D: Logged
> >> to MailWatch SQL
> >>
> >> If you don't see the first one then custom logging is not being
> >> registered. If you don't see the second then there is a problem with
> >> "Always Looked Up Last = &MailWatchLogging" in MailScanner.conf.
> >>
> >> Probably the most common reason is not connecting to the database for
> >> some reason... missing perl module, wrong credentials (bad connect
> >> strings), wrong permissions, etc.
> >>
> >> Bernardo Goulart de Faria wrote:
> >> > Hello,
> >> >
> >> >  I have one MailServer using Fedora 7 (2.6.21-1.3194.fc7) i686 i386
> >> > GNU/Linux + Postfix 2.5.1 + MailScanner 4.66.5-3 + MYSQL Ver 14.12
> >> > Distrib 5.0.45 + mailwatch-1.0.4 + PHP 5.2.4.
> >> > > I followed the guide instructions for the site. On file 
> header_check
> >> > of postfix, I put / ^ Received: / HOLD, set all permissions in
> >> > /var/postfix and /var/MailScanner. I installed the MailWatch and
> >> > changed information, User and Password in MailWatch.pm and
> >> > SQLBlacklist.pm, moved to
> >> > /usr/lib/MailScanner/MailScanner/CustomFunctions/.
> >> > Start the MailScanner and everything works normally, but the messages
> >> > are not recorded in the table in MySQL maillog. The permissions of
> >> > GRANT in the bank also has been set.
> >> >
> >> > Tanks!
> >> > Faria, Bernardo
> >> >
> >> >
> >> 
> ------------------------------------------------------------------------
> >> > Abra sua conta no Yahoo! Mail
> >> >
> >> <http://br.rd.yahoo.com/mail/taglines/mail/*http://br.mail.yahoo.com/>,
> >> > o único sem limite de espaço para armazenamento!
> >> > --
> >> > This message has been scanned for viruses and
> >> > dangerous content by *MailScanner* <http://www.mailscanner.info/>,
> >> and is
> >> > believed to be clean.
> >>
> >>
> >> --
> >> This message has been scanned for viruses and
> >> dangerous content by MailScanner, and is
> >> believed to be clean.
> >>
> >> --
> >> MailScanner mailing list
> >> mailscanner at lists.mailscanner.info 
> <mailto:mailscanner at lists.mailscanner.info>
> >> <mailto:mailscanner at lists.mailscanner.info 
> <mailto:mailscanner at lists.mailscanner.info>>
> >> http://lists.mailscanner.info/mailman/listinfo/mailscanner
> >>
> >> Before posting, read http://wiki.mailscanner.info/posting
> >>
> >> Support MailScanner development - buy the book off the website!
> >>
> >>
> >> 
> ------------------------------------------------------------------------
> >> Abra sua conta no Yahoo! Mail
> >> 
> <http://br.rd.yahoo.com/mail/taglines/mail/*http://br.mail.yahoo.com/>,
> >> o único sem limite de espaço para armazenamento!
> >> --
> >> This message has been scanned for viruses and
> >> dangerous content by *MailScanner* <http://www.mailscanner.info/>,
> >> and is
> >> believed to be clean.
> >
> >
>
>
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
> -- 
> MailScanner mailing list
> mailscanner at lists.mailscanner.info 
> <mailto:mailscanner at lists.mailscanner.info>
> http://lists.mailscanner.info/mailman/listinfo/mailscanner
>
> Before posting, read http://wiki.mailscanner.info/posting
>
> Support MailScanner development - buy the book off the website!
>
>
> ------------------------------------------------------------------------
> Abra sua conta no Yahoo! Mail 
> <http://br.rd.yahoo.com/mail/taglines/mail/*http://br.mail.yahoo.com/>, 
> o único sem limite de espaço para armazenamento!
> -- 
> This message has been scanned for viruses and
> dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is
> believed to be clean. 


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the MailScanner mailing list