Re: [Exim] [patch] A few minor fixes/improvements.

Top Page
Delete this message
Reply to this message
Author: Nico Erfurth
Date:  
To: Alexander V Alekseev
CC: exim-users
Subject: Re: [Exim] [patch] A few minor fixes/improvements.
Alexander V Alekseev wrote:
> Hello! On Fri, 18 Oct 2002, Nico Erfurth wrote:
>
>
>> Alexander V Alekseev wrote:
>>
>>> Hello!
>>>
>>> Writing my own lookup type I found out several features, which
>>> don't help developing. So, I made a few small patches:
>>>
>>> 1. It's impossible to have '}' symbols in lookup keys. But,
>>> sometimes it's quite usefull. Please, consider a patch:
>>
>> This patch is not THAT good, and not needed at all you can use
>> brackets, if you escape them, like this ${lookup
>> {$local_part\}$domain} lsearch {/etc/exim/strangelist}}
>>
>> Your patch could break things, see this example
>>
>> ${lookup {$local_part{$domain} lsearch {/etc/exim/strangelist}}
>
> But it's syntaxically incorrect! You have 4 '{' and 3 '}' ! Don't you
> consider this a bug, not a feature?!


If you want to be syntactically correct, use \{ in this case ;), i'm
just saying what's possible with the current version, and what your
patch could break.

>> This will work with an unpatched exim, but NOT with your version,
>> so if
>
> This shouldn't work at all!!!


Why not?
This isn't C, this isn't perl, this is exim's config language, what's
syntactically correct, and what's not, is decided by Phil, not by you,
you shouldn't think in Terms of a Programming Language

>
>> you need the closing bracket, just use \} or, if you use a string
>> that should not be evaluated at all, you can enclose it with \N.
>
> If I need unbalanced {}, I would use \} . But you advise to use
> escapes when having balanced syntaxis, and unescaped {} when
> unbalanced! Don't you think, it's wrong?


I don't "advise" this, i told you what your patch will break!
if you want, you can use
${lookup {$local_part\{$domain} lsearch {/etc/exim/strangelist}}
or
${lookup {\Ngh}{}{}}{}}}}}}{{{{{}{}{\N} lsearch {/etc/exim/strangelist}}
or
${lookup {gh\}\{\}\{\}\}\{\}\}\}\}\}\}\{\{\{\{\{\}\{\}\{} lsearch
{/etc/exim/strangelist}}

>> Before patching, read the sources a little bit more careful ;) In
>> fact, the escaping code is just 25 lines before your patched lines
>> ;)
>
> I've read the code. I've read the documentation. The code doesn't
> follow the documentation. I've patched the code.


Doesn't seem so, does the docs say anything about balanced {}?
I don't think so.

Again, we are talking about exim's configuration-language, not about any
real programming-language, exim is not a Compiler, but a MTA.

ciao