[exim] MySQL - Blocking senders at RCPT time

Top Page
Delete this message
Reply to this message
Author: thunder
Date:  
To: exim-users
Subject: [exim] MySQL - Blocking senders at RCPT time
Hi All,

I was wondering whether anyone could help me with getting some
configuration to work. Currently I have the following in my exim
configuration, and I am using it for manually blocking addresses (its
handy where someone is dumb enough to keep using the same 'from'
address, its even been handy for blocking various new domain TLD's that
spammers like to use of late.

Here's what I have in my configuration, which just reads from a file:

drop    senders = /usr/local/etc/eximreject.lst
         message = Not acceptable - You are blacklisted


The above has worked a treat for years. But I would like to move things
to a database instead so I can have more things centralised.

I have imported the contents of this file into an SQL table I made:

MariaDB [mail]> describe bannedsenders;
+--------+---------------------+------+-----+---------+----------------+
| Field  | Type                | Null | Key | Default | Extra          |

+--------+---------------------+------+-----+---------+----------------+
| id     | tinyint(3) unsigned | NO   | PRI | NULL    | auto_increment |
| sender | tinytext            | NO   |     | NULL    |                |

+--------+---------------------+------+-----+---------+----------------+

The 'sender' column contains the equivalent of what is in tne plain text
file, just addresses.

I had a read of the exim manual for MySQL lookups but there is obviously
something I don't get, since I cant get it to work. I made a futile
attempt which failed:

drop    senders = ${lookup mysql{select sender from mail.bannedsenders} 
{$value}fail}
         message = Not acceptable - You are blacklisted


Doesn't work. Any suggestions would be appreciated.

Thanks!
A.