Network Working Group N. Freed
Request for Comments: 5463 Sun Microsystems
Category: Standards Track March 2009
Sieve Email Filtering: Ihave Extension
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 (c) 2009 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents in effect on the date of
publication of this document (http://trustee.ietf.org/license-info).
Please review these documents carefully, as they describe your rights
and restrictions with respect to this document.
This document describes the "ihave" extension to the Sieve email
filtering language. The "ihave" extension provides a means to write
scripts that can take advantage of optional Sieve features but can
still run when those optional features are not available. The
extension also defines a new error control command intended to be
used to report situations where no combination of available
extensions satisfies the needs of the script.
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.
Freed Standards Track [Page 1]RFC 5463 Sieve Ihave Extension March 2009
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.
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.
The "ihave" extension also defines a new error control command. An
error causes script execution to terminate with the error message
given as the argument to the error control.
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].
The terms used to describe the various components of the Sieve
language are taken from Section 1.1 of [RFC5228].
3. Capability Identifiers
The capability string associated with the extension defined in this
document is "ihave".
4. Ihave Test
Usage: ihave <capabilities: string-list>
The "ihave" test provides a means for Sieve scripts to test for the
existence of a given extension prior to actually using it. The
capabilities argument to "ihave" is the same as the similarly-named