User Guide
62 Kaspersky Anti-Virus® for Sendmail with Milter API
7.10.2.2. Iteration constructs
An iteration construct (IC) is the main element of the template language.
The syntax for an iteration construct is
<FOR INAME IOP IVALUE>BODY</FOR>
where:
<FOR – the beginning of IC definition. The < symbol that is not the
beginning of an IC definition should be screened (see section 7.10.2.5
on page 66);
INAME – IC name in the format 1*(nchar)*(nchar); the maximum length is
64 bytes;
IOP – comparison operation in the format == | !=; the maximum length is 2
bytes;
IVALUE – value of IC in the format 1*(vchar)*(vchar); the maximum length
is 4096 bytes. IC values only work in double quotes. When comparing
with a value that contains a quotation mark, use the relevant screening
escape symbol (see section 7.10.2.5 on page 66). Example:
<FOR _macro_name_parent_ == "\"_value_1\"
">
> – end of IC definition and the beginning of iterator body. The < symbol that
is not the end of IC definition must be hidden (see section 7.10.2.5 on
page 66);
BODY – iterator body in the format *(char);
</FOR> – end of the iterator body definition. The < symbol that is not the
end symbol of the iterator body definition must be screened (see
section 7.10.2.5 on page 66);
… – separator in the format *( )*(\t)
nchar – characters from set a-z, A-Z, 0-9, -, _
vchar –symbols from set nchar, *, ?
char – – symbols from the set of values 32 – 255
Example of an iteration construct:
<FOR _macro_name_ == "*">%_macro_name_%</FOR>
When executing this construct, the parser transforms the above command into
the condition constructs:
<FOR _macro_name_ == "_value_1"
>%_macro_name_%</FOR>
<FOR _macro_name_ == "_value_2"
>%_macro_name_%</FOR>
<FOR _macro_name_ == "_value_3"
>%_macro_name_%</FOR>










