Re: [exim] Problem with lookup and $header_from:

Top Page
Delete this message
Reply to this message
Author: Rolf Unger
Date:  
To: exim-users
Subject: Re: [exim] Problem with lookup and $header_from:
On Thu, 21 Jan 2010 after 18 h, Rolf Unger wrote:
> Hi list,
>
> [ ... ]
>
> So I replace $sender_address with ${address:$header_from:} to:
>
>   client_send = "${lookup{${address:$header_from:}}\
>       lsearch{CONFDIR/plain_passwd}{$value}}"

>
> But I get an error:
>
> expansion of "${lookup{${address" failed in plain authenticator:
> "${address" is not a known operator (or a } is missing in a variable
> reference)
>
> [ ... ]
>
> Strange enough the log message looks like the evaluation processor
> doesn't see the complete line but instead stops at the first colon.
> So I thought the colon is the problem and tried to make it work without:
>
>   client_send = "${lookup{$header_from}\
>         lsearch{CONFDIR/plain_passwd}{$value}}"

>
> [ ... ]
>
> The strange thing is that I can run the lookup in test mode and I get the
> correct login/password combination from the file:
>
> $ exim4 -bem test.mail \
> '${lookup{${address:$header_from:}}lsearch{/etc/exim4/plain_passwd}{$value}}'
>
> It seems that I need to escape the colon in the configuration file. Or
> at least if I am in the authentication context.
>
> Any ideas? Thanks in advance, Rolf.
>


Okay,

after reading again the documentation on the plain authentication I learned
that the "client_send" directive expects a (colon separated) list. The
string after the equal sign is first splitted into list elements before
the string evaluation happens.
Quoting the colons works in the same ways as for IPv6 addresses: I just
need to double the colons:

client_send = "${lookup{${address::$header_from::}}..."

Rolf.
--
() ascii ribbon campaign - against html e-mail
/\ www.asciiribbon.org - against proprietary attachments