This is an old revision of the document!
Statement | ForEach Addr |
---|---|
Version | 2.1.11+ |
Purpose | Causes a loop to be run through for each address contained in the specified header line of the message |
The ForEach Addr statement requires a header name and a loop variable name, in the format
ForEach Addr <header name> <loop variable name>
On each pass through the loop, the loop variable will contain the current value of the address found.
All ForEach Addr statements must be followed by an EndFor statement
The following example loops through each email address found in the 'Cc' header field of the message, and puts it into the '${CcAddr}' variable. This is then sent to the log file.
ForEach Addr Cc CcAddr Log "${CcAddr}" EndFor #There should be a separate entry in the log file for each 'Cc' address
The following example loops through each email address found in the 'Reply-To' header field of the message, and puts it into the '${ReplyAddr}' variable. This is then checked against the sender's whitelist.
ForEach Addr Reply-To ReplyAddr IfMatch WhiteList ${ReplyAddr} ${Score} += 100 [whitelist] Break EndIf EndFor