Spamassassin 2.50 & SQL logging
Julian Field
mailscanner at ecs.soton.ac.uk
Fri Feb 21 15:59:58 GMT 2003
At 15:41 21/02/2003, you wrote:
>On Fri, 2003-02-21 at 14:33, Julian Field wrote:
> > At 13:06 21/02/2003, you wrote:
> > >Also - I was wondering if anyone had tried getting MailScanner to log to a
> > >MySQL database?? - I was looking at the CustomConfig.pm and was thinking
> > >that I could create a custom function that would connect to the
> database and
> > >do something like 'INSERT INTO maillog VALUES
> > >('$message->{id}','$message->{size}','$message->{from}' etc..)' - or
> is this
> > >just a really bad idea?? The existing software we use does this into an
> > >Access database but we don't use it because it causes too much
> overhead, but
> > >I thought Perl's DBI/DBD and MySQL would probably be much more efficient
> > >than Access/ODBC!
> >
> > You are still talking a database "insert" for every batch of messages.
> > That's going to carry a fair sized overhead. How about writing them to a
> > file and then periodically pushing the file data into a database?
>
>How reasonable would it be to just insert entries when a virus or spam
>is found?
Again, it all depends how fast your database is. You could keep the db
connection open permanently, so it *should* be pretty quick. You would have
to hook it into one of the configuration parameters that gets used fairly
late on in the batch processing, and use a Custom Function for that
parameter that had the side-effect of logging all sorts of things about
messages.
--
Julian Field
www.MailScanner.info
MailScanner thanks transtec Computers for their support
More information about the MailScanner
mailing list