Sieve Extension: Relational Tests
RFC 3431

Document Type RFC - Proposed Standard (December 2002; No errata)
Obsoleted by RFC 5231
Was draft-segmuller-sieve-relation (individual in app area)
Last updated 2015-10-14
Stream IETF
Formats plain text html pdf htmlized bibtex
Stream WG state (None)
Document shepherd No shepherd assigned
IESG IESG state RFC 3431 (Proposed Standard)
Consensus Boilerplate Unknown
Telechat date
Responsible AD Ned Freed
IESG note published 6-Dec-2002
Send notices to (None)
Network Working Group                                       W. Segmuller
Request for Comment: 3431                IBM T.J. Watson Research Center
Category: Standards Track                                  December 2002

                   Sieve Extension: Relational Tests

Status of this Memo

   This document specifies an Internet standards track protocol for the
   Internet community, and requests discussion and suggestions for
   improvements.  Please refer to the current edition of the "Internet
   Official Protocol Standards" (STD 1) for the standardization state
   and status of this protocol.  Distribution of this memo is unlimited.

Copyright Notice

   Copyright (C) The Internet Society (2002).  All Rights Reserved.


   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.

1 Introduction

   Sieve [SIEVE] is a language for filtering e-mail messages at the time
   of final delivery.  It is designed to be implementable on either a
   mail client or mail server.  It is meant to be extensible, simple,
   and independent of access protocol, mail architecture, and operating
   system.  It is suitable for running on a mail server where users may
   not be allowed to execute arbitrary programs, such as on black box
   Internet Messages Access Protocol (IMAP) servers, as it has no
   variables, loops, nor the ability to shell out to external programs.

   The RELATIONAL extension provides relational operators on the
   address, envelope, and header tests.  This extension also provides a
   way of counting the entities in a message header or address field.

   With this extension, the sieve script may now determine if a field is
   greater than or less than a value instead of just equivalent.  One
   use is for the x-priority field: move messages with a priority
   greater than 3 to the "work on later" folder.  Mail could also be
   sorted by the from address.  Those userids that start with 'a'-'m' go
   to one folder, and the rest go to another folder.

Segmuller                   Standards Track                     [Page 1]
RFC 3431           Sieve Extension: Relational Tests       December 2002

   The sieve script can also determine the number of fields in the
   header, or the number of addresses in a recipient field.  For
   example:  are there more than 5 addresses in the to and cc fields.

2 Conventions used in this document

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   document are to be interpreted as described in BCP 14, RFC 2119.

   Conventions for notations are as in [SIEVE] section 1.1, including
   the use of [KEYWORDS] and "Syntax:" label for the definition of
   action and tagged arguments syntax, and the use of [ABNF].

   The capability string associated with extension defined in this
   document is "relational".

3 Comparators

   This document does not define any comparators or exempt any
   comparators from the require clause.  Any comparator used, other than
   "i;octet" and "i;ascii-casemap", MUST be declared a require clause as
   defined in [SIEVE].

   The "i;ascii-numeric" comparator, as defined in [ACAP], MUST be
   supported for any implementation of this extension.  The comparator
   "i;ascii-numeric" MUST support at least 32 bit unsigned integers.

   Larger integers MAY be supported.  Note: the "i;ascii-numeric"
   comparator does not support negative numbers.

4 Match Type

   This document defines two new match types.  They are the VALUE match
   type and the COUNT match type.

     The syntax is:


        COUNT = ":count" relational-match

        VALUE = ":value" relational-match

        relational-match = DQUOTE ( "gt" / "ge" / "lt"
                                    / "le" / "eq" / "ne" ) DQUOTE

Segmuller                   Standards Track                     [Page 2]
RFC 3431           Sieve Extension: Relational Tests       December 2002

4.1  Match Type Value

   The VALUE match type does a relational comparison between strings.

   The VALUE match type may be used with any comparator which returns
   sort information.

   Leading and trailing white space MUST be removed from the value of
   the message for the comparison.  White space is defined as

                             SP / HTAB / CRLF

   A value from the message is considered the left side of the relation.
   A value from the test expression, the key-list for address, envelope,
   and header tests, is the right side of the relation.

   If there are multiple values on either side or both sides, the test
   is considered true, if any pair is true.

4.2  Match Type Count
Show full document text