Network Working GroupN. Freed
Internet-DraftSun Microsystems
Expires: August 28, 2008February 25, 2008


Sieve Email Filtering: Environment Extension
draft-freed-sieve-environment-02

Status of this Memo

By submitting this Internet-Draft, each author represents that any 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 aware will be disclosed, in accordance with Section 6 of BCP 79.

Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts.

Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as “work in progress.”

The list of current Internet-Drafts can be accessed at 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 August 28, 2008.

Abstract

This document describes the "environment" extension to the Sieve email filtering language. The "environment" extension gives Sieve access to information about the environment where the Sieve interpreter is running.

Change History (to be removed prior to publication as an RFC

Changed one place string result from "UA" to "MUA".

Updated the IANA registration template.

Moved the ihave extension to a separate document.

Added remote-host and remote-ip environment items to the initial set.

Updated references.



1.  Introduction

Sieve [RFC5228] (Guenther, P. and T. Showalter, “Sieve: An Email Filtering Language,” January 2008.) 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] (Crispin, M., “INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1,” March 2003.) servers, as it has no user-controlled loops or the ability to run external programs.

Although sieve is intended to be independent of access protocol, mail architecture, and operating system, in some cases it is useful to allow scripts to access information about their execution context. The "environment" extension provides a new environment test that can be used to implement scripts that behave differently when moved from one system to another, when messages arrive from different remote sources or when otherwise operated in different contexts.



2.  Conventions used in this document

The keywords "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 (Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels,” March 1997.) [RFC2119].

The terms used to describe the various components of the Sieve language are taken from [RFC5228] (Guenther, P. and T. Showalter, “Sieve: An Email Filtering Language,” January 2008.) section 1.1.



3.  Capability Identifiers

The capability string associated with the extension defined in this document is "environment".



4.  Environment Test

Usage:   environment [COMPARATOR] [MATCH-TYPE]
                     <name: string>
                     <key-list: string-list>

The environment test retrieves the item of environment information specified by the name string and matches it to the values specified in the key-list. The test succeeds if a match occurs. The type of match defaults to ":is" and the default comparator is "i;ascii-casemap".

The current message is not a direct source of information for the environment test; the item of information specified by the name string is extracted from the script's operating environment and key-list comes from the script.

The environment test MUST fail unconditionally if the specified information item does not exist. A script MUST NOT fail with an error if the item does not exist. This allows scripts to be written that handle nonexistent items gracefully.

The "relational" extension [RFC5231] (Segmuller, W. and B. Leiba, “Sieve Email Filtering: Relational Extension,” January 2008.) adds a match type called ":count". The count of an environment test is 0 if the environment information returned is the empty string, or 1 otherwise.

Environment items can be standardized or vendor-defined. An IANA registry is defined for both types of items.



4.1.  Initial Standard Environment Items

The initial set of standardized environment items is as follows:

 "domain"  => The primary DNS domain associated with the Sieve
              execution context, usually but not always a proper
              suffix of the host name.
 "evaluation-time"
           => Sieve processing is normally performing around or after
              the time of final delivery. This item provides
              additional information about the relationship to final
              delivery. Possible return values are "MTA", meaning the
              Sieve is being evaluated before final delivery, "MDA",
              meaning evaluation is occurring during final delivery",
              and "MUA", meaning evaluation is occurring after final
              delivery.
 "host"    => The fully-qualified domain name of the host where the
              Sieve script is executing.
 "name"    => The product name associated with the Sieve interpreter.
 "remote-host"
           => Host name of remote SMTP client, if applicable and
              available.
 "remote-ip"
           => IP address of remote SMTP client, if applicable and
              available.
 "version" => The product version associated with the Sieve
              interpreter.

Implementations SHOULD support as many of the items on this initial list as possible. Additional standardized items can only be defined in standards-track or experimental RFCs.



4.2.  Vendor-defined Environment Items

Environment item names beginning with "vnd." represent vendor-defined extensions. Such extensions are not defined by Internet standards or RFCs, but are still registered with IANA in order to prevent conflicts. Environment item names starting with "vnd." SHOULD be followed by the name of the vendor and product, such as "vnd.acme.rocket-sled-status".



4.3.  IANA Registration of Environment Items

A registry of environment items is provided by IANA. Item names may be registered on a first-come, first-served basis. Extensions designed for interoperable use SHOULD be defined as standards track or IESG approved experimental RFCs.



4.3.1.  Template for Environment Registrations

The following template is to be used for registering new Sieve environment item names with IANA.

   To: iana@iana.org
   Subject: Registration of new Sieve environment item

   Item name: [the string for use in the 'environment' test]
   Description:     [a brief description of the semantics of the
                     value the item returns]

   RFC number:      [for extensions published as RFCs]
   Contact address: [email and/or physical address to contact for
                     additional information]

Multiple items and descripions MAY be specified in a single registration request. Both standardized and vender-defined items use this form.



5.  Security Considerations

The environment extension may be used to obtain information about the system the sieve implementation is running on. This information in turn may reveal details about service provider or enterprise infrastructure.

All of the security considerations given in the base Sieve specification also apply to this extension.



6.  IANA Considerations

The following template specifies the IANA registration of the Sieve extension specified in this document:

   To: iana@iana.org
   Subject: Registration of new Sieve extension

   Capability name: environment
   Description:     The "environment" extension provides a new
                    environment test that can be used to implement
                    scripts that behave differently when moved
                    from one system to another or otherwise
                    operated in different contexts.
   RFC number:      RFC XXXX
   Contact address: Sieve discussion list <ietf-mta-filters@imc.org>

This specification also defines a new IANA registry for Sieve environment item names. The specifics of this registry are given in Section 4.3 (IANA Registration of Environment Items). The initial contents of the registry are given in the following section.



6.1.  Initial Environment Item Registrations

The following template specifies the initial IANA registrations for the environment items defined in this document:

   To: iana@iana.org
   Subject: Registration of new Sieve environment items

   Capability name: domain
   Description:     The primary DNS domain associated with the Sieve
                    execution context, usually but not always a
                    proper suffix of the host name.

   Capability name: evaluation-time
   Description:     Time at which this Sieve processing is being
                    performed.

   Capability name: host
   Description:     The fully-qualified domain name of the host
                    where the Sieve script is executing.

   Capability name: name
   Description:     The product name associated with the Sieve
                    interpreter.

   Capability name: remote-host
   Description:     Host name of remote SMTP client, if applicable
                    and available.

   Capability name: remote-ip
   Description:     IP address of remote SMTP client, if applicable
                    and available.

   Capability name: version
   Description:     The product version associated with the Sieve
                    interpreter.

   RFC number:      RFC XXXX
   Contact address: Sieve discussion list <ietf-mta-filters@imc.org>


7.  References



7.1. Normative references

[RFC2119] Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels,” BCP 14, RFC 2119, March 1997 (TXT, HTML, XML).
[RFC5228] Guenther, P. and T. Showalter, “Sieve: An Email Filtering Language,” RFC 5228, January 2008 (TXT).
[RFC5231] Segmuller, W. and B. Leiba, “Sieve Email Filtering: Relational Extension,” RFC 5231, January 2008 (TXT).


7.2. Informative references

[RFC3501] Crispin, M., “INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1,” RFC 3501, March 2003 (TXT).


Author's Address

  Ned Freed
  Sun Microsystems
  3401 Centrelake Drive, Suite 410
  Ontario, CA 92761-1205
  USA
Phone:  +1 909 457 4293
Email:  ned.freed@mrochek.com


Full Copyright Statement

Intellectual Property