Network Working Group N. Freed
Request for Comments: 5463 Sun Microsystems
Category: Standards Track March 2009
Sieve Email Filtering: Ihave Extension
1. Introduction
Sieve [RFC5228] is a language for filtering email messages at or around the time of final delivery. It is designed to be implementable on either a mail client or mail server. 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 Message Access Protocol [RFC3501] servers, as it has no user-controlled loops or the ability to run external programs. Various sieve extensions have already been defined, e.g., [RFC5229], [RFC5230], [RFC5231], [RFC5232], [RFC5233], [RFC5235], and many more are sure to be created over time. Sieve's require clause is used to specify the extensions a particular sieve needs; an error results if the script's require clause calls for an extension that isn't available. This mechanism is sufficient in most situations. However, there can be cases where a script may be able to take advantage of an extension if it is available but can still operate if it is not, possibly with some degradation of functionality. Cases can also arise where a script would prefer one extension but can employ a different one if the first one is not available.
Freed Standards Track [Page 1]
RFC 5463 Sieve Ihave Extension March 2009
The "ihave" extension provides a means to write scripts that make use of extensions only when they are actually available. It defines a new "ihave" test that takes a list of capability names as an argument and succeeds if and only if all of those capabilities are present. Additionally, specification of the "ihave" extension in the require clause disables parse-time checking of extension use in scripts; run- time checking must be used instead. This makes it possible to write portable scripts that can operate in multiple environments making effective use of whatever extensions are available even though differing sets of extensions are provided in different places.
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 [RFC2119].
3. Capability Identifiers
The capability string associated with the extension defined in this document is "ihave".
4. Ihave Test
Usage: ihave <capabilities: string-list>
Freed Standards Track [Page 2]
RFC 5463 Sieve Ihave Extension March 2009
Unlike most Sieve tests, "ihave" accepts no match or comparator arguments. The type of match for "ihave" is always ":is" and the comparator is always "i;octet".
Freed Standards Track [Page 3]
RFC 5463 Sieve Ihave Extension March 2009
4. The "ihave" test accepts a list of capabilities. If any of the specified capabilities are unavailable, the test fails and none of the capabilities are enabled.
5. Error Control
Usage: error <message: string>
6. Security Considerations
A potential security issue with Sieve scripts is that when a script fails to run due to the lack of some extension, it may fail to block dangerous email. The "ihave" extension makes it possible to improve script portability and generality, which may improve the overall security provided by Sieve.
Freed Standards Track [Page 4]
RFC 5463 Sieve Ihave Extension March 2009 7. IANA ConsiderationsThe following template specifies the IANA registration of the Sieve extension specified in this document:
8. References 8.1. Normative References[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
8.2. Informative References
[RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION
Freed Standards Track [Page 5]
RFC 5463 Sieve Ihave Extension March 2009
[RFC5235] Daboo, C., "Sieve Email Filtering: Spamtest and Virustest
9. Acknowledgments
Stephan Bosch, Cyrus Daboo, Arnt Gulbrandsen, Andrew McKeon, and Alexey Melnikov provided helpful suggestions and corrections.