[Exim] short circuit expansion on conditions

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Marian Eichholz
Datum:  
To: exim-users
Betreff: [Exim] short circuit expansion on conditions
Hello!

With Exim 4.04 I got a nasty string expansion problem comparing the
message size with the content of an external file (or a default value).

No, the quota attribute is not usable there.

urmel:~ $ touch /var/exim/spool/t
urmel:~ $ exim -be '"${if eq{0}{1}{${readfile{t}{}}}{WIRDNIX}}"'
"WIRDNIX"
urmel:~ $ rm /var/exim/spool/t
urmel:~ $ exim -be '"${if eq{0}{1}{${readfile{t}{}}}{WIRDNIX}}"'
Failed: failed to open t: No such file or directory

This is the problem: "readfile" is evaluated even if a precondition
fails (like "exists").

I found no hint in the exim-spec, revealing

- if *every* branch is evaluated regardless of preconditions,
- if there is a way to use short circuit evaluation.

Probably it might be ideal, when unneccessary conditional expansion
branches are just parsed but not "executed".

--
Mit freundlichen Gruessen / Yours sincerely

Marian Eichholz