#11 Added additional IP search in SQLBlackWhiteList.pm

Unstable (example)

I saw the SQLBlackWhiteList.pm file in cvs and loved
the idea of updating the white/blacklist via mailwatch.
Took me awhile to figure out how to use it but here is
what I did.

1. Copied SQLBlackWhiteList.pm to:


2. Added line to CustomConfig.pm under MailWatch.pm line:

require 'MailScanner/SQLBlackWhiteList.pm';

3. Updated MailScanner.conf:

Is Definitely Not Spam = &SQLWhitelist
Is Definitely Spam = &SQLBlacklist

I then thought it would be nice to have partial IP
matches like in the spam.whitelist.rules (ie 192.168.0.)

I edit the SQLBlackWhiteList.pm file to do this. Apply
the diff to the cvs version (patch -p0 <
SQLBlackWhiteList.pm.diff) and then you can add an
entry in the MailWatch List screen like so:

From: 192.168.0.
List: Whitelist

It should then show below as

From To
192.168.0. default

Restart MailScanner and you should see all emails
coming from that subnet (Class C) as whitelisted. Yuo
can also blacklist in the same way.

This only matches from addresses. A few tweaks and you
could have it match to addresses and other subnets.

NOTE: Above steps are for rpm installs; change the
directories to the appropriate locations for your system.


  • Scott Silva

    Scott Silva - 2005-09-19

    Logged In: YES

    I struggled with this patch, and then kicked myself after
    missing the trailing "dot" in the ip address.
    Works great, and maybe this will get added into a later version.

  • EndelWar

    EndelWar - 2015-04-30
    • status: open --> closed-accepted
    • Group: --> Unstable (example)

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks