User Tools

Site Tools


reference:spamrules_statement_foreach_header

This is an old revision of the document!


Spam Filter Rules: ForEach Header

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

Examples

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
reference/spamrules_statement_foreach_header.1314028274.txt.gz ยท Last modified: 2018/11/14 10:44 (external edit)