[Mimedefang] Optimisation of loading Net::CIDR Lists from SQLite

Mark van Proctor m.vanproctor at acquire.com.au
Tue Dec 26 21:37:26 EST 2006


After implementing greylisting rather successfully, we have noticed that
some ISPs and mail providers, such as gmail, like try alternative smtp
servers when the first server gets greylisted (sic. TEMPFAILed).

In order to work around this, we are looking at implementing the following
logic:

NEW EMAIL RECEIVED
Is $RelayAddr in a known NETWORK GROUP?
If yes: $RelayAddr set to DEFAULT ADDRESS for NETWORK GROUP
Continue with normal greylist processing...

In order to implement this, my plan is to extend my SQLite database to
include a RELAY_NETWORKS table which has RELAY_ADDR and NETWORK_ADDRESS
fields, where RELAY_ADDR is the DEFAULT ADDRESS for the NETWORK ADDRESS
(with /xx netmask).

My plan is to load these network addresses into Net::CIDR::Lists and
determine if the $RelayAddr is in them.

My thoughts, however, are that this will be extremely tedious - having to
load these Net::CIDR::Lists from the database EVERY SINGLE TIME AN EMAIL IS
RECEIVED!!!

Is there any way to get the multiplexor or perhaps the slaves to load this
information into memory ONCE (per slave if necessary) and maintain the
information for every single transaction (an /sbin/service mimedefang reread
can be called each time this is updated if necessary)

An alternative would be to create a function for SQLite that would implement
it such that I could call some SQL such as:

SELECT RELAY_ADDR FROM RELAY_NETWORKS WHERE IN_CIDR(NETWORK_ADDRESS, ?)

Would this require me to implement the Net::CIDR::Lists code manually or
could I just create a Net::CIDR:List for each NETWORK_ADDRESS field and run
the find() method to check if it is included in the range?

Any thoughts / suggestions would be much appreciated!

Mark

Mark van Proctor
Information Systems Analyst 

acQuire Technology Solutions Pty Ltd
Australia Chile Canada United Kingdom 



==============================================================================
This email (including all attachments) is the sole property of acQuire
Technology Solutions Pty Ltd and may be confidential. If you are not the
intended recipient, you must not use or forward the information contained in
it. This message may not be reproduced or otherwise republished without the
written consent of the sender. If you have received this message in error,
please delete the email and notify the sender.



More information about the MIMEDefang mailing list