Re: [exim] Expansion weirdness

Top Page
Delete this message
Reply to this message
Author: Jeremy Harris
Date:  
To: exim-users
Subject: Re: [exim] Expansion weirdness
On 01/06/16 14:39, Sven Eschenberg wrote:
> As far as I understand this the failure is already triggered during
> ${extract} which should be skipped since def:received_ip_address yields
> false. But maybe I am reading this wrong.


That's half-right.

> Looking at this variant with $if{ instead of ${extract I can see that
> the string of the expansion stops after the first fail and bracket, ie:
>
> expanding: ${if eq{10.0.0.1}{$received_ip_address}{hosta}fail}
>    result:
> skipping: result is not used

>
> whereas the string parsing seems to go wrong for the ${extract case ...
> since the string concludes with fail}}fail} where it should probably end
> at fail}?


No - the string output for "failed to expand" is the entire remaining
string at that point. Only the front has been trimmed, not the tail.

I suspect what happens here is that the "extract" parsing cannot tell
which extract variant you have, and picks the wrong one. It needs to
do parsing even though the result will be ignored in order to find
the end, to resume with the enclosing bit of expansion. And for the
form of extract it picked, it is not well-formed.

So the problem is the empty received_ip_address. Why not put the test
for that on a separate ACL condition= preceding this one?
--
Cheers,
Jeremy