Custom Whitelisting for MailScanner
The logic I had intended to implement in the MailScanner whitelisting was too complex; it turns out I can do it much more easily.
Each message is individually passed from MailScanner to my custom function. I was under the impression, that if I used two functions invoked during different phases of the scanning, I would have to create some sort of inter-process communication to pass data from the first to the second. That is wrong, and unfortunately wasted a couple of hours of my time.
I have the following directives in MailScanner.conf:
Information Header Value = &JPscanHead Is Definitely Not Spam = &JPscanWhite
What now happens is that JPscanWhite does the actual lookup in the directory as previously described and caches the current message identifier in a Perl hash, indicating if the message (the combination of sender and recipient) is on a white list or not.
As I haven't been able to set a header in the message before it is passed on to the next group of servers, I use the JPscanHead custom function to modify the information header (i.e. the value of Information Header) to indicate if the message is whitelisted or not.
I've thrown a few thousand messages against this to test it, and works very satisfactorily.
Keep it simple. ![]()
Jan-Piet Mens / Footers on Email with MailScanner wrote on 26-Mar-07 at 2:36 pm
[...] technology I'm applying to add the footers is similar to that which I used for custom whitelisting, although it is a bit more complex. This additional level of complexity arises from the fact that [...]
Jan-Piet Mens / MailScanner Custom Functions: A Small Tutorial wrote on 29-Mar-07 at 10:36 am
[...] can be used wherever a ruleset is expected. I myself have used such functions successfully for whitelisting incoming messages as well as for determining if an outgoing message needs a footer (signature) attached to it. Some [...]