[exim] Preserving the value of an ACL variable - but what is…

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Ron White
Date:  
À: exim-users
Sujet: [exim] Preserving the value of an ACL variable - but what is the right way?
A little playing around and I've noticed that if I have an acl_variable
with an value (say a simple short integer of '4') if I run a conditional
set command preserving the original value requires a bit of thought.

This will set the value of $acl_m_userouter to 2, if it's currently '1'
else set it to empty (overwriting any value it already had)
set acl_m_userouter = ${if == {$acl_m_userouter}{1}{2}}

This will set the value of $acl_m_userouter to 2, if it's currently '1'
else preserve current value:
set acl_m_oldrouter = $acl_m_userouter
set acl_m_userouter = ${if ==
{$acl_m_userouter}{1}{3}{$acl_m_oldrouter}}      


This will set the value of $acl_m_userouter to 2, if it's currently '1'
else preserve current value:
set acl_m_userouter = ${if ==
{$acl_m_userouter}{1}{2}{$acl_m_userouter}}

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.

The methods above work, but I'm wondering if there is a
shortcut/placeholder for the current value of the variable?