draft-ietf-sieve-external-lists-01.txt   draft-ietf-sieve-external-lists-02.txt 
Sieve Working Group A. Melnikov Sieve Working Group A. Melnikov
Internet-Draft Isode Limited Internet-Draft Isode Limited
Intended status: Standards Track B. Leiba Intended status: Standards Track B. Leiba
Expires: March 1, 2010 Huawei Technologies Expires: November 20, 2010 Huawei Technologies
August 28, 2009 May 19, 2010
Sieve Extension: Externally Stored Lists Sieve Extension: Externally Stored Lists
draft-ietf-sieve-external-lists-01 draft-ietf-sieve-external-lists-02
Abstract
The Sieve scripting language can be used to implement whitelisting,
blacklisting, personal distribution lists, and other sorts of list
matching. Currently, this requires that all members of such lists be
hardcoded in the script itself. Whenever a member of a list is added
or deleted, the script needs to be updated and possibly uploaded to a
mail server.
This document defines a Sieve extension for accessing externally
stored lists -- lists whose members are stored externally to the
script, such as using LDAP (RFC 4510), ACAP (RFC 2244), or relational
databases.
ToDo
o Need a way to advertise supported URI schemas in ManageSieve and
ihave. From IETF 77 minutes: "Can use ihave to test if a URI is
valid, both that the scheme is supported and that the URI can be
retrieved/queried."
Status of this Memo Status of this Memo
This Internet-Draft is submitted to IETF in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and 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). Note that other groups may also distribute
other groups may also distribute working documents as Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
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 This Internet-Draft will expire on November 20, 2010.
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 March 1, 2010.
Copyright Notice Copyright Notice
Copyright (c) 2009 IETF Trust and the persons identified as the Copyright (c) 2010 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents in effect on the date of Provisions Relating to IETF Documents
publication of this document (http://trustee.ietf.org/license-info). (http://trustee.ietf.org/license-info) in effect on the date of
Please review these documents carefully, as they describe your rights publication of this document. Please review these documents
and restrictions with respect to this document. carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
Abstract include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
The Sieve scripting language can be used to implement whitelisting, described in the Simplified BSD License.
blacklisting, and personal distribution lists. Currently, this
requires that all members of such lists be hardcoded in the script
itself. Whenever a member of a list is added or deleted, the script
needs to be updated and possibly uploaded to a mail server.
This document defines a Sieve extension for accessing externally
stored lists -- lists whose members are stored externally to the
script, such as using LDAP (RFC 4510), ACAP (RFC 2244), or relational
databases.
ToDo
o Need a way to advertise supported URI schemas in ManageSieve and
ihave.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1. Conventions used in this document . . . . . . . . . . . . . . 3 1.1. Conventions used in this document . . . . . . . . . . . . . . 3
2. Extlists extension . . . . . . . . . . . . . . . . . . . . . 3 2. Extlists extension . . . . . . . . . . . . . . . . . . . . . 3
2.1. Capability Identifier . . . . . . . . . . . . . . . . . . . . 3 2.1. Capability Identifier . . . . . . . . . . . . . . . . . . . . 3
2.2. :list match type for "address", "envelope", and "header" 2.2. :list match type for supported tests . . . . . . . . . . . . 3
tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.3. :list tagged argument to the "redirect" action . . . . . . . 4 2.3. :list tagged argument to the "redirect" action . . . . . . . 4
2.4. Syntax of an externally stored list name . . . . . . . . . . 5 2.4. Syntax of an externally stored list name . . . . . . . . . . 5
2.5. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.5. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3. Security Considerations . . . . . . . . . . . . . . . . . . . 5 3. Security Considerations . . . . . . . . . . . . . . . . . . . 5
4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7
5. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 7 5. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 7
skipping to change at page 3, line 13 skipping to change at page 3, line 13
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . 8 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . 8
1. Introduction 1. Introduction
This document specifies an extension to the Sieve language [Sieve] This document specifies an extension to the Sieve language [Sieve]
for checking membership in an external list or for redirecting for checking membership in an external list or for redirecting
messages to an external list of recipients. An "external list" is a messages to an external list of recipients. An "external list" is a
list whose members are stored externally to the Sieve script, such as list whose members are stored externally to the Sieve script, such as
using LDAP [LDAP], ACAP [ACAP], or relational databases. using LDAP [LDAP], ACAP [ACAP], or relational databases.
This extension adds a new match type to the "address", "envelope", This extension adds a new match type to apply to supported tests, and
and "header" tests, and a new tagged argument to the "redirect" a new tagged argument to the "redirect" action.
action.
1.1. Conventions used in this document 1.1. Conventions used in this document
Conventions for notations are as in [Sieve] section 1.1, including Conventions for notations are as in [Sieve] section 1.1, including
the use of [ABNF]. the use of [ABNF].
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 [Kwds]. document are to be interpreted as described in [Kwds].
2. Extlists extension 2. Extlists extension
2.1. Capability Identifier 2.1. Capability Identifier
The capability string associated with the extension defined in this The capability string associated with the extension defined in this
document is "extlists". document is "extlists".
2.2. :list match type for "address", "envelope", and "header" tests 2.2. :list match type for supported tests
ABNF: ABNF:
MATCH-TYPE =/ ":list" MATCH-TYPE =/ ":list"
; only valid for supported tests
The new ":list" match type changes the interpretation of the "key- The new ":list" match type changes the interpretation of the "key-
list" parameter (the second parameter) to the list" parameter (the second parameter) to supported tests. When the
"address"/"envelope"/"header" test. [[anchor4: This is not quite match type is ":list", the key-list becomes a list of names of
right. Ned convinced me that this new match type can apply to other externally stored lists. The external lists are queried, perhaps
tests as well.]] When the match type is ":list", the key-list through a list-specific mechanism, and the test evaluates to "true"
becomes a list of names of externally stored lists. The external if any of the specified values matches any member of one or more of
lists are queried, perhaps through a list-specific mechanism, and the the lists.
test evaluates to "true" if any of the specified values matches any
member of one or more of the lists. Implementations MUST support "address", "envelope" and "header"
tests. Implementations that include the Variables extension
[Variables] MUST also support "string" tests.
Implementations MAY support other tests but MUST raise an error
(which SHOULD be a compile-time error, but MAY be a runtime error)
when a script uses :list with a test for which it is not supported.
To maintain interoperability, other tests that can be used with :list
SHOULD be documented in a specification that defines a capability
string that can be tested (in a "require" statement, or using ihave
[Ihave]).
For example, testing ':header ["to", "cc"]' against a list would For example, testing ':header ["to", "cc"]' against a list would
cause each "to" and "cc" value, ignoring leading and trailing cause each "to" and "cc" value, ignoring leading and trailing
whitespace, to be queried. When any value is found to belong to the whitespace, to be queried. When any value is found to belong to the
list, the queries may stop and the test returns "true". If no value list, the queries stop and the test returns "true". If no value
belongs to the list, the test returns "false". belongs to the list, the test returns "false".
For some lists, the Sieve engine might directly retrieve the list and For some lists, the Sieve engine might directly retrieve the list and
make its own comparison. Other lists might not work that way -- they make its own comparison. Other lists might not work that way -- they
might provide a way to ask if a value is in the list, but not permit might provide a way to ask if a value is in the list, but not permit
retrieval of the list itself. It is up to the Sieve implementation retrieval of the list itself. It is up to the Sieve implementation
to understand how to interact with any supported list. If the Sieve to understand how to interact with any supported list. If the Sieve
engine is permanently unable to query the list (perhaps because the engine is permanently unable to query the list (perhaps because the
list doesn't support the required operation), the test MUST result in list doesn't support the required operation), the test MUST result in
a runtime error in the Sieve script. a runtime error in the Sieve script.
skipping to change at page 4, line 28 skipping to change at page 4, line 38
2.3. :list tagged argument to the "redirect" action 2.3. :list tagged argument to the "redirect" action
Usage: redirect :list <ext-list-name: string> Usage: redirect :list <ext-list-name: string>
The "redirect" action with the ":list" argument is used to send the The "redirect" action with the ":list" argument is used to send the
message to one or more email addresses stored in the externally message to one or more email addresses stored in the externally
stored list 'ext-list-name'. This variant of the redirect command stored list 'ext-list-name'. This variant of the redirect command
can be used to implement a personal distribution list. can be used to implement a personal distribution list.
Use of this feature requires that the list resolve to a list of email For this feature to work, one of the following conditions has to be
addresses, and that the Sieve engine be able to enumerate those true:
addresses. [[anchor6: Alexey would like the option of allowing the
list handler to enumerate the addresses and do the redirect there.
(Ned seems to agree that this should be allowed.) Barry thinks
that's contrary to Sieve, which expects to queue the redirect action
for processing at a later stage, and that it would be a bad idea to
have the redirect happen in the list handler. The WG needs to
resolve this issue.]] In cases where, for example, a list contains
hashed email address values or an email address pattern ("sz*@
example.com", "*+ietf@example.net"), it will not be possible to
redirect to that list.
If the Sieve engine [[anchor7: or list handler?]] is permanently 1. The list resolves to a list of email addresses, and the Sieve
unable to enumerate the list or the list does not resolve to email engine is able to enumerate those addresses.
addresses, the situation MUST result in a runtime error in the Sieve
script. 2. The list handler is able to take care of the redirection on
behalf of the Sieve engine.
In cases where, for example, a list contains hashed email address
values or an email address pattern ("sz*@example.com",
"*+ietf@example.net"), the Sieve engine will not be able to redirect
to that list, and responsibility must pass to the list handler.
If neither the Sieve engine nor the list handler can enumerate (or
iterate) the list, or the list does not resolve to email addresses,
the situation MUST result in a runtime error in the Sieve script.
See Section 2.4 for the detailed description of syntax used for See Section 2.4 for the detailed description of syntax used for
naming externally stored lists. naming externally stored lists.
2.4. Syntax of an externally stored list name 2.4. Syntax of an externally stored list name
A name of an externally stored list is always an absolute URI [URI]. A name of an externally stored list is always an absolute URI [URI].
Implementations might find URLs such as [LDAP], [CardDAV], or Implementations might find URLs such as [LDAP], [CardDAV], or
[TAG-URI] to be useful for naming external lists. [TAG-URI] to be useful for naming external lists.
The "tag" URI scheme [TAG-URI] can be used to represent opaque, but The "tag" URI scheme [TAG-URI] MUST be supported, and can be used to
user friendlier identifiers. Resolution of such identifiers is going represent opaque, but user friendlier identifiers. Resolution of
to be implementation specific and it can help in hiding the such identifiers is going to be implementation specific and it can
complexity of an implementation from end users. For example, an help in hiding the complexity of an implementation from end users.
implementation can provide a web interface for managing lists of For example, an implementation can provide a web interface for
users stored in LDAP. Requiring users to know generic LDAP URL managing lists of users stored in LDAP. Requiring users to know
syntax might not be very practical, due to its complexity. An generic LDAP URL syntax might not be very practical, due to its
implementation can instead use a fixed tag URI prefix such as "tag: complexity. An implementation can instead use a fixed tag URI prefix
example.com,<date>:" (where <date> can be, for example, a date such as "tag:example.com,<date>:" (where <date> can be, for example,
generated once on installation of the web interface and left a date generated once on installation of the web interface and left
untouched upon upgrades) and the prefix doesn't even need to be shown untouched upon upgrades) and the prefix doesn't even need to be shown
to end users. to end users.
2.5. Examples 2.5. Examples
[[anchor8: Barry: This example looks wrong: the "envelope" test is
probably not right. Should it really be using the :list test? It's
testing :detail, so I think it should just be a simple test, maybe '
:is "mylist" ' or some such. No? Alexey: I think this test is
correct. This is checking for known plus addresses (parts).]]
Example 1 uses the "envelope" option [Sieve] and the "subaddress" Example 1 uses the "envelope" option [Sieve] and the "subaddress"
extension [Subaddress]: extension [Subaddress]:
require ["extlists", "envelope", "subaddress"]; require ["extlists", "envelope", "subaddress"];
# Submission from list members is sent to all members # Submission from list members is sent to all members
if allof (envelope :detail :list "to" if allof (envelope :detail :list "to"
"tag:example.com,2009-05-28:mylist", "tag:example.com,2009-05-28:mylist",
header :list "from" header :list "from"
"tag:example.com,2009-05-28:mylist") { "tag:example.com,2009-05-28:mylist") {
redirect :list "tag:example.com,2009-05-28:mylist"; redirect :list "tag:example.com,2009-05-28:mylist";
} }
3. Security Considerations 3. Security Considerations
Security considerations related to the "address"/"envelope"/"header" Security considerations related to the "address"/"envelope"/"header"
tests and "redirect" action discussed in [Sieve] also apply to this tests and "redirect" action discussed in [Sieve] also apply to this
document. document.
A failure to retrieve data due to the server storing the external External list memberships ought to be treated as if they are an
list membership being down or otherwise inaccessible may alter the integral part of the script, so a temporary failure to access an
result of Sieve processing. Implementations SHOULD treat a temporary external list SHOULD be handled in the same way as a temporary
failure to retrieve or verify external list membership in the same failure to retrieve the Sieve script itself.
manner as a temporary failure to retrieve a Sieve script. For
example, if the Sieve script is stored in the Lightweight Directory For example, if the Sieve script is stored in the Lightweight
Access Protocol [LDAP] and the script can't be retrieved when a Directory Access Protocol [LDAP] and the script can't be retrieved
message is processed, then the agent performing Sieve processing can when a message is processed (perhaps the LDAP server is unavailable),
either assume that the script doesn't exist or delay message delivery then the Sieve engine might delay message delivery until the script
until the script can be retrieved successfully. External list can be retrieved successfully. Similarly, if an external list is
memberships should be treated as if they are a part of the script stored in LDAP and that LDAP server is unavailable, the Sieve engine
itself, so a temporary failure to retrieve or query them should be would take the same action -- delay message delivery and try again
handled in the same way as a temporary failure to retrieve the Sieve later.
script itself.
Protocols/APIs used to retrieve/verify external list membership MUST Protocols/APIs used to retrieve/verify external list membership MUST
provide an appropriate level of confidentiality and authentication. provide an appropriate level of confidentiality and authentication.
Usually, that will be at least the same level of confidentiality as Usually, that will be at least the same level of confidentiality as
protocols/APIs used to retrieve Sieve scripts, but only the protocols/APIs used to retrieve Sieve scripts, but only the
implementation (or deployment) will know what is appropriate. implementation (or deployment) will know what is appropriate.
There's a difference, for example, between making an LDAP request on There's a difference, for example, between making an LDAP request on
a closed LAN that's only used for trusted servers (it may be that a closed LAN that's only used for trusted servers (it may be that
neither encryption nor authentication is needed), on a firewalled LAN neither encryption nor authentication is needed), on a firewalled LAN
internal to a company (it might be OK to skip encryption, depending internal to a company (it might be OK to skip encryption, depending
upon policy), and on the open Internet (encryption and authentication upon policy), and on the open Internet (encryption and authentication
are probably both required). It also matters whether the list being are probably both required). It also matters whether the list being
accessed is private or public (no encryption or authentication may be accessed is private or public (no encryption or authentication may be
needed for public data, even on the Internet). needed for public data, even on the Internet).
Implementations of this extensions should keep in mind that matching Implementations of this extension should keep in mind that matching
values against an externally stored list can be IO and/or CPU values against an externally stored list can be IO and/or CPU
intensive. This can be used to deny service to the mailserver and/or intensive. This can be used to deny service to the mailserver and/or
to servers providing access to externally stored mailing lists. A to servers providing access to externally stored mailing lists. A
naive implementation, such as the one that tries to retrieve content naive implementation, such as the one that tries to retrieve content
of the whole list to perform matching can make this worse. But note of the whole list to perform matching can make this worse.
that many protocols that can be used for accessing externally stored
lists support flexible searching features that can be used to But note that many protocols that can be used for accessing
minimize network traffic and load on the directory service. For externally stored lists support flexible searching features that can
example, LDAP allows for search filters. Implementations SHOULD use be used to minimize network traffic and load on the directory
such features whenever they can. service. For example, LDAP allows for search filters.
Implementations SHOULD use such features whenever they can.
Many organizations support external lists with thousands of Many organizations support external lists with thousands of
recipients. In order to avoid mailbombs when redirecting a message recipients. In order to avoid mailbombs when redirecting a message
to an externally stored list, implementations SHOULD enforce limits to an externally stored list, implementations SHOULD enforce limits
on the number of recipients and/or on domains to which such on the number of recipients and/or on domains to which such
recipients belong. recipients belong.
4. IANA Considerations 4. IANA Considerations
The following template specifies the IANA registration of the notify The following template specifies the IANA registration of the notify
Sieve extension specified in this document: Sieve extension specified in this document:
To: iana@iana.org To: iana@iana.org
Subject: Registration of new Sieve extension Subject: Registration of new Sieve extension
Capability name: extlists Capability name: extlists
Description: adds the ':list' tagged argument to 'address', 'header' Description: adds the ':list' match type to certain Sieve tests, and
and 'envelope' tests, and to the 'redirect' action. The ':list' the ':list' argument to the 'redirect' action. The ':list' match
argument changes address/header/envelope test to match values against type changes tests to match values against values stored in one or
values stored in one or more externally stored list. The ':list' more externally stored lists. The ':list' argument to the redirect
argument to the redirect action changes the redirect action to action changes the redirect action to forward the message to email
forward the message to email addresses stored in the externally addresses stored in the externally stored list.
stored list.
RFC number: this RFC RFC number: this RFC
Contact address: Contact address:
The Sieve discussion list <ietf-mta-filters@imc.org> The Sieve discussion list <sieve@ietf.org>
This information should be added to the list of sieve extensions This information should be added to the list of sieve extensions
given on http://www.iana.org/assignments/sieve-extensions. given on http://www.iana.org/assignments/sieve-extensions.
5. Acknowledgements 5. Acknowledgements
Thanks to Alexandros Vellis, Barry Leiba, Nigel Swinson, Kjetil Thanks to Alexandros Vellis, Nigel Swinson, Ned Freed, Kjetil Torgrim
Torgrim Homme, Dave Cridland, Cyrus Daboo, Pete Resnick for ideas, Homme, Dave Cridland, Cyrus Daboo, Pete Resnick, and Robert Burrell
comments and suggestions. Donkin for ideas, comments and suggestions.
6. References 6. References
6.1. Normative References 6.1. 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 5234, January 2008. Specifications: ABNF", RFC 5234, January 2008.
[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.
[Sieve] Guenther, P. and T. Showalter, "Sieve: An Email Filtering [Sieve] Guenther, P. and T. Showalter, "Sieve: An Email Filtering
Language", RFC 5228, January 2008. Language", RFC 5228, January 2008.
[TAG-URI] Kindberg, T. and S. Hawke, "The 'tag' URI Scheme",
RFC 4151, October 2005.
[URI] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform [URI] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform
Resource Identifier (URI): Generic Syntax", STD 66, Resource Identifier (URI): Generic Syntax", STD 66,
RFC 3986, January 2005. RFC 3986, January 2005.
6.2. Informative References 6.2. Informative References
[ACAP] Newman, C. and J. Myers, "ACAP -- Application [ACAP] Newman, C. and J. Myers, "ACAP -- Application
Configuration Access Protocol", RFC 2244, November 1997. Configuration Access Protocol", RFC 2244, November 1997.
[CardDAV] Daboo, C., "vCard Extensions to WebDAV (CardDAV)", work in [CardDAV] Daboo, C., "vCard Extensions to WebDAV (CardDAV)", work in
progress, draft-ietf-vcarddav-carddav, July 2009. progress, draft-ietf-vcarddav-carddav, November 2009.
[Ihave] Freed, N., "Sieve Email Filtering: Ihave Extension",
RFC 5463, March 2009.
[LDAP] Zeilenga, K., "Lightweight Directory Access Protocol [LDAP] Zeilenga, K., "Lightweight Directory Access Protocol
(LDAP): Technical Specification Road Map", RFC 4510, (LDAP): Technical Specification Road Map", RFC 4510,
June 2006. June 2006.
[Subaddress] [Subaddress]
Murchison, K., "Sieve Email Filtering: Subaddress Murchison, K., "Sieve Email Filtering: Subaddress
Extension", RFC 5233, January 2008. Extension", RFC 5233, January 2008.
[TAG-URI] Kindberg, T. and S. Hawke, "The 'tag' URI Scheme", [Variables]
RFC 4151, October 2005. Homme, K., "Sieve Email Filtering: Variables Extension",
RFC 5229, January 2008.
Authors' Addresses Authors' Addresses
Alexey Melnikov Alexey Melnikov
Isode Limited Isode Limited
5 Castle Business Village 5 Castle Business Village
36 Station Road 36 Station Road
Hampton, Middlesex TW12 2BX Hampton, Middlesex TW12 2BX
UK UK
Email: Alexey.Melnikov@isode.com Email: Alexey.Melnikov@isode.com
Barry Leiba Barry Leiba
Huawei Technologies Huawei Technologies
USA
Phone: +1 646 827 0648 Phone: +1 646 827 0648
Email: barryleiba@computer.org Email: barryleiba@computer.org
URI: http://internetmessagingtechnology.org/ URI: http://internetmessagingtechnology.org/
 End of changes. 27 change blocks. 
120 lines changed or deleted 129 lines changed or added

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