[exim-dev] [Bug 167] Make "true" and "false" valid expansion…

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Phil Pennock
Data:  
Para: exim-dev
Asunto: [exim-dev] [Bug 167] Make "true" and "false" valid expansion conditions
------- You are receiving this mail because: -------
You are the QA contact for the bug.

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




--- Comment #12 from Phil Pennock <exim-dev@???> 2008-09-12 11:28:38 ---
Created an attachment (id=271)
--> (http://bugs.exim.org/attachment.cgi?id=271)
Adds "bool" expansion condition

This feature request, in variant forms, has come up more recently. In
particular, there's a desire to be able to store a boolean value in an ACL
variable and then reference it cleanly from condition logic.

I approached this by adding a new expansion condition, "bool", which takes one
parameter, which needs to evaluate to one of the strings
"true"/"yes"/"false"/"no" (leading whitespace permitted).

$ ./exim -be
> ${if bool{true} {foo}{bar}}

foo
>


This is sufficiently small and self-contained and does provide a slightly
cleaner syntax than a straight 'eq' and offers type-checking, insofar as a
value other than the four listed above results in an expansion failure. :)

(I have no personal use-cases for it at this time, but have wanted it in the
past and worked around it).


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