draft-freed-sieve-ihave-02.txt   draft-freed-sieve-ihave-03.txt 
Network Working Group N. Freed Network Working Group N. Freed
Internet-Draft Sun Microsystems Internet-Draft Sun Microsystems
Intended status: Standards Track May 25, 2008 Intended status: Standards Track October 9, 2008
Expires: November 26, 2008 Expires: April 12, 2009
Sieve Email Filtering: Ihave Extension Sieve Email Filtering: Ihave Extension
draft-freed-sieve-ihave-02 draft-freed-sieve-ihave-03
Status of this Memo Status of this Memo
By submitting this Internet-Draft, each author represents that any By submitting this Internet-Draft, each author represents that any
applicable patent or other IPR claims of which he or she is aware 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 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. aware will be disclosed, in accordance with Section 6 of BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that Task Force (IETF), its areas, and its working groups. Note that
skipping to change at page 1, line 34 skipping to change at page 1, line 34
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
The list of current Internet-Drafts can be accessed at The list of current Internet-Drafts can be accessed at
http://www.ietf.org/ietf/1id-abstracts.txt. http://www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at The list of Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html. http://www.ietf.org/shadow.html.
This Internet-Draft will expire on November 26, 2008. This Internet-Draft will expire on April 12, 2009.
Abstract Abstract
This document describes the "ihave" extension to the Sieve email This document describes the "ihave" extension to the Sieve email
filtering language. The "ihave" extension provides a means to write filtering language. The "ihave" extension provides a means to write
scripts that can take advantage of optional Sieve features but can scripts that can take advantage of optional Sieve features but can
still run when those optional features are not available. The still run when those optional features are not available. The
extension also defines a new error control command intended to be extension also defines a new error control command intended to be
used to report situations where no combination of available used to report situations where no combination of available
extensions satisfies the needs of the script. extensions satisfies the needs of the script.
skipping to change at page 2, line 20 skipping to change at page 2, line 20
Moved the environment extension to a separate document so the Moved the environment extension to a separate document so the
standards status of the two extensions can be different. standards status of the two extensions can be different.
Added error action. Added error action.
Added some text to make the portability advantages of ihave clearer. Added some text to make the portability advantages of ihave clearer.
Added a note about the possibility that the argument to error uses Added a note about the possibility that the argument to error uses
UTF-8 characters. UTF-8 characters.
(from WGLC) Various editorial fixups.
(from WGLC) Incorporated the same short-circuit, left to right
requirements the variables extension imposes, because without it
invocation of the variables extension could potentially change the
meaning of ihave constructs in anyof or allof clauses.
(from WGLC) Added a resriction that ihave MUST NOT be used with any
extension that changes the underlying Sieve grammar. Hopefully there
won't be any such extensions, but better safe than sorry.
1. Introduction 1. Introduction
Sieve [RFC5228] is a language for filtering email messages at or Sieve [RFC5228] is a language for filtering email messages at or
around the time of final delivery. It is designed to be around the time of final delivery. It is designed to be
implementable on either a mail client or mail server. It is suitable 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 for running on a mail server where users may not be allowed to
execute arbitrary programs, such as on black box Internet Message execute arbitrary programs, such as on black box Internet Message
Access Protocol [RFC3501] servers, as it has no user-controlled loops Access Protocol [RFC3501] servers, as it has no user-controlled loops
or the ability to run external programs. or the ability to run external programs.
skipping to change at page 2, line 45 skipping to change at page 3, line 8
available. This mechanism is sufficient in most situations. available. This mechanism is sufficient in most situations.
However, there can be cases where a script may be able to take 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 advantage of an extension if it is available but can still operate if
it is not, possibly with some degradation of functionality. Cases it is not, possibly with some degradation of functionality. Cases
can also arise where a script would prefer one extension but can can also arise where a script would prefer one extension but can
employ a different one if the first one is not available. employ a different one if the first one is not available.
The "ihave" extension provides a means to write scripts that make use The "ihave" extension provides a means to write scripts that make use
of extensions only when they are actually available. Ihave defines a of extensions only when they are actually available. Ihave defines a
new ihave test that takes a list of capability names as an argument new ihave test that takes a list of capability names as an argument
and succeeds if and only if all of the those capabilities are and succeeds if and only if all of those capabilities are present.
present. Additionally, specification of the "ihave" extension in the Additionally, specification of the "ihave" extension in the require
require clause disables parse time checking of extension use in clause disables parse time checking of extension use in scripts; run-
scripts; run-time checking must be used instead. This makes it time checking must be used instead. This makes it possible to write
possible to write portable scripts that can operate in multiple portable scripts that can operate in multiple environments making
environments making effective use of whatever extensions are effective use of whatever extensions are available even though
available even though differing sets of extensions are provided in differing sets of extensions are provided in different places.
different places.
The "ihave" extension also defines a new error control command. The "ihave" extension also defines a new error control command.
Error causes script execution to terminate with the error message Error causes script execution to terminate with the error message
given as the argument to the error control. given as the argument to the error control.
2. Conventions Used in this Document 2. Conventions Used in this Document
"The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [RFC2119]. document are to be interpreted as described in [RFC2119].
skipping to change at page 3, line 40 skipping to change at page 4, line 5
capabilities argument to ihave is the same as the similarly-named capabilities argument to ihave is the same as the similarly-named
argument to the require control statement: It specifies the names of argument to the require control statement: It specifies the names of
one or more Sieve extensions or comparators. The ihave test succeeds one or more Sieve extensions or comparators. The ihave test succeeds
if all the extensions specified in the capabilities list are if all the extensions specified in the capabilities list are
available to the script. available to the script.
Unlike most Sieve tests, ihave accepts no match or comparator Unlike most Sieve tests, ihave accepts no match or comparator
arguments. The type of match for ihave is always ":is" and the arguments. The type of match for ihave is always ":is" and the
comparator is always "i;octet". comparator is always "i;octet".
The strings in the capabilities list are constant strings in context The strings in the capabilities list are constant strings in the
of Sieve variables [RFC5229]. It is an error to pass a non-constant context of Sieve variables [RFC5229]. It is an error to pass a non-
string as an argument to ihave. constant string as an argument to ihave.
The Sieve base specification demands that that all Sieve extensions The Sieve base specification demands that all Sieve extensions used
used in a given script be specified in the initial require control in a given script be specified in the initial require control
statement. It is an error for a script to call for extensions the statement. It is an error for a script to call for extensions the
interpreter doesn't support or to attempt to use extensions that have interpreter doesn't support or to attempt to use extensions that have
not been listed in the script's require clause. Using ihave changes not been listed in the script's require clause. Using ihave changes
Sieve interpreter behavior and the underlying requirements in the Sieve interpreter behavior and the underlying requirements in the
following ways: following ways:
1. Use of a given extension is allowed subsequent to the successful 1. Use of a given extension is allowed subsequent to the successful
evaluation of an ihave test on that extension all the way to the evaluation of an ihave test on that extension all the way to the
end of the script, even outside the block enclosed by the ihave end of the script, even outside the block enclosed by the ihave
test. In other words, subsequent to a successful ihave things test. In other words, subsequent to a successful ihave things
skipping to change at page 4, line 39 skipping to change at page 4, line 49
3. Although it makes little sense to do so, an extension can be 3. Although it makes little sense to do so, an extension can be
specified in both the require control statement and in an ihave specified in both the require control statement and in an ihave
test. If this is done and the extension has been implemented the test. If this is done and the extension has been implemented the
extension can be used anywhere in the script and an ihave test of extension can be used anywhere in the script and an ihave test of
that extension will always return true. that extension will always return true.
4. Ihave accepts a list of capabilities. The ihave test fails and 4. Ihave accepts a list of capabilities. The ihave test fails and
none of the capabilities are enabled if any of the specified none of the capabilities are enabled if any of the specified
capabilities are unavailable. capabilities are unavailable.
5. The Sieve base specification does not require that interpreters
evaluate arguments in any particular order or that test
evaluation be short-circuited. If ihave is enabled the
interpreter MUST short-circuit tests, i.e., not perform more
tests than necessary to find the result. Additionally,
evaluation order MUST be left to right if ihave is enabled.
Ihave is designed to be used with extensions that add tests, actions, Ihave is designed to be used with extensions that add tests, actions,
or comparators. It MUST NOT be used with extensions that change how comparators, or arguments. It MUST NOT be used with extensions that
the content of Sieve scripts are interpreted such as the variables change the underlying Sieve grammer or extensions like variables
extension [RFC5229]. [RFC5229] that change how the content of Sieve scripts are
interpreted.
5. Error Control 5. Error Control
Usage: error <message: string> Usage: error <message: string>
The error control causes script execution to terminate with a run- The error control causes script execution to terminate with a run-
time error. The message argument provides a text description of the time error. The message argument provides a text description of the
error condition that SHOULD be included in any generated report error condition that SHOULD be included in any generated report
regarding the error. Section 2.10.6 of [RFC5228] describes how run- regarding the error. Section 2.10.6 of [RFC5228] describes how run-
time errors are handled in Sieve. time errors are handled in Sieve.
Note that the message argument, like all Sieve string, employs the Note that the message argument, like all Sieve strings, employs the
UTF-8 charset and can contain non-US-ASCII characters. This must be UTF-8 charset and can contain non-US-ASCII characters. This must be
taken into consideration when reporting script errors. taken into consideration when reporting script errors.
The error control is included as part of the ihave extension so that The error control is included as part of the ihave extension so that
it is unconditionally available to scripts using ihave. it is unconditionally available to scripts using ihave.
6. Security Considerations 6. Security Considerations
A potential security issue with Sieve scripts is that when a script 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 fails to run due to the lack of some extension it may fail to block
skipping to change at page 6, line 38 skipping to change at page 7, line 7
Extension", RFC 5232, January 2008. Extension", RFC 5232, January 2008.
[RFC5233] Murchison, K., "Sieve Email Filtering: Subaddress [RFC5233] Murchison, K., "Sieve Email Filtering: Subaddress
Extension", RFC 5233, January 2008. Extension", RFC 5233, January 2008.
[RFC5235] Daboo, C., "Sieve Email Filtering: Spamtest and Virustest [RFC5235] Daboo, C., "Sieve Email Filtering: Spamtest and Virustest
Extensions", RFC 5235, January 2008. Extensions", RFC 5235, January 2008.
Appendix A. Acknowledgements Appendix A. Acknowledgements
Cyrus Daboo and Alexey Melnikov provided helpful suggestions and Stephan Bosch, Cyrus Daboo, Arnt Gulbrandsen, Andrew McKeon, and
corrections. Alexey Melnikov provided helpful suggestions and corrections.
Author's Address Author's Address
Ned Freed Ned Freed
Sun Microsystems Sun Microsystems
3401 Centrelake Drive, Suite 410 800 Royal Oaks
Ontario, CA 92761-1205 Monrovia, CA 91016-6347
USA USA
Phone: +1 909 457 4293 Phone: +1 909 457 4293
Email: ned.freed@mrochek.com Email: ned.freed@mrochek.com
Full Copyright Statement Full Copyright Statement
Copyright (C) The IETF Trust (2008). Copyright (C) The IETF Trust (2008).
This document is subject to the rights, licenses and restrictions This document is subject to the rights, licenses and restrictions
 End of changes. 12 change blocks. 
25 lines changed or deleted 43 lines changed or added

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