Adam KOSA wrote:
> Currently the pattern looks like this:
> 
>    deny  hosts           = \N^.*(adsl|pool)\..*$\N : \N^.*-dyn.*\..*$\N 
> : \N^.*pool.*$\N : \N^.*[0-9]+-[0-9]+.*$\N

If you are interested in placing this in SQL, you can use something like:
select 1 from <table> where '$sender_hostname' RLIKE <column>

Just make sure you use REGEXPs that the SQL server expects.  MySQL doesn't
support the full range of extended regexps.

> and i consider this setting better, then setting /etc/hosts.deny to 
> block countries (.pl, .kr, .tw etc).  I realise that i may be producing 
> FPs, but having countries excluded from SMTP may have produced even more 
> FPs.
> 
> Until yesterday i was using a cidr-based blocking in exim (hostlist 
> host_reject_rcpt = ${lookup mysql {SELECT concat(host, ' : ') from 
> host_reject order by host}}) but the list got out of hand:
> 
> mysql> select count(*) from host_reject;
> +----------+
> | count(*) |
> +----------+
> |     1072 |
> +----------+
> 
> this is way too much.  so i decided to block by name, deal with hosts 
> that have no revdns and transform the host_reject_rcpt list to an 
> exception list.

You can also have mysql do the CIDR matching for you.  There is a function
to convert an IP into a 32bit int and you can use bitwise AND to mask the IP
and check against the data in the column.

I used to have exim retrieve all rows and convert a new line into a :
After a while, it gets to a point (as you already know) where the list is
too big.

-- 
 Lab tests show that use of micro$oft causes cancer in lab animals
 Got Gas???

-- 
## List details at http://www.exim.org/mailman/listinfo/exim-users 
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/

Reply via email to