[exim] MySQL table lookup..

Góra strony
Delete this message
Reply to this message
Autor: Coax
Data:  
Dla: exim-users
Temat: [exim] MySQL table lookup..
I have the existing scenario..

I have a database with this schema:

mysql> describe global_blacklist;
+---------+-------------+------+-----+---------+-------+
| Field   | Type        | Null | Key | Default | Extra |

+---------+-------------+------+-----+---------+-------+
| address | varchar(15) | YES  | MUL | NULL    |       |
| comment | varchar(50) | YES  |     | NULL    |       |

+---------+-------------+------+-----+---------+-------+
2 rows in set (0.00 sec)


A sample of data might be:

INSERT into global_blacklist VALUES ('127.0.0.1', 'Spammer!');

I have MySQL acl that does the following on connect:

deny message = $sender_host_address found in local blacklist..
hosts           = mysql;select address from global_blacklist where \
                address = '$sender_host_address'




Problem is, I have to blacklist each individual IP address i'd like
blacklisted - in order for this to work.

I'd like to store '127.0.0' in the database, and have the acl strip the
trailing '.' and following numbers located in $sender_host_address - and
query the database for THAT. (i.e. i'd like to blacklist a whole subnet!)

Ideas?

Chad Schwartz