Re: AW: [exim] A weaker variant of check_spool_space

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Philip Hazel
Datum:  
To: Steffen Heil
CC: exim-users
Betreff: Re: AW: [exim] A weaker variant of check_spool_space
On Mon, 15 Nov 2004, Steffen Heil wrote:

> I never understood, why boolean evaluation is not supported...
> I booleans were evaluated on their own, one could write:
>
> condition = ge{$spool_space}{100M}


You are changing the meaning of the value of the "condition" string.
Currently, the only valid values are 0, 1, true, false, yes, no (after
expansion). You are asking for it to be interpreted in a special way,
which seems not worth doing just for this one case.

> The construct "if x then true else false" always seems a bad construct to
> me...


Well yes, but Exim supports the more general "if x then y else z" and
this has been used in the case of "condition" where it only makes sense
for y and z to be true or false. In other cases it does make sense for y
and z to be all kinds of different strings.

> Maybe this could be implemented somehow, making a lot of if's redundant.


If you mean something like

${ge {$spool_space}{100M}}

as the syntactic equivalent of

${if ge{$spool_space}{100M}{true}{false}}

then yes, I can see that that would be useful to make life easier for people.
However, note that there are quite a lot of conditions, which would mean
adding a lot of new expansion items. An in-between possibility would be

${if ge{$spool_space}{100M}}

with the implied values of true/false. I'll think about that.

> IMHO, there should be no distinction between condition results and values. 0
> is false and 1 is true. exim does already behave this way in most cases...


I'm sorry, I don't really follow what you are saying here.

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.
Get the Exim 4 book:    http://www.uit.co.uk/exim-book