Re: [exim] help with condition match

Top Page
Delete this message
Reply to this message
Author: Todd Lyons
Date:  
To: Jim Pazarena
CC: exim-users
Subject: Re: [exim] help with condition match
On Wed, Jun 6, 2012 at 10:32 PM, Jim Pazarena <exim@???> wrote:
>
> I created the following:
>
> deny    message         = We don't want your spam! Go away!
>        log_message     = blacklisted at ~pool-ukrtel.net reject
>        condition       =                                       \
>          ${if                                                  \
>           {match{${lc:$sender_host_name}}{.pool.ukrtel.net}}   \
>           {true}{false}}


Yeah, if you see anything from ukrtel, it's spam. Always.

> <admin@???>: failed to expand ACL string "${if
>                      {
> match{${lc:$sender_host_name}}{.pool.ukrtel.net}}       {true}{false}}":
> condition name expected, but found "{match{${lc:$sen"
>
> I am slightly confused, and suggestions would be most appreciated.


The expansion testing mode of exim is most useful for experimenting with syntax.

CentOS58[root@ivwm41 ~]# exim -be
> ${if {match{${lc:$sender_host_name}}{.pool.ukrtel.net}} {true}{false}}

Failed: condition name expected, but found "{match{${lc:$sen"
> ${if match{${lc:$sender_host_name}}{.pool.ukrtel.net} {true}{false}}

false
>


The syntax of the macro language is very specific and picky. In your
case, you put extra {} around the match{} statement. It is "match{}"
not "{match{}}".

...Todd
--
Always code as if the guy who ends up maintaining your code will be a
violent psychopath who knows where you live. -- Martin Golding