Re: [Exim] error messagge

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: robert rotman
CC: exim-users
Subject: Re: [Exim] error messagge
On Mon, 29 Nov 1999, robert rotman wrote:

> mysql_user:
>    driver = smartuser
>    condition = ${lookup mysql{select domain from mail where
>                domain='${domain}' and username='${local_part}' and
>                is_alias='no'}{$value}fail}
>    transport = mysql_delivery

>
> it happens that some user make a mistake in the To: field
> (like 'user@??? - notice the "'")
>
> exim spools this mail and never write an errormessage back.
>
> this is the log:
>
> (1999-11-25 11:50:16 11qwSJ-0003vd-00 failed to expand condition"${lookup
> mysql{select domain from mail where domain='${domain}' and
> username='${local_part}' and is_alias='no'}{$value}fail}" for mysql_user
> director: lookup of "select domain from mail where domain='my_doma.in' and
> username=''my_username' and is_alias='no'" gave DEFER: MYSQL: query
> failed: You have an error in your SQL syntax near 'my_username' a
> nd is_alias='no'' at line 1)
>
>
> do you know any sollutions?


(a) Upgrade to Exim 3.10 if you haven't already.

(b) Make use of the new ${quote_mysql: operator to ensure that the data
in your SQL command is correctly quoted. So instead of

domain = '${domain}'

you can write

username = '${quote_msql:$local_part}'

and if somebody has 'user@??? the query will contain

username = '\'user'

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