This is an old revision of the document!
Statement | ForEach Header |
---|---|
Version | 2.2.1+ |
Purpose | Causes a loop to be run through for each header line in the message |
The ForEach Header statement requires a loop variable name, in the format
ForEach Header <loop variable name>
On each pass through the loop, the loop variable will contain the current value of the header line.
All ForEach Header statements must be followed by an EndFor statement
The following example loops through each header line and puts it into the '${HeaderLine}' variable. This is then sent to the log file.
ForEach Header HeaderLine Log "${HeaderLine}" EndFor #There should be a separate entry in the log file for each header line
The following example loops through all of the header lines of the message, and look for the 'Received:' header lines
ForEach Header HeaderLine IfMatch ${HeaderLine} /^Received:/ # Statements EndIf EndFor