SQL Redux

Martin Hepworth maxsec at TOTALISE.CO.UK
Thu Jul 31 09:34:44 IST 2003


Chris

this is exactly the problem I'm seeing with 4.22.5 on FreeBSD.

It seems that mysql won't insert default values if there's a NULL value
in the placeholder. ie insert into maillog values (something, somthing,
something,\
something,, something) won't work as there is no entry for the fifth
placeholder.

I'm working on an ugly hack to the whole SQL logging routine that checks
each variable to make sure it's not NULL and builds the insert SQL
statement on the fly with the correct number of place holders etc. ie
the statement will become..

insert into maillog set (time, messageid, mailfrom) values (sometime,
somemessageid, somemailfrom)

rather than trying to insert everything via the current query.

I've got a rough code outline for this, just need to find a couple of
hours to implement and test.

--
Martin

Chris Trudeau wrote:

> All,
>
> I have an installed implementation (in test) that looks like this:
>
> Redhat 9.0
> MailScanner 4.22.1 (couldn't get 4.22.5 running, so I backed out a couple of
> versions)
> SA 2.55
> DCC
> Razor2
> MailWatch for MailScanner (for SQL logging and front-end PHP)
>
> It works beautifully.
>
> So I installed on 7.3 (because of MANY other RH9.0 issues)
> MailScanner 4.22.5 (runs fine)
> SA 2.55
> DCC and Razor2
> MailWatch for MailScanner
>
> to try and prove my implementation.  After MUCH troubleshooting, I have a
> working implementation that does everything but write to the database.  I
> have proven connectivity and permissions to the database and have tried
> running it locally and consistently get the same error:
>
> Jul 29 05:50:47 mta01 MailScanner[10505]: Cannot insert row:
>
> The message processes acurately and is delivered or not according to
> rules...it works GREAT...but I need the db logging to work...and I'm not
> sure which way to look...any help is appreciated.
>
> CT



More information about the MailScanner mailing list