Re: [exim] Block by Subject with Wildcard

Top Pagina
Delete this message
Reply to this message
Auteur: Matthias Waffenschmidt
Datum:  
Aan: Jess Mooers
CC: exim-users
Onderwerp: Re: [exim] Block by Subject with Wildcard
Hello,

On Mon, Oct 23, 2006 at 12:17:24PM -0500, Jess Mooers wrote:
> I have this code added to my configure file.
>
> deny      message = X-Blackhole: Yes
>       log_message = REJECTED - Subject in blocksubject list - $h_Subject
>         condition = ${if exists{/usr/local/exim/blocksubject.txt}\
>                     {${lookup{$h_Subject:}wildlsearch{/usr/local/exim/blocksubject.txt}{yes}{no}}}\
>                     {no}}

>
> My blocksubject.txt file has this in it:
>     *test987123

>
> It denies the message if this is the subject:
>     test987123
>     Atest987123

>     
> But not with these as subjects:
>     test987123B
>     Atest987123B

>     
> I tried to put an * at the end of th line too, but that allows all of the test emails through and denies none of the 4 above.
>
> Ideally, I would like to be able to say, if the word test987123 is anywhere in the subject, deny it. Any help would be so appreciated.


Have a look at the fine manual:

http://www.exim.org/exim-html-4.63/doc/html/spec_html/ch09.html#id2548356

An asterisk is only interpreted as a wildcard pattern at the beginning
of the expression. For more sophisticated search patterns you have to
use regular expressions.

E.g. this line in your file should deny mails with subjects containing
the substring 'test987123' :

^.*test987123

-- 
Gruss / Best regards   |  LF.net GmbH        |  fon +49 711 90074-411
Matthias Waffenschmidt |  Ruppmannstr. 27    |  fax +49 711 90074-33
mw@???              |  D-70565 Stuttgart  |  http://www.lf.net