RFC 5231
Sieve Email Filtering: Relational Extension
RFC 5231: Sieve Email Filtering: Relational Extension โจ
Okay bestie, this is RFC 5231, and it's giving Standards Track ๐ . It was written by Wolfgang Segmuller and Barry Leiba from IBM T.J. Watson Research Center, and it's dated January 2008 ๐ธ. It also obsoletes RFC 3431 ๐ฆ, so that older one is retired now.
Status of This Memo
This document describes an Internet standards track protocol for the Internet community, and it's asking everyone to discuss it and suggest improvements ๐ซถ. For the standardization state and status of this protocol, check the current edition of the "Internet Official Protocol Standards" (STD 1) โจ. Distribution of this memo is unlimited ๐.
Abstract
So this doc describes the RELATIONAL extension to the Sieve mail filtering language from RFC 3028 ๐. It lets conditional tests in Sieve use relational operators, not just "is it equal?" ๐. It also lets you test how many entities show up in header and envelope fields, which is lowkey iconic ๐ฅ.
This document obsoletes RFC 3431 ๐ฆ.
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 2
2. Conventions Used in This Document . . . . . . . . . . . . . . . 2
3. Comparators . . . . . . . . . . . . . . . . . . . . . . . . . . 2
4. Match Types . . . . . . . . . . . . . . . . . . . . . . . . . . 3
4.1. Match Type VALUE . . . . . . . . . . . . . . . . . . . . . 3
4.2. Match Type COUNT . . . . . . . . . . . . . . . . . . . . . 3
5. Interaction with Other Sieve Actions . . . . . . . . . . . . . 4
6. Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
7. Extended Example . . . . . . . . . . . . . . . . . . . . . . . 6
8. Changes since RFC 3431 . . . . . . . . . . . . . . . . . . . . 6
9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 7
10. Security Considerations . . . . . . . . . . . . . . . . . . . . 7
11. Normative References . . . . . . . . . . . . . . . . . . . . . 7
1. Introduction โจ
Okay so the RELATIONAL extension is an add-on for the Sieve mail filtering language [Sieve] ๐. It gives you relational operators for the address, envelope, and header tests ๐ . It also gives you a way to count the entities in a message header or address field ๐งฎ.
This is so cute because now a Sieve script can check whether a field is greater than or less than a value, not just equivalent ๐ธ. One example is the x-priority field: move messages with a priority greater than 3 into the "work on later" folder ๐ผ. You could also sort mail by the from address. Userids that start with 'a'-'m' go in one folder, and everyone else goes in another ๐.
The Sieve script can also count stuff. It can figure out how many fields are in the header, or how many addresses are in a recipient field. For example, it can check whether there are more than 5 addresses in the to and cc fields ๐ญ.
The capability string for this extension 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 ๐ซถ.
Notation conventions follow [Sieve] section 1.1, including the use of [Kwds] and the use of [ABNF] ๐.
3. Comparators ๐
This document doesn't define any comparators, and it doesn't exempt any comparators from the require clause ๐. Any comparator used must be treated as defined in [Sieve] โจ.
The comparator i;ascii-numeric, as defined in [RFC4790], 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 Types ๐
This document defines two new match types, VALUE and COUNT ๐ธ.
The syntax is:
MATCH-TYPE =/ COUNT / VALUE
COUNT = ":count" relational-match
VALUE = ":value" relational-match
relational-match = DQUOTE
("gt" / "ge" / "lt" / "le" / "eq" / "ne") DQUOTE
; "gt" means "greater than", the C operator ">".
; "ge" means "greater than or equal", the C operator ">=".
; "lt" means "less than", the C operator "<".
; "le" means "less than or equal", the C operator "<=".
; "eq" means "equal to", the C operator "==".
; "ne" means "not equal to", the C operator "!=".
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 that returns sort information โจ.
A value from the message is the left side of the relation ๐. A value from the test expression is the right side of the relation. That's the key-list for address, envelope, and header tests ๐ซถ.
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 ๐งฎ
The COUNT match type first figures out the number of the specified entities in the message ๐ . Then it does a relational comparison of that number, as defined below, against the values in the test expression ๐.
The COUNT match type SHOULD only be used with numeric comparators ๐ข.
The Address Test counts the number of addresses in the specified fields. Those are the "mailbox" elements defined in [RFC2822] ๐ฌ. Group names are ignored, but the mailboxes inside the groups get counted ๐.
The Envelope Test counts the number of addresses in the specified envelope parts ๐. The envelope "to" will always have only one entry, which is the address of the user the Sieve script is running for ๐. With this test, there's no way for a script to tell whether the message was actually sent to someone else ๐. The envelope "from" will be 0 if the MAIL FROM is empty, or 1 if MAIL FROM is not empty ๐ .
The Header Test counts the total number of instances of the specified fields ๐งพ. It does not count individual addresses in the "to", "cc", and other recipient fields ๐ธ.
In all cases, if you specify more than one field name, the counts for all of them get added together ๐. So ["to", "cc"] in an address COUNT test compares the total number of "to" and "cc" addresses ๐งฎ. If you want separate counts, you need two comparisons, maybe joined by "allof" or "anyof" ๐ซถ.
5. Interaction with Other Sieve Actions ๐
This specification adds two match types ๐. The VALUE match type only works with comparators that return sort information โจ. The COUNT match type only makes sense with numeric comparators ๐ข.
There's no interaction with any other Sieve operations, and no interaction with any known extensions either ๐. This specification has no effect on implicit KEEP, and no effect on any explicit message actions ๐ .
Part 2 is next, bestie, and it's where the examples and the big security stuff live ๐ซถ๐ฅ.
Full Copyright Statement โจ
Okay so, the copyright part ๐ซถ Copyright (C) The IETF Trust (2008). The IETF Trust owns this one, and the rights, licenses and restrictions in BCP 78 apply to it. Except for whatever BCP 78 says, the authors keep all their rights ๐
The legal disclaimer is in all caps, so no shade, just lawyers being lawyers ๐ญ This document and the information in it are provided on an "AS IS" basis. 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 doesn't take a side on whether any Intellectual Property Rights or other rights are valid, or how far they reach, for anything that uses the tech in this document ๐ It also doesn't say whether you can get a license for them. And it hasn't gone looking for any of those rights either, so it's not vouching for anything. If you want the details on how rights work for RFC documents, check out BCP 78 and BCP 79 ๐
Copies of IPR disclosures sent to the IETF Secretariat are a thing, and so are any assurances of licenses that might be offered. If someone tried to get a general license or permission to use those proprietary rights, implementers or users can look for the results too. All of that lives in the IETF on-line IPR repository at http://www.ietf.org/ipr ๐ธ
And the IETF really wants to hear from you ๐ซถ If you know about any copyrights, patents, patent applications, or other proprietary rights that might cover tech you'd need to implement this standard, tell the IETF. Send it to ietf-ipr@ietf.org โจ
๐ฆ where this page comes from
- ietf: rfc5231 2008-01
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms