Re: [exim] handling nulls in SQL lookups

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Jakob Hirsch
Data:  
Para: 'Exim-users'
Asunto: Re: [exim] handling nulls in SQL lookups
Quoting Ian P. Christian:

>           set acl_m3  = ${lookup sqlite {SQLITE_DB SPAM_COUNT}{$value}}
> However, this will obviously return nothing if the host has never mailed
> before, and the 'Spam total' reports as NULL.


set acl_m3 = ${lookup sqlite {SQLITE_DB SPAM_COUNT}{$value}{0}}

Will return 0 if the lookup returns nothing.

> btw - exim seems to do NO error reporting with sqlite problems - if the
> database file is invalid, if the permissions are wrong, or if the query
> is wrong, there are no errors reported - I'll have to bug about this at
> some point.


uh, that's quite bad, depending on what you are doing with it.