Re: [Exim] Problem with quote_mysql

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Björn Metzdorf
日付:  
To: Philip Hazel
CC: exim-users
題目: Re: [Exim] Problem with quote_mysql
Hi,

> So, your string is being expanded twice, and the second expansion is
> taking away the backslash. What you need to do is to use
>
> '\${quote_mysql:$local_part}'
>
> so that the quoting happens at the lower level.


That doesn't seem to work.

MYSQL_LOCAL_DOMAINS = SELECT DISTINCT MYSQL_DOMAINFIELD FROM MYSQL_AUTHTABLE
WHERE MYSQL_USERNAMEFIELD = '\${quote_mysql:$local_part}' AND
MYSQL_DOMAINFIELD = '${quote_mysql:$domain}' AND MYSQL_ACTIVEFIELD = 'yes'

gives me a

failed to expand mysql query SELECT DISTINCT domain FROM mailaddr WHERE
username = '${quote_mysql: "${quote_mysql" is not a known operator (or a }
is missing in a variable reference)

Quick workaround for me is double-quoting:

MYSQL_LOCAL_DOMAINS = SELECT DISTINCT MYSQL_DOMAINFIELD FROM MYSQL_AUTHTABLE
WHERE MYSQL_USERNAMEFIELD = '${quote_mysql:${quote_mysql:$local_part}}' AND
MYSQL_DOMAINFIELD = '${quote_mysql:$domain}' AND MYSQL_ACTIVEFIELD = 'yes'

Any better solutions?

cya
Bjoern Metzdorf