ietf-mta-filters
[Top] [All Lists]

variables and relational interaction

2004-08-05 07:33:00

relational defines to new modifiers for all tests, :value and :count.
the variables draft has a new test, "string", but it doesn't mention any
match types explicitly.  the relational RFC defines :value quite
generally, and I don't think the variables draft needs to the say
anything about it.  however, the :count match type has its behaviour
listed for each of the known tests.

        The COUNT match type first determines the number of the
        specified entities in the message and does a relational
        comparison of the number of entities to the values specified in
        the test expression.

        [...] The envelope "from" will be 0 if the MAIL FROM is blank,
        or 1 if MAIL FROM is not blank. [...] In all cases, if more than
        one field name is specified, the counts for all specified fields
        are added together to obtain the number for comparison.

I suggest that the value of :count is 0 if the string is empty (""), and
1 if not.

        if string :count "eq" :comparator "i;ascii-numeric"
           ["foo", "bar", ""] "2" {
                # the test is always true
        }

probably not very useful, but I think it should be added for
completeness.  suggested wording, at the end of the section on the
"string" test:

        The "relational" extensions adds a match type called ":count".
        The count of a single string is 0 if it is the empty string, or
        1 otherwise.  The count of a string list is the sum of the
        counts of the member strings.

-- 
Kjetil T.


<Prev in Thread] Current Thread [Next in Thread>