[exim-dev] [Bug 474] ACL condition to unset a variable

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Roman Odaisky
Ημερομηνία:  
Προς: exim-dev
Αντικείμενο: [exim-dev] [Bug 474] ACL condition to unset a variable
------- You are receiving this mail because: -------
You are the QA contact for the bug.

http://bugs.exim.org/show_bug.cgi?id=474

Roman Odaisky <to.roma.from.eximbug@???> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |to.roma.from.eximbug@qwertty
                   |                            |.com





--- Comment #10 from Roman Odaisky <to.roma.from.eximbug@???> 2008-09-01 10:49:56 ---
Both proposed changes are quite important, especially isset.

In many cases one needs to distinguish between variables containing the empty
string and nonexistent variables. Of the predefined variables, $spam_bar comes
to mind: it can be empty for ham messages, or it can be undefined before spam
testing takes place. Or some conditions can be cached, as in:

some_acl:

  warn
    condition = ${if !isset:acl_m_some_acl_result}
    set acl_m_some_acl_result = ${if some-heavy-condition}


  accept
    condition = $acl_m_some_acl_result


deny

It won’t work with def:..., because that treats empty and unset variables the
same.

The problem is aggravated by strict_acl_vars, with which one can’t check for
unset variables at all.

unset would also be useful, though to a less extent. The idea is not to spare
resources, but to add more expressive possibilities. For example, the caching
ACL above can unset the variable under certain conditions to force
re-evaluation. The problems with removing tree nodes are solvable, I guess the
tree is basically what C++ would call std::map<std::string, std::string>? The
C++’s map can remove elements easily, your tree should allow that as well.

To summarize, isset is really needed, especially for those who use
strict_acl_vars. unset would also be helpful.


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email