On 4 Nov 2004 at 11:11, Jim Pazarena wrote about
"[exim] ACL with condition match":
| I am unclear as to the matching performed in my ACL condition.
| I want to reject any incoming which have a $sender_helo_name
| that "contains" *adsl*ameritech, which invariably are spammers
| with their direct adsl connections whom are not going thru their
| ISP's mail server.
Are they actually sending such strings in the HELO/EHLO command?
Seems more likely you want to test $sender_host_name.
| I wrote:
| deny message = We don't want your spam! Go away!
| log_message = adsl-ameritech reject
| condition = \
| ${if and { \
| {match{$lc:$sender_helo_name}}{adsl}} \
| {match{$lc:$sender_helo_name}}{ameritech}} \
| }{true}{false}}
|
| do I need to have a match of {*adsl*} {*ameritech*} ?
No, with match the pattern in <string2> will match any substring of
<string1>, unless it starts with '^' and/or ends with '$'.
Also, '*' means "match zero or more of the preceding pattern", not
"match zero or more characters". So you'd need ".*" to match zero or
more of any character.
You can use pcretest to test your patterns and see if they do what
you expect.
| or can I create simply:
| ${if {match{$lc:$sender_helo_name}{*adsl*ameritech*}}{true}{false}}
${if match{$lc:$sender_helo_name}{adsl.*ameritech}{true}{false}}
but again, I think you probably want
${if match{$lc:$sender_host_name}{adsl.*ameritech}{true}{false}}
- Fred