Re: [Exim] bounce when SQL query fails?

Pàgina inicial
Delete this message
Reply to this message
Autor: Philip Hazel
Data:  
A: Mikael Gunnarsson
CC: exim-users
Assumpte: Re: [Exim] bounce when SQL query fails?
On Mon, 29 Apr 2002, Mikael Gunnarsson wrote:

> virtual_aliases:
>   driver = redirect
>   domains = mysql;select domain from mail where domain='$domain'
>   data = ${lookup mysql{select target from mail where \
>      (localpart='$local_part' or localpart='*') and domain='$domain' \
>       order by localpart desc limit 1}{$value}fail}
>   file_transport = virtual_delivery



> This works pretty well, except that when the router lookup fails, it

doesn't bounce the mail with a 'unknown local part' like I want it to,

That's because you have got "fail" in there. Remove that. In other
words, make "data" expand to an empty string when the lookup fails.
The router will then decline. Add no_more to stop further routers
running.


--
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.