Re: [exim] mysql expansion

Top Page
Delete this message
Reply to this message
Author: Mike Cardwell
Date:  
To: exim-users
Subject: Re: [exim] mysql expansion
* on the Mon, Feb 26, 2007 at 03:37:09PM +0000, #Ronan McGlue wrote:

> My redirect router looks like
>
>
>    data = ${lookup mysql{select mailbox,host from routing where alias = 
> '${quote_mysql:$local_part}'}}

>
> according to the spec this will return
>
> mailbox=testuser host=testhost.qub.ac.uk
>
> how do i change this to be mailbox@host ?


Do it in the query it's self:

data = ${lookup mysql{select concat(mailbox,'@',host) from routing where alias = '${quote_mysql:$local_part}'}}

That will return "testuser@???" rather than
"mailbox=testuser host=testhost.qub.ac.uk" as the result is a single
value, rather than a list.

Mike