Re: [Exim] Spews list filtering

Góra strony
Delete this message
Reply to this message
Autor: Nico Erfurth
Data:  
Dla: konrad
CC: exim-users
Temat: Re: [Exim] Spews list filtering
Konrad Michels wrote:
> Hi again folks
> Seems to be "lets fix these spammers" day today for me! I've sucked
> down the spews.org list of ip addresses, used awk and grep to produce a
> list of only ip addresses in a flat text file, and quite happily got
> exim to do lookups agains the list with the following in the configure
> file:
>
> deny  hosts = /usr/local/exim/spews_list2
>         message = Rejected - host IP address is in the spews list as a
> spammer domain

>
> This definitely works well, which I did by adding my home IP to the list
> and attempting a connect from home - got the rejection message back and
> that was the end of that!
>
> However, in the interests of efficiency, it would seem to make more
> sense to bung these IP addresses in a mysql database, and do the lookups
> against it. Can anyone assist with the syntax for exim 4.12 to do a
> lookup against a database for these ip addresses instead of looking up
> against the flat text file?


How does the list look like?
I don't know what you downloaded :)

Instead of using mysql, you should go for some fast filebased database
for this, like cdb or the default dbm.

If you have entries like
10.0.0.0/24
10.0.1.0/24

you can use
hosts = net24-cdb;/usr/local/exim/spews_list2.cdb

if you have mixed netsizes like

10.0.0.0/24
10.1.0.0/20

you can list a lookup for each size

hosts = net24-cdb;/usr/local/exim/spews_list2.cdb : \
         net20-cdb;/usr/local/exim/spews_list2.cdb


for single ips, just use
hosts = cdb;/usr/local/exim/spews_list2.cdb

I think this should show you the right way :)

Nico

P.S. Can you show me/us which files you downloaded and how you converted
them? I want to put together a small "Have fun with spammers and exim"-site.