[Exim] lookup default value

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Víctor Romero
Fecha:  
A: exim-users
Asunto: [Exim] lookup default value

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}}}


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


    Im pretty sure it can be fixed with the "if" directive but not pretty sure
how to do without querying the same query two times.


    Also can be fixed separating the "quote" field of the user table into another
table so user a natural join if it doenst exits it throws an error, but i
think its no adequate


    Thanks in advance