Re: [EXIM] Exim-1.92: Macro expansion bug with `domain=' in …

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: Philip Hazel
Data:  
Para: Harald Meland, Jim Knoble
CC: Exim Users
Assunto: Re: [EXIM] Exim-1.92: Macro expansion bug with `domain=' in routers
On 13 Jul 1998, Harald Meland wrote:

> My guess: I think it is a bug that just because you happened to define
> a macro with a name consisting of a previously defined macro and some
> suffix, it's always the first macro that gets expanded. I.e.,
>
> "SMART_DOMAINS_EXCEPT" => "*_EXCEPT"


Thanks for spotting that one. You are quite right.

> Once a macro is defined, all subsequent lines in the file are scanned
> for the macro name; if there are several macros, the line is scanned
> for each in turn, in the order in which they are defined.


Macros in Exim are simple macros, *very simple* macros. I should,
however, have pointed out this effect in the documentation.

I wanted to keep it simple, because Exim is forever reading its
configuration file, which has got much more complicated that I ever
envisaged it would.

On Sun, 12 Jul 1998, Jim Knoble wrote:

> Ugh. I tried s/SMART_DOMAINS_EXCEPT/SMART_EXCEPT_DOMAINS/g, and it
> works. *Definitely* a bug. I didn't even consider the possibility that
> a macro containing the the name of another macro might be a problem.


Agreed it is a nasty gotcha, but I don't know how to fix it. Somebody is
probably relying on the way it works now.

> I very much like the idea of ${MACRO_NAME}.


Global variables would work only in expanded strings. Not all options in
Exim are expanded. (Some are "basic" settings that get used in other
expansions. If everything were expanded there would be chicken and egg
problems, I think.)

-- 
Philip Hazel                   University Computing Service,
P.Hazel@???          New Museums Site, Cambridge CB2 3QG,
ph10@??? (sic)       England.  Phone: +44 1223 334714



--
*** Exim information can be found at http://www.exim.org/ ***