Re: [Exim] lookup default value

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Nico Erfurth
Dátum:  
Címzett: Víctor Romero
CC: exim-users
Tárgy: Re: [Exim] lookup default value
Víctor Romero wrote:
>
> Actually I have made my own exim,mysql,tpop3d based virtual domain
> configuration, but have a little problem here:
>
>     I have a table "users" with a field "quota", and a table "domains" with a
> field "quota", users.quota should be used unless it doenst exists, so
> domain.quota should be used ( domain.quota means "default quota of each user
> of this domain if its not specified  in the user row" ); so I wrote something
> like this,

>
>     ${lookup mysql{select user.quota from users where blah blah}{$value} \
>     {${lookup mysql{select user.quota from users where blah blah}{$value}{30M}}}

                                ^^^^ you surely meant domain.quota here,
                                     do you?


Try this
${lookup mysql{select user.quota from users where not ISNULL(quota) \
and blabla}{$value} \
{${lookup mysql{select domain.quota from domain where not \
ISNULL(quota) and blah blah}{$value}{30M}}}



>     But the fist query alwais return at least a "", so theres no error and the
> default value its not returned instead ""


Yes, because it returns a value/row.



ciao