Re: [Exim] Spam filter with MySQL and .forward filter file

Top Page
Delete this message
Reply to this message
Author: Konrad Michels
Date:  
To: mike
CC: exim-users
Subject: Re: [Exim] Spam filter with MySQL and .forward filter file
As far as I recall, you have to compile in mysql lookup support at
compile time - there are instructions in the installation documents for
this.

On Fri, 2003-06-06 at 09:55, Mike Kenyon wrote:
> I've decided in order to defeat the spam problem to redirect all mail
> from people who aren't in my address book into a folder
> called "Spam". This isn't particularly intelligent but seems to work.
> I've created a cron job that distills my Mutt address book into a
> simple list of addresses which are then searched in my .forward by
> the following:
>
> # Exim filter
> if not error_message then
>   if ${lookup{$sender_address}lsearch*@{$home/.addressbook}{OK}{SPAM}} is SPAM
>   then
>     save Mail/Spam
>   endif
> endif

>
> Which works great.
>
> *But* I also use SquirrelMail as well as Mutt (and I'm currently
> evaluating Twiggi) and both store the contacts in a MySQL table (this
> is optional with SquirrelMail but seemed like a good idea at the
> time). What I want to is also have the filter search the relevant
> table for addresses, something like:
>
> if ${lookup mysql {select email from address_table where owner = 'mike' and
> email = '$sender_address'}{OK}{SPAM}} is SPAM
> then
> save Mail/Spam
> endif
>
> (Note that the address table in SquirrelMail is called "address" and
> not "address_table".)
>
> This doesn't work, as Exim doesn't seem to recognise "mysql" as a
> lookup type (at least in a filter) OR I've got the syntax completely
> wrong.
>
> I have digested the filter manual, the spec and searched this list
> but to no avail (so far).
>
>
>
> --
> Mike Kenyon
>
>
> --
>
> ## List details at http://www.exim.org/mailman/listinfo/exim-users Exim details at http://www.exim.org/ ##

--
===============
ADVANCE NOTICE:
NB!!! Please note that Konrad will be on leave (and therefore not very
contactable or useful even when you can contact him) from Friday,
June 13th 2003 until June 29th 2003, both dates inclusive. I will be
back in the office on June 30th 2003.

***********************************************************************
*
* Konrad Michels
* System Administrator
* Surfkitchen Limited
* Abbey House
* 1650 Arlington Business Park
* Theale
* RG7 4SA
* United Kingdom
* Tel: +44 118 929 8079
*
***********************************************************************