Custom function for 'Required SpamAssassin Score' runs multiple times for each message

Blatter, Nicholas drnick at
Mon Aug 3 17:34:59 IST 2009

I have been working on a new install of MailScanner and have run into a
potential problem when using a custom function for the 'Required
SpamAssassin Score' setting.

The custom function is a modified version of the SQLSpamScore function
written by Julian Field.  It allows our users to customize their SA spam
score via the web and appears to be working correctly except that
MailScanner seems to be running the function several times for each
message that the server receives.

I've modified the function to be more verbose and have it write the
current message ID and SQL result to the log every time the main
function is called.  I'm seeing the same MailScanner instance (same pid
each time) call the function 4 times, each time with the exact same
message ID and SQL result.  The number of times doesn't seem to be
dependant upon the number of MailScanner children.

I hope this isn't too much of a stupid question, but I searched around
and couldn't see a reason that the custom function would be called more
than once.  I am also using SQL-based functions for many other config
options (Spam Checks, Is Definitely (Not) Spam, etc) and have no such
problems with those.

Thanks for your time,


More information about the MailScanner mailing list