Re: [Exim] mysql expansion

Góra strony
Delete this message
Reply to this message
Autor: Nico Erfurth
Data:  
Dla: Artem S. Tashkinov
CC: exim-users@exim.org
Temat: Re: [Exim] mysql expansion
On Sat, 25 Jan 2003, Artem S. Tashkinov wrote:

> Some people have already told me that this problem was discussed on this
> mailing list long before but I couldn't find that message. I have this
> router:
>
> mysql_user:
>    driver = accept
>    condition = \
>     ${if eq{} \
>       { ${lookup mysql {SELECT maildir FROM users \
>           WHERE id='${local_part}@${domain}'}} \
>       } \
>       {no}{yes} \
>     }
> #  retry_use_local_part
>    transport=mysql_delivery

>
> the problem is that exim thinks that condition is true even if mysql
> returns empty string (that actually means user doesn't exist). How
> should I change the condition in order exim treats mysql answer properly?


Who told you that this is wrong?
your ${if eq" will catch the case of a non existing user, but you can make
this easier

condition = ${lookup mysql {YOUR LOOKUP}{yes}{no}}

This will return yes if the lookup returned any value, or no if not.

Nico