draft-ietf-sieve-3431bis-04.txt   rfc5231.txt 
Sieve Working Group W. Segmuller Network Working Group W. Segmuller
Internet-Draft B. Leiba Request for Comments: 5231 B. Leiba
Obsoletes: 3431 (if approved) IBM T.J. Watson Research Center Obsoletes: 3431 IBM T.J. Watson Research Center
Expires: June 30, 2006 December 27, 2005 Category: Standards Track January 2008
Sieve Extension: Relational Tests
draft-ietf-sieve-3431bis-04
Status of this Memo
By submitting this Internet-Draft, each author represents that any
applicable patent or other IPR claims of which he or she is aware
have been or will be disclosed, and any of which he or she becomes
aware will be disclosed, in accordance with Section 6 of BCP 79.
Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that
other groups may also distribute working documents as Internet-
Drafts.
Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."
The list of current Internet-Drafts can be accessed at
http://www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html.
This Internet-Draft will expire on June 30, 2006. Sieve Email Filtering: Relational Extension
Copyright Notice Status of This Memo
Copyright (C) The Internet Society (2005). 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.
Abstract Abstract
This document describes the RELATIONAL extension to the Sieve mail This document describes the RELATIONAL extension to the Sieve mail
filtering language defined in RFC 3028. This extension extends filtering language defined in RFC 3028. This extension extends
existing conditional tests in Sieve to allow relational operators. existing conditional tests in Sieve to allow relational operators.
In addition to testing their content, it also allows for testing of In addition to testing their content, it also allows for testing of
the number of entities in header and envelope fields. the number of entities in header and envelope fields.
Note This document obsoletes RFC 3431.
This document is intended to be an update to the existing
"relational" extension to the Sieve mail filtering language,
available from the RFC repository as
ftp://ftp.isi.edu/in-notes/rfc3431.txt.
This document and the Sieve language itself are being discussed on
the MTA Filters mailing list at mailto:ietf-mta-filters@imc.org.
Subscription requests can be sent to
mailto:ietf-mta-filters-request@imc.org?body=subscribe (send an email
message with the word "subscribe" in the body). More information on
the mailing list along with a WWW archive of back messages is
available at http://www.imc.org/ietf-mta-filters/.
Table of Contents Table of Contents
1. Conventions used in this document . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 2
2. Conventions Used in This Document . . . . . . . . . . . . . . . 2
2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 3. Comparators . . . . . . . . . . . . . . . . . . . . . . . . . . 2
4. Match Types . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3. Comparators . . . . . . . . . . . . . . . . . . . . . . . . . 5 4.1. Match Type VALUE . . . . . . . . . . . . . . . . . . . . . 3
4.2. Match Type COUNT . . . . . . . . . . . . . . . . . . . . . 3
4. Match Types . . . . . . . . . . . . . . . . . . . . . . . . . 6 5. Interaction with Other Sieve Actions . . . . . . . . . . . . . 4
4.1 Match Type VALUE . . . . . . . . . . . . . . . . . . . . . . . 6 6. Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
4.2 Match Type COUNT . . . . . . . . . . . . . . . . . . . . . . . 6 7. Extended Example . . . . . . . . . . . . . . . . . . . . . . . 6
8. Changes since RFC 3431 . . . . . . . . . . . . . . . . . . . . 6
5. Interaction With Other Sieve Actions . . . . . . . . . . . . . 8 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 7
10. Security Considerations . . . . . . . . . . . . . . . . . . . . 7
6. Example . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 11. Normative References . . . . . . . . . . . . . . . . . . . . . 7
7. Extended Example . . . . . . . . . . . . . . . . . . . . . . . 10
8. Changes Since RFC 3431 . . . . . . . . . . . . . . . . . . . . 11
9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 12
10. Security Considerations . . . . . . . . . . . . . . . . . . . 13
11. Normative References . . . . . . . . . . . . . . . . . . . . . 13
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . 13
Intellectual Property and Copyright Statements . . . . . . . . 15
1. Conventions used in this document
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
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 [Kwds] and the use of [ABNF].
2. Introduction 1. Introduction
The RELATIONAL extension to the Sieve mail filtering language [Sieve] The RELATIONAL extension to the Sieve mail filtering language [Sieve]
provides relational operators on the address, envelope, and header provides relational operators on the address, envelope, and header
tests. This extension also provides a way of counting the entities tests. This extension also provides a way of counting the entities
in a message header or address field. in a message header or address field.
With this extension, the Sieve script may now determine if a field is 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 greater than or less than a value instead of just equivalent. One
use is for the x-priority field: move messages with a priority 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 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 sorted by the from address. Those userids that start with 'a'-'m' go
to one folder, and the rest go to another folder. to one folder, and the rest go to another folder.
The Sieve script can also determine the number of fields in the The Sieve script can also determine the number of fields in the
header, or the number of addresses in a recipient field. For header, or the number of addresses in a recipient field, for example,
example: are there more than 5 addresses in the to and cc fields. whether there are more than 5 addresses in the to and cc fields.
The capability string associated with the extension defined in this The capability string associated with the extension defined in this
document is "relational". document is "relational".
2. Conventions Used in This Document
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
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 [Kwds] and the use of [ABNF].
3. Comparators 3. Comparators
This document does not define any comparators or exempt any This document does not define any comparators or exempt any
comparators from the require clause. Any comparator used must be comparators from the require clause. Any comparator used must be
treated as defined in [Sieve]. treated as defined in [Sieve].
The "i;ascii-numeric" comparator, as defined in [Comp], MUST be The "i;ascii-numeric" comparator, as defined in [RFC4790], MUST be
supported for any implementation of this extension. The comparator supported for any implementation of this extension. The comparator
"i;ascii-numeric" MUST support at least 32 bit unsigned integers. "i;ascii-numeric" MUST support at least 32-bit unsigned integers.
Larger integers MAY be supported. Note: the "i;ascii-numeric" Larger integers MAY be supported. Note: the "i;ascii-numeric"
comparator does not support negative numbers. comparator does not support negative numbers.
4. Match Types 4. Match Types
This document defines two new match types. They are the VALUE match This document defines two new match types. They are the VALUE match
type and the COUNT match type. type and the COUNT match type.
The syntax is: The syntax is:
skipping to change at page 6, line 27 skipping to change at page 3, line 27
relational-match = DQUOTE relational-match = DQUOTE
("gt" / "ge" / "lt" / "le" / "eq" / "ne") DQUOTE ("gt" / "ge" / "lt" / "le" / "eq" / "ne") DQUOTE
; "gt" means "greater than", the C operator ">". ; "gt" means "greater than", the C operator ">".
; "ge" means "greater than or equal", the C operator ">=". ; "ge" means "greater than or equal", the C operator ">=".
; "lt" means "less than", the C operator "<". ; "lt" means "less than", the C operator "<".
; "le" means "less than or equal", the C operator "<=". ; "le" means "less than or equal", the C operator "<=".
; "eq" means "equal to", the C operator "==". ; "eq" means "equal to", the C operator "==".
; "ne" means "not equal to", the C operator "!=". ; "ne" means "not equal to", the C operator "!=".
4.1 Match Type VALUE 4.1. Match Type VALUE
The VALUE match type does a relational comparison between strings. The VALUE match type does a relational comparison between strings.
The VALUE match type may be used with any comparator which returns The VALUE match type may be used with any comparator that returns
sort information. sort information.
A value from the message is considered the left side of the relation. 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, A value from the test expression, the key-list for address, envelope,
and header tests, is the right side of the relation. and header tests, is the right side of the relation.
If there are multiple values on either side or both sides, the test If there are multiple values on either side or both sides, the test
is considered true if any pair is true. is considered true if any pair is true.
4.2 Match Type COUNT 4.2. Match Type COUNT
The COUNT match type first determines the number of the specified The COUNT match type first determines the number of the specified
entities in the message and does a relational comparison of the entities in the message and does a relational comparison of the
number of entities, as defined below to the values specified in the number of entities, as defined below, to the values specified in the
test expression. test expression.
The COUNT match type SHOULD only be used with numeric comparators. The COUNT match type SHOULD only be used with numeric comparators.
The Address Test counts the number of addresses (the number of The Address Test counts the number of addresses (the number of
"mailbox" elements, as defined in [RFC2822]) in the specified fields. "mailbox" elements, as defined in [RFC2822]) in the specified fields.
Group names are ignored, but the contained mailboxes are counted. Group names are ignored, but the contained mailboxes are counted.
The Envelope Test counts the number of addresses in the specified The Envelope Test counts the number of addresses in the specified
envelope parts. The envelope "to" will always have only one entry, envelope parts. The envelope "to" will always have only one entry,
which is the address of the user for whom the Sieve script is which is the address of the user for whom the Sieve script is
running. There is no way a Sieve script can determine if the message running. Using this test, there is no way a Sieve script can
was actually sent to someone else using this test. The envelope determine if the message was actually sent to someone else. The
"from" will be 0 if the MAIL FROM is empty, or 1 if MAIL FROM is not envelope "from" will be 0 if the MAIL FROM is empty, or 1 if MAIL
empty. FROM is not empty.
The Header Test counts the total number of instances of the specified The Header Test counts the total number of instances of the specified
fields. This does not count individual addresses in the "to", "cc", fields. This does not count individual addresses in the "to", "cc",
and other recipient fields. and other recipient fields.
In all cases, if more than one field name is specified, the counts 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 for all specified fields are added together to obtain the number for
comparison. Thus, specifying ["to", "cc"] in an address COUNT test, comparison. Thus, specifying ["to", "cc"] in an address COUNT test
compares the total number of "to" and "cc" addresses; if separate compares the total number of "to" and "cc" addresses; if separate
counts are desired, they must be done in two comparisons, perhaps counts are desired, they must be done in two comparisons, perhaps
joined by "allof" or "anyof". joined by "allof" or "anyof".
5. Interaction With Other Sieve Actions 5. Interaction with Other Sieve Actions
This specification adds two match types. The VALUE match type only This specification adds two match types. The VALUE match type only
works with comparators that return sort information. The COUNT match works with comparators that return sort information. The COUNT match
type only makes sense with numeric comparators. type only makes sense with numeric comparators.
There is no interaction with any other Sieve operations, nor with any There is no interaction with any other Sieve operations, nor with any
known extensions. In particular, this specification has no effect on known extensions. In particular, this specification has no effect on
implicit KEEP, nor on any explicit message actions. implicit KEEP, nor on any explicit message actions.
6. Example 6. Example
skipping to change at page 9, line 20 skipping to change at page 4, line 49
received: ... received: ...
subject: example subject: example
to: foo@example.com, baz@example.com to: foo@example.com, baz@example.com
cc: qux@example.com cc: qux@example.com
The test: The test:
address :count "ge" :comparator "i;ascii-numeric" address :count "ge" :comparator "i;ascii-numeric"
["to", "cc"] ["3"] ["to", "cc"] ["3"]
would evaluate to true and the test would evaluate to true, and the test
anyof ( address :count "ge" :comparator "i;ascii-numeric" anyof ( address :count "ge" :comparator "i;ascii-numeric"
["to"] ["3"], ["to"] ["3"],
address :count "ge" :comparator "i;ascii-numeric" address :count "ge" :comparator "i;ascii-numeric"
["cc"] ["3"] ) ["cc"] ["3"] )
would evaluate to false. would evaluate to false.
To check the number of received fields in the header, the following To check the number of received fields in the header, the following
test may be used: test may be used:
skipping to change at page 11, line 5 skipping to change at page 6, line 39
} }
if allof ( address :count "eq" :comparator "i;ascii-numeric" if allof ( address :count "eq" :comparator "i;ascii-numeric"
["to", "cc"] ["1"] , ["to", "cc"] ["1"] ,
address :all :comparator "i;ascii-casemap" address :all :comparator "i;ascii-casemap"
["to", "cc"] ["me@foo.example.com"] ) ["to", "cc"] ["me@foo.example.com"] )
{ {
fileinto "Only me"; fileinto "Only me";
} }
8. Changes Since RFC 3431 8. Changes since RFC 3431
Apart from several minor editorial/wording changes, the following Apart from several minor editorial/wording changes, the following
list describes the notable changes to this specification since RFC list describes the notable changes to this specification since RFC
3431. 3431.
o Updated references, including changing the comparator reference o Updated references, including changing the comparator reference
from ACAP to the "Internet Application Protocol Collation from the Application Configuration Access Protocol (ACAP) to the
Registry" document. "Internet Application Protocol Collation Registry" document
[RFC4790].
o Updated and corrected the examples. o Updated and corrected the examples.
o Added definition comments to ABNF for "gt", "lt", etc. o Added definition comments to ABNF for "gt", "lt", etc.
o Clarified what RFC 2822 elements are counted in the COUNT test. o Clarified what RFC 2822 elements are counted in the COUNT test.
o Removed the requirement to strip white space from header fields o Removed the requirement to strip white space from header fields
before comparing; a more general version of this requirement has before comparing; a more general version of this requirement has
been added to the Sieve base spec. been added to the Sieve base spec.
9. IANA Considerations 9. IANA Considerations
This document requests that the IANA update the entry for the The following template specifies the IANA registration of the
"relational" Sieve extension to point to this document. relational Sieve extension specified in this document:
To: iana@iana.org
Subject: Registration of new Sieve extension
Capability name: relational
Description: Extends existing conditional tests in Sieve language
to allow relational operators
RFC number: RFC 5231
Contact address: The Sieve discussion list <ietf-mta-filters@imc.org>
10. Security Considerations 10. Security Considerations
An implementation MUST ensure that the test for envelope "to" only An implementation MUST ensure that the test for envelope "to" only
reflects the delivery to the current user. It MUST not be possible reflects the delivery to the current user. Using this test, it MUST
for a user to determine if this message was delivered to someone else not be possible for a user to determine if this message was delivered
using this test. to someone else.
Additional security considerations are discussed in [Sieve]. Additional security considerations are discussed in [Sieve].
11. Normative References 11. Normative References
[ABNF] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax [ABNF] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax
Specifications: ABNF", RFC 4234, October 2005. Specifications: ABNF", RFC 4234, October 2005.
[Comp] Newman, C., Duerst, M., and A. Gulbrandsen, "Internet
Application Protocol Collation Registry", work in
progress, draft-newman-i18n-comparator, September 2005.
[Kwds] Bradner, S., "Key words for use in RFCs to Indicate [Kwds] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", RFC 2119, March 1997. Requirement Levels", RFC 2119, March 1997.
[RFC2822] Resnick, P., "Internet Message Format", RFC 2822, [RFC2822] Resnick, P., "Internet Message Format", RFC 2822,
April 2001. April 2001.
[Sieve] Guenther, P. and T. Showalter, "Sieve: An Email Filtering [RFC4790] Newman, C., Duerst, M., and A. Gulbrandsen, "Internet
Language", work in progress, draft-ietf-sieve-3028bis, Application Protocol Collation Registry", RFC 4790,
July 2005. March 2007.
[Sieve] Guenther, P., Ed. and T. Showalter, Ed., "Sieve: An Email
Filtering Language", RFC 5228, January 2008.
Authors' Addresses Authors' Addresses
Wolfgang Segmuller Wolfgang Segmuller
IBM T.J. Watson Research Center IBM T.J. Watson Research Center
19 Skyline Drive 19 Skyline Drive
Hawthorne, NY 10532 Hawthorne, NY 10532
US US
Phone: +1 914 784 7408 Phone: +1 914 784 7408
Email: werewolf@us.ibm.com EMail: werewolf@us.ibm.com
Barry Leiba Barry Leiba
IBM T.J. Watson Research Center IBM T.J. Watson Research Center
19 Skyline Drive 19 Skyline Drive
Hawthorne, NY 10532 Hawthorne, NY 10532
US US
Phone: +1 914 784 7941 Phone: +1 914 784 7941
Email: leiba@watson.ibm.com EMail: leiba@watson.ibm.com
Intellectual Property Statement Full Copyright Statement
Copyright (C) The IETF Trust (2008).
This document is subject to the rights, licenses and restrictions
contained in BCP 78, and except as set forth therein, the authors
retain all their rights.
This document and the information contained herein are provided on an
"AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND
THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF
THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Intellectual Property
The IETF takes no position regarding the validity or scope of any The IETF takes no position regarding the validity or scope of any
Intellectual Property Rights or other rights that might be claimed to Intellectual Property Rights or other rights that might be claimed to
pertain to the implementation or use of the technology described in pertain to the implementation or use of the technology described in
this document or the extent to which any license under such rights this document or the extent to which any license under such rights
might or might not be available; nor does it represent that it has might or might not be available; nor does it represent that it has
made any independent effort to identify any such rights. Information made any independent effort to identify any such rights. Information
on the procedures with respect to rights in RFC documents can be on the procedures with respect to rights in RFC documents can be
found in BCP 78 and BCP 79. found in BCP 78 and BCP 79.
skipping to change at page 15, line 28 skipping to change at line 365
attempt made to obtain a general license or permission for the use of attempt made to obtain a general license or permission for the use of
such proprietary rights by implementers or users of this such proprietary rights by implementers or users of this
specification can be obtained from the IETF on-line IPR repository at specification can be obtained from the IETF on-line IPR repository at
http://www.ietf.org/ipr. http://www.ietf.org/ipr.
The IETF invites any interested party to bring to its attention any The IETF invites any interested party to bring to its attention any
copyrights, patents or patent applications, or other proprietary copyrights, patents or patent applications, or other proprietary
rights that may cover technology that may be required to implement rights that may cover technology that may be required to implement
this standard. Please address the information to the IETF at this standard. Please address the information to the IETF at
ietf-ipr@ietf.org. ietf-ipr@ietf.org.
Disclaimer of Validity
This document and the information contained herein are provided on an
"AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Copyright Statement
Copyright (C) The Internet Society (2005). This document is subject
to the rights, licenses and restrictions contained in BCP 78, and
except as set forth therein, the authors retain all their rights.
Acknowledgment
Funding for the RFC Editor function is currently provided by the
Internet Society.
 End of changes. 30 change blocks. 
118 lines changed or deleted 94 lines changed or added

This html diff was produced by rfcdiff 1.34. The latest version is available from http://tools.ietf.org/tools/rfcdiff/