Frequently changing rules

Julian Field mailscanner at ecs.soton.ac.uk
Fri Mar 12 11:50:32 GMT 2004


At 11:35 12/03/2004, you wrote:
>Is there any way to tell MailScanner to reread rules more frequently
>than just when the process restarts? This is mainly so I can control
>things via rules rather than CustomConfig add ons as I'd rather not do a
>mysql request for each thing!
>
>Any suggestions welcome

I would still use CustomConfig add-ons to do it as it will be a lot faster
than hunting rulesets each time you need a value. I suspect you are talking
about per-user rules where the addresses that are matched by the rulesets
probably don't overlap anyway, so you really just want to do a hash table
lookup on the email address to get the result for that address.

Why not implement a cache that re-reads the SQL tables every 10 or 15
minutes but then caches the results in hash tables for fast lookups. You
could even have a serial number in the SQL database that was incremented
every time a modification was made. You then just check the serial number
every few minutes. If it has changed then you re-read the tables, otherwise
just carry on using your current data. This can all be made very fast and
light-weight. You certainly don't need to do an SQL query for every lookup.
--
Julian Field
www.MailScanner.info
MailScanner thanks transtec Computers for their support

PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654



More information about the MailScanner mailing list