Re: [Exim] IF syntax - confused

Top Page
Delete this message
Reply to this message
Author: Greg Ward
Date:  
To: exim-users
Subject: Re: [Exim] IF syntax - confused
On 30 November 2001, Marc Perkel said:
> I want to do an if conditional in a filter where I want to determine if
> "string" is in a file that contains a list of prohibited email address -
> like this:
>
> savebig@*
> joe@???
>
> How do I write that conditional?


If all you want to do is *reject* mail from those senders, you don't
need a filter. You just need the sender_reject directive. Here's how I
do it: in exim.conf, I have

# Manual spam-blocking: any address matching a patten listed in
# /etc/exim/spammers is blocked from sending mail to us.
sender_reject = /etc/exim/spammers

And /etc/exim/spammers is this:

# See section 7.16 of the Exim spec for rules on the patterns
# in this file.
^chris@.*wafer\.com$
sales@???
trafficmagnet.net
powerhiring.com
megawebservers.com
^FreeEmailSoftware\d*@yahoo\.com

Note that the format of this file is at once simple and powerful. RTFM
for details.

If you really do want to do this in your filter -- eg. to send a custom
bounce message or do custom logging -- then I can't help you. You could
do an lsearch lookup on the file, but then you lose all the nifty
pattern-matching capabilities of an address-list file.

        Greg
-- 
Greg Ward - software developer                gward@???
MEMS Exchange                            http://www.mems-exchange.org