Re: [exim] domain_match, local_domain, sql

Pàgina inicial
Delete this message
Reply to this message
Autor: Tony Finch
Data:  
A: Marcin Gryszkalis
CC: exim users
Assumpte: Re: [exim] domain_match, local_domain, sql
On Fri, 18 Jul 2008, Marcin Gryszkalis wrote:
>
> domainlist local_domains = ${lookup mysql {SELECT DISTINCT domain FROM user
> WHERE domain='${quote_mysql:$domain}' UNION SELECT DISTINCT domain FROM alias
> WHERE domain='${quote_mysql:$domain}'}}
>
> and it seems to work well in other places.
> in rcpt acl I put following rule (taken from struction.de tutorial)
>
>     condition = ${if match_domain{$sender_address_domain}{+local_domains}}

>
> and it didn't triggered when it should. I changed condition - included mysql
> lookup:
>
>     condition = ${lookup mysql {select if(count(*)>0,'yes','no')  as c from
> (SELECT DISTINCT domain FROM user WHERE domain='${quote_mysql:
> $sender_address_domain}' UNION SELECT DISTINCT domain FROM
>  alias WHERE domain='${quote_mysql:$sender_address_domain}') as domains;}
> {$value}}

>
> and now it works - but sitll I'd love to know why it doesn't with first
> condition.
>
> looking into mysql logs it looks like fist condition matched against
> destination domain, not the sender one (is that possible?)


Because $domain in the local_domains list definition is the recipient
domain.

Tony.
--
<fanf@???> <dot@???> http://dotat.at/ ${sg{\N${sg{\
N\}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}\
\N}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}