Re: [exim] Preserving the value of an ACL variable - but wha…

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Phil Pennock
Data:  
Para: Ron White
CC: exim-users
Asunto: Re: [exim] Preserving the value of an ACL variable - but what is the right way?
On 2010-05-06 at 15:09 +0100, Ron White wrote:
> But is there a more simple way to say 'if this variable has the value of
> 1, set it to 2 - otherwise leave the existing value.


Test the value first, before the set, with a separate condition line.


  warn  domains = .... or whatever
    condition = more whatever
        condition = ${if =={$acl_m_foo}{1}}
    set acl_m_foo = 2


Whether you prefer those separate last two lines or just:
        set acl_m_foo = ${if =={$acl_m_foo}{1} {2}{$acl_m_foo}}
is largely a matter of taste, rather than there being a "right" way.


I would suggest that using magic numbers is probably not a right way.
Using more descriptive values which you can test against is
self-documenting, or use separate variables rather than overloading one.

-Phil