rfc-5231

Sieve Email Filtering: Relational Extension

W. Segmuller, B. Leiba
date2008-01 streamIETF areaapp wgsieve statusPROPOSED STANDARD pages9 canonicalhttps://www.rfc-editor.org/rfc/rfc5231 doi10.17487/RFC5231
This document describes the RELATIONAL extension to the Sieve mail filtering language defined in RFC 3028. This extension extends existing conditional tests in Sieve to allow relational operators. In addition to testing their content, it also allows for testing of the number of entities in header and envelope fields. This document obsoletes RFC 3431. [STANDARDS-TRACK]

obsoletes

Extracted elements (16)

design-rationale §3

The 'i;ascii-numeric' comparator does not support negative numbers, a deliberate constraint noted explicitly to clarify the scope of numeric comparison in Sieve.

email

design-rationale §4.2

When multiple field names are specified in a COUNT test, counts for all fields are summed; if separate counts are desired, they must be done in two comparisons joined by 'allof' or 'anyof'. This simplifies the common case while preserving flexibility.

email

interoperability-note §6

A header COUNT test on fields like 'to' and 'cc' will always evaluate to false on an RFC 2822 compliant message when testing for 3 or more, since each of those fields may appear at most once; the test counts field instances, not addresses.

email

interoperability-note §5

The relational extension has no interaction with other Sieve operations or known extensions; it does not affect implicit KEEP or any explicit message actions.

email

interoperability-note §5

The VALUE match type may only be used with comparators that return sort information; the COUNT match type only makes sense with numeric comparators.

email

normative-requirement §10 MUST

An implementation MUST ensure that the test for envelope 'to' only reflects the delivery to the current user; it MUST NOT be possible for a user to determine if the message was delivered to someone else.

email, security, privacy

normative-requirement §4.2 SHOULD

The COUNT match type SHOULD only be used with numeric comparators.

email

normative-requirement §3 MUST

The 'i;ascii-numeric' comparator MUST be supported for any implementation of this extension, and it MUST support at least 32-bit unsigned integers.

email, registry

protocol-element §4.2

The COUNT match type determines the number of specified entities in the message and does a relational comparison of that count to values in the test expression. For address tests it counts mailbox elements; group names are ignored but contained mailboxes are counted.

email

protocol-element §4.2

The envelope 'to' will always have only one entry (the current delivery recipient), and envelope 'from' will be 0 if MAIL FROM is empty or 1 if MAIL FROM is not empty.

email

protocol-element §4.2

The Header Test counts the total number of instances of the specified fields, not individual addresses within those fields. When multiple field names are specified, counts are summed.

email

protocol-element §4

The RELATIONAL extension defines two new match types: VALUE and COUNT, extending address, envelope, and header tests with relational operators (gt, ge, lt, le, eq, ne).

email

protocol-element §4.1

The VALUE match type performs a relational comparison between strings, treating a value from the message as the left side and the key-list from the test expression as the right side. The test is true if any pair satisfies the relation.

email

registry §9

This document registers the 'relational' capability name in the Sieve extension registry, describing it as extending existing conditional tests to allow relational operators.

email, registry

security-consideration §10

Implementations must prevent the envelope 'to' test from revealing whether a message was delivered to users other than the one running the current Sieve script, protecting recipient privacy.

email, security, privacy

wire-format §4

The MATCH-TYPE syntax is extended with COUNT and VALUE, each followed by a relational-match token which is a double-quoted string from the set: 'gt', 'ge', 'lt', 'le', 'eq', 'ne'.

email