Re: [exim] Expansion weirdness

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Jasen Betts
Dátum:  
Címzett: exim-users
Tárgy: Re: [exim] Expansion weirdness
On 2016-06-01, Sven Eschenberg <sven@???> wrote:
> Hi list,
>
> Maybe I got something fundamentally wrong regarding expansions, but I am
> seeing a behavior I consider a little inconsistent.
>
> exim -oMi 127.0.0.1 -be '${extract{$received_ip_address}{10.0.0.1=hosta
> 127.0.0.1=local4 ::1=local6}{$value}fail}'
> local4
>
> (expected)
>
> exim -oMi 127.0.0.2 -be '${extract{$received_ip_address}{10.0.0.1=hosta
> 127.0.0.1=local4 ::1=local6}{$value}fail}'
> Failed: "extract" failed and "fail" requested
>
> (expected)
>
> exim -be '${extract{$received_ip_address}{10.0.0.1=hosta
> 127.0.0.1=local4 ::1=local6}{$value}fail}'
> Failed: first argument of "extract" must not be empty
>
> That was somewhat expected, the docs say the key must not consist of all
> digits. There's no hint on what happens if the key is empty.


{} contains nothing but digits
{} contains no digits


easist fix is to pad the key with a letter

/usr/sbin/exim -be '${extract{X$received_ip_address}{X10.0.0.1=hosta
X127.0.0.1=local4 X::1=local6}{$value}fail}'

> exim -be '${if
> def:received_ip_address{${extract{$received_ip_address}{10.0.0.1=hosta
> 127.0.0.1=local4 ::1=local6}{$value}fail}}fail}'
> Failed: missing or misplaced { or }


that's a bug which has been fixed now.


It's fixed in debian 8.4 but present in debian 8.3

I'm not sure which release your ubuntu is based on


--
\_(ツ)_