whitelist

Andrew Norman andy at norman.cx
Sun Feb 1 14:21:47 CET 2004


> On Thu, 11 Dec 2003, Jordi Marine wrote:
>
>> I think actually is not posible to add a whitelist to bogofitler, will
>> be it posible in future versions??
>
> Assuming you're launching bogofilter from maildrop (or procmail), it's
> easy to prevent bogofilter execution for some addresses. Maildrop
> example:
>
> # whitelist info at networksolutions.com
> if (/^From:[:space:]*!.*/)
>   FROMADDR=getaddr($MATCH2)
>
> if ($FROMADDR =~ /^info at networksolutions\.com$/)
>   to $DEFAULT
>
> # run bogofilter, stuffing spam into Mail/spam-bf
> xfilter "bogofilter -e -p -l"
> if (/^X-Bogosity: Yes, tests=bogofilter/)
>   to "Mail/spam-bf"

And it procmail you can do something like:

--------------------------------------------
# whitelist, the addresses in $HOME/whitelist are accepted
# into the WhitelistBox folder and passed to bogofilter as not being spam
:0
* ? formail -x"From" -x"From:" -x"Sender:" \
    -x"Reply-To:" -x"Return-Path:" -x"To:" \
    | egrep -is -f $HOME/whitelist
{
        :0wc
        | bogofilter -n

        :0:
        WhitelistBox
}

# blacklist, the addresses in $HOME/blacklist are accepted
# into the BlacklistBox folder and passed to bogofilter as being spam
:0
* ? formail -x"From" -x"From:" -x"Sender:" \
    -x"Reply-To:" -x"Return-Path:" -x"To:" \
    | egrep -is -f $HOME/blacklist
{
        :0wc
        | bogofilter -s

        :0:
        BlacklistBox
}
-------------------------------------------------

After that I have a bunch of filters that place specific mailing lists in
their folders and then everything else gets passed of to bogofilter to do
its magic.

The blacklist and whilelist files have just an address or domain on each
line (making use of wildcards to match domains) e.g.:

user at domain.com
user at domain.co.uk
.*reallybaddomain.com

P.S. I'm using a really old build of bogofilter at the moment, so the
command line flags have probably changed by now (or changed and changed
back again if I'm lucky)

-- 
Andy Norman - andy at norman.cx
http://www.norman.cx/






More information about the Bogofilter mailing list