User Tools

Site Tools


reference:spamrules_statement_foreach_bag

This is an old revision of the document!


Spam Filter Rules: ForEach Bag

Statement ForEach Bag
Version 2.2.1+
Purpose Causes a loop to be run through for each value in a particular bag

The ForEach Bag statement requires a bag name and a loop variable name, in the format

ForEach Bag <bag name> <loop variable name>

On each pass through the loop, the loop variable will contain the next value from the bag, in the order they were added.

All ForEach Bag statements must be followed by an EndFor statement

Example

The following example loops through everything stored in the 'recipients' bag

ForEach Bag recipients ThisRcpt
 Log "${ThisRcpt}"
EndFor
#There should be a separate entry in the log file for each value in the bag
reference/spamrules_statement_foreach_bag.1314027728.txt.gz ยท Last modified: 2018/11/14 10:44 (external edit)