Re: [Exim] Router condition

Góra strony
Delete this message
Reply to this message
Autor: Nico Erfurth
Data:  
Dla: exim-users
CC: Philip Hazel
Temat: Re: [Exim] Router condition
Philip Hazel wrote:

> The string expander is slightly clever in not doing things that don't
> need to be done, but not clever enough to spot this one. I have made a
> note to see if I can teach it to do better. However, is is now too late
> for the next release.


I had some time, so here is the patch ;)

http://www.perlgolf.de/exim-4.31-smarter.patch

A more readable patch, that misses the changed indenting in
find_variable, is here:
http://www.perlgolf.de/exim-4.31-smarter_noindent.patch

It also fixes a small bug in the def-condition, def: never handled $bh_*
and $bheader_*.

I did some rough tests, and it seems to work fine now. When the expander
is in skipping mode, find_variable returns "" if the variable is found.
I first wanted to use exists_only, but that would break the current
behaviour in this case: ${if def:sender_host_name{1}{0}}

Nico