Frequently changing rules

Simon Dick simon at ADVANTAGE-INTERACTIVE.COM
Fri Mar 12 12:02:02 GMT 2004


On Fri, 2004-03-12 at 11:50, Julian Field wrote:
> 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.

I probably will end up doing that but I just wanted to check if there
was an easy way of doing it via rules first. What I think i'll end up
doing is adding the ones that've been looked up to a hash along with a
timestamp and reuse that under x seconds after the lookup, seems easiest
overall.



More information about the MailScanner mailing list