From 0ce9abe687c08503facdd9f4f94dfa27ada83da9 Mon Sep 17 00:00:00 2001 From: Philip Hazel Date: Tue, 6 Feb 2007 10:00:24 +0000 Subject: Add forany/forall (Marcus Holmgren's patch, basically). --- doc/doc-txt/ChangeLog | 4 +++- doc/doc-txt/NewStuff | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index 6179dec3e..f9485b632 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -1,4 +1,4 @@ -$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.468 2007/02/05 12:35:46 ph10 Exp $ +$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.469 2007/02/06 10:00:24 ph10 Exp $ Change log file for Exim from version 4.21 ------------------------------------------- @@ -73,6 +73,8 @@ PH/14 Added log_selector = +pid. PH/15 Flush SMTP output before delaying, unless control=no_delay_flush is set. +PH/16 Add ${if forany and ${if forall. + Exim version 4.66 ----------------- diff --git a/doc/doc-txt/NewStuff b/doc/doc-txt/NewStuff index ae6c48991..ff72f6fa6 100644 --- a/doc/doc-txt/NewStuff +++ b/doc/doc-txt/NewStuff @@ -1,4 +1,4 @@ -$Cambridge: exim/doc/doc-txt/NewStuff,v 1.135 2007/02/05 12:35:46 ph10 Exp $ +$Cambridge: exim/doc/doc-txt/NewStuff,v 1.136 2007/02/06 10:00:24 ph10 Exp $ New Features in Exim -------------------- @@ -236,6 +236,38 @@ Version 4.67 a delay in an ACL. This behaviour can be disabled by obeying control = no_delay_flush at some earlier point. +12. There are two new expansion conditions that iterate over a list. They are + called forany and forall, and they are used like this: + + ${if forany{}{}{}{}} + ${if forall{}{}{}{}} + + The first argument is expanded, and the result is treated as a list. By + default, the list separator is a colon, but it can be changed by the normal + method. The second argument is interpreted as a condition that is to be + applied to each item in the list in turn. During the interpretation of the + condition, the current list item is placed in a variable called $item. + + - For forany, interpretation stops if the condition is true for any item, + and the yes-string is then expanded. If the condition is false for all + items in the list, the no-string is expanded. + + - For forall, interpration stops if the condition is false for any item, + and the no-string is then expanded. If the condition is true for all + items in the list, the yes-string is expanded. + + Note that negation of forany means that the condition must be false for all + items for the overall condition to succeed, and negation of forall means + that the condition must be false for at least one item. + + In this example, the list separator is changed to a comma: + + ${if forany{<, $recipients}{match{$item}{^user3@}}{yes}{no}} + + Outside a forany/forall condition, the value of $item is an empty string. + Its value is saved and restored while forany/forall is being processed, to + enable these expansion items to be nested. + Version 4.66 ------------ -- cgit v1.2.3