Bypass spam scan based on header

Jim Flowers jflowers at
Fri Aug 11 16:36:06 IST 2006

My solution was to add a small hack to the CreateList subroutine (line 112) in to add a list of names to the whitelist hash just before
it returns.  As written, these email addresses are whitelisted globally (for
all users) in MailScanner.  The same technique could be used for a per-domain
or per-user basis with a bit more code.

if ($type eq 'whitelist') {
    my $fh = new FileHandle;
    my $filename = "/usr/local/share/assp/whitelist";
    $fh->open("< $filename") or die "Cannot open config file $filename, $!";
    while(<$fh>) {
        next if /^$/;
        if(/^([^@]+@[^@]+\.[A-Za-z]{2,4}).*$/) { # validate and strip off
trailing digits
            $BlackWhite->{'default'}{$1} = 1;
    close $fh;

In this case the names in /usr/local/share/assp/whitelist are of the form
username at domain.tld and also have a trailing ^B[0-9]* that is removed by the
regexp.  This expression may have to be modified to suit the file format.

This subroutine is run on startup and at least every 15 minutes.

Jim Flowers <jflowers at>

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

More information about the MailScanner mailing list