Re: [Exim] Selectively applying rbl

Top Page
Delete this message
Reply to this message
Author: Torstein Tauno Svendsen
Date:  
To: exim-users
Old-Topics: Re: [Exim] Selectively applying rbl
Subject: Re: [Exim] Selectively applying rbl
Philip Hazel <ph10@???> writes:

> On Fri, 22 Mar 2002, Steve Drees wrote:
>
>> I would like to allow our customers to opt-in to rbl filtering of email.
>>
>> Has anybody done this?
>>
>> My initial plan is to use the /warn directive and give them directions to
>> add a line to .forward to drop messages with the warning in /dev/null. Do
>> you think this will work? Is there a better way?
>
> The ACL facilities of Exim 4 were designed to make this sort of thing
> much easier than in Exim 3. You would just have to put something like
> this in the ACL
>
>      deny   recipients = cdb;/etc/opt-in-users.cdb
>             dnslists = blackhole.mail-abuse.org

>
> where the list of opt-in users is in the cdb file. (Or use DBM, or a
> database, or whatever.) Then recipients who have opted in will be
> rejected at SMTP time from RBL hosts.


I wanted per-user blocking in the SMTP dialogue on an exim 3 system
with "traditional" unix users (you know, the kind that understands
instructions like "touch file so-and-so in your $HOME directory :),
and this is what I ended up with. The check_ordb director must
obviously be placed before the normal director for users, and the
/home/$local_part/ is a bit simplistic:

USER_RBL = ${extract{4}{.}{$sender_host_address}}.\
${extract{3}{.}{$sender_host_address}}.\
${extract{2}{.}{$sender_host_address}}.\
${extract{1}{.}{$sender_host_address}}.\
relays.ordb.org

check_ordb:
        driver = smartuser
        condition = ${if exists {/home/$local_part/.delete-spam}{${lookup dnsdb{USER_RBL}\
{$value}{0}}}{0}}
        new_address = :fail: This user is blocking hosts in the ordb database: \
${lookup dnsdb{USER_RBL}{$value}{1}}



--
Torstein (Heh, my first post to exim-users :)