Re: [Exim] mysql lookups

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Christoph Kliemt
Data:  
Para: exim-users
Asunto: Re: [Exim] mysql lookups
Konrad Michels <konrad@???> writes:

[...]

> So, what I've got is the following in routers:
>
> surfkitchen_com_aliases:
>   driver = redirect
>   allow_fail
>   allow_defer
>   data = ${lookup mysql{SELECT address FROM aliases \
>        where alias='${quote_mysql:$local_part}'}}


[...]

> and then in Transports I've got:
>
> surfkitchen_com_local_delivery:
>   driver = appendfile
>   directory = ${lookup mysql{SELECT maildir FROM smtp \
>                 WHERE username='${quote_mysql:$local_part}@$domain'}}
>   maildir_format


[...]

> Problem is that for
> non-existant users, instead of bombing out at SMTP time and refusing the
> message as it would with "check_local_user" in a normal delivery, it
> "accepts" the message but in the logs I get:
>
> appendfile: file or directory name "" is not absolute
>
> which makes sense, since the database query is returning a blank.


A blank? sounds strange...

> So my question is how to get it to refuse the mail at SMTP time when the
> database lookup returns a blank result?


Make the database return ":fail:" in such a case, or compare the result
to a blank and replace it with ":fail:" if the comparison is true.

hth christoph