Network Working Group N. Freed Request for Comments: 5183 Sun Microsystems Category: Standards Track May 2008
Network Working Group N. Freed Request for Comments: 5183 Sun Microsystems Category: Standards Track May 2008
Sieve Email Filtering: Environment 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.
本文件规定了互联网社区的互联网标准跟踪协议,并要求进行讨论和提出改进建议。有关本协议的标准化状态和状态,请参考当前版本的“互联网官方协议标准”(STD 1)。本备忘录的分发不受限制。
Abstract
摘要
This document describes the "environment" extension to the Sieve email filtering language. The "environment" extension gives a Sieve script access to information about the Sieve interpreter itself, where it is running, and about any transport connection currently involved in transferring the message.
本文档描述了Sieve电子邮件过滤语言的“环境”扩展。“environment”扩展允许Sieve脚本访问有关Sieve解释器本身、其运行位置以及当前传输消息所涉及的任何传输连接的信息。
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.
Sieve[RFC5228]是一种用于在最终交付时或前后过滤电子邮件的语言。它被设计为可以在邮件客户端或邮件服务器上实现。它适用于在不允许用户执行任意程序的邮件服务器上运行,例如在黑盒Internet消息访问协议[RFC3501]服务器上,因为它没有用户控制的循环或运行外部程序的能力。
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.
尽管Sieve旨在独立于访问协议、邮件体系结构和操作系统,但在某些情况下,允许脚本访问有关其执行上下文的信息是有用的。“environment”扩展提供了一个新的环境测试,可用于实现脚本,这些脚本在从一个系统移动到另一个系统、消息从不同远程源到达或在不同上下文中操作时表现不同。
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].
本文件中的关键词“必须”、“不得”、“必需”、“应”、“不应”、“应”、“不应”、“建议”、“可”和“可选”应按照[RFC2119]中所述进行解释。
The terms used to describe the various components of the Sieve language are taken from Section 1.1 of [RFC5228].
用于描述筛子语言各组成部分的术语取自[RFC5228]第1.1节。
This document refers to the ABNF productions IPv4-address-literal, IPv6-address-literal, and General-address-literal defined in Section 4.1.3 of [RFC2821].
本文件涉及[RFC2821]第4.1.3节中定义的ABNF productions IPv4地址文字、IPv6地址文字和通用地址文字。
The location item makes use of standard terms for email service components. Additional information and background on these terms can be found in [EMAIL-ARCH].
位置项使用电子邮件服务组件的标准术语。有关这些术语的更多信息和背景,请参见[EMAIL-ARCH]。
The capability string associated with the extension defined in this document is "environment".
与本文档中定义的扩展相关联的功能字符串为“environment”。
Usage: environment [COMPARATOR] [MATCH-TYPE] <name: string> <key-list: string-list>
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 argument. The test succeeds if a match occurs. The type of match defaults to ":is" and the default comparator is "i;ascii-casemap".
环境测试检索由名称字符串指定的环境信息项,并将其与键列表参数中指定的值相匹配。如果出现匹配,测试将成功。匹配类型默认为“: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 the key-list argument 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. In particular, the test:
如果指定的信息项不存在,则环境测试必须无条件失败。如果项目不存在,则脚本不得因错误而失败。这允许编写优雅地处理不存在项的脚本。特别是,测试:
if environment :contains "item" "" { ... }
if environment :contains "item" "" { ... }
only succeeds if "item" is known to the implementation, and always succeeds if it is.
只有当实现知道“项”时,才会成功,如果知道,则始终成功。
The "relational" extension [RFC5231] 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.
“关系”扩展[RFC5231]添加了一个名为“:count”的匹配类型。如果返回的环境信息是空字符串,则环境测试的计数为0,否则为1。
Environment items can be standardized or vendor-defined. An IANA registry is defined for both types of items. Extensions designed for interoperable use SHOULD be defined in standards track or experimental RFCs.
环境项目可以标准化,也可以由供应商定义。这两种类型的项目都定义了IANA注册表。为互操作使用而设计的扩展应该在标准跟踪或实验RFC中定义。
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.
“域”=>与筛选执行上下文关联的主DNS域,通常但不总是主机名的正确后缀。
"host" => The fully-qualified domain name of the host where the Sieve script is executing.
“主机”=>正在执行筛选脚本的主机的完全限定域名。
"location" => Sieve evaluation can be performed at various different points as messages are processed. This item provides additional information about the type of service that is evaluating the script. Possible values are "MTA", meaning the Sieve is being evaluated by a Message Transfer Agent, "MDA", meaning evaluation is being performed by a Mail Delivery Agent, "MUA", meaning evaluation is being performed by a Mail User Agent, and "MS", meaning evaluation is being performed by a Message Store. Additional information and background on these terms can be found in [EMAIL-ARCH].
“位置”=>在处理消息时,可以在不同的点执行筛选评估。此项提供有关正在评估脚本的服务类型的附加信息。可能的值为“MTA”,表示筛选由邮件传输代理进行评估,“MDA”,表示评估由邮件传递代理执行,“MUA”,表示评估由邮件用户代理执行,“MS”,表示评估由邮件存储执行。有关这些术语的更多信息和背景,请参见[EMAIL-ARCH]。
"name" => The product name associated with the Sieve interpreter.
“名称”=>与筛解释器关联的产品名称。
"phase" => The point relative to final delivery where the Sieve script is being evaluated. Possible values are "pre", "during", and "post", referring respectively to processing before, during, and after final delivery has taken place.
“阶段”=>与最终交付相关的评估筛选脚本的点。可能的值为“前”、“中”和“后”,分别指最终交付之前、期间和之后的处理。
"remote-host" => Host name of remote SMTP/LMTP/Submission client expressed as a Fully Qualified Domain Name (FQDN), if applicable and available. The empty string will be returned if for some reason this information cannot be obtained for the current client.
“远程主机”=>远程SMTP/LMTP/提交客户端的主机名,表示为完全限定域名(FQDN)(如果适用且可用)。如果由于某种原因无法为当前客户端获取此信息,将返回空字符串。
"remote-ip" => IP address of remote SMTP/LMTP/Submission client, if applicable and available. IPv4, IPv6, and other types of addresses are respectively represented in the formats defined by the IPv4-address-literal, IPv6-address-literal, and General-address-literal productions defined in Section 4.1.3 of [RFC2821].
“远程ip”=>远程SMTP/LMTP/提交客户端的ip地址(如果适用且可用)。IPv4、IPv6和其他类型的地址分别以[RFC2821]第4.1.3节中定义的IPv4地址文本、IPv6地址文本和通用地址文本产品定义的格式表示。
"version" => The product version associated with the Sieve interpreter. The meaning of the product version string is product-specific and should always be considered in the context of the product name given by the "name" item.
“版本”=>与筛解释器关联的产品版本。产品版本字符串的含义是特定于产品的,应始终在“名称”项给出的产品名称上下文中考虑。
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.
实现应该支持此初始列表中尽可能多的项。其他标准化项目只能在标准跟踪或实验RFC中定义。
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.
以“vnd”开头的环境项名称表示供应商定义的扩展。此类扩展未由互联网标准或RFC定义,但仍在IANA注册,以防止冲突。
A registry of environment items is provided by IANA. Item names may be registered on a first-come, first-served basis.
IANA提供了环境项目的登记册。商品名称可以先到先得的方式登记。
Groups of items defined in a standards track or experimental RFC MAY choose to use a common name prefix of the form "name.", where "name" is a string that identifies the group of related items.
标准跟踪或实验RFC中定义的项目组可以选择使用“名称”形式的通用名称前缀,其中“名称”是标识相关项目组的字符串。
Items not defined in a standards track or experimental RFC MUST have a name that begins with the "vnd." prefix, and this prefix is followed by the name of the vendor or product, such as "vnd.acme.rocket-sled-status".
标准轨道或实验RFC中未定义的项目的名称必须以“vnd.”前缀开头,该前缀后跟供应商或产品的名称,如“vnd.acme.rocket sled status”。
The following template is to be used for registering new Sieve environment item names with IANA.
以下模板用于向IANA注册新的筛环境项名称。
To: iana@iana.org Subject: Registration of new Sieve environment item
致:iana@iana.org主题:新筛环境项目的注册
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]
RFC编号:[对于发布为RFC的扩展]联系地址:[联系其他信息的电子邮件和/或实际地址]
Multiple items and descriptions MAY be specified in a single registration request. Both standardized and vendor-defined items use this form.
在一个注册请求中可以指定多个项目和描述。标准化项目和供应商定义的项目均使用此表格。
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.
环境扩展可用于获取有关正在运行筛选实现的系统的信息。这些信息反过来可能会揭示有关服务提供商或企业基础设施的详细信息。
An implementation can use any technique to determine the remote-host environment item defined in this specification, and the trustworthiness of the result will vary. One common method will be to perform a PTR DNS lookup on the client IP address. This information may come from an untrusted source. For example, the test:
实现可以使用任何技术来确定本规范中定义的远程主机环境项,并且结果的可信度会有所不同。一种常见的方法是在客户端IP地址上执行PTR DNS查找。此信息可能来自不受信任的来源。例如,测试:
if environment :matches "remote-host" "*.example.com" { ... }
if environment :matches "remote-host" "*.example.com" { ... }
is not a good way to test whether the message came from "outside" because anyone who can create a PTR record can create one that refers to whatever domain they choose.
这不是测试消息是否来自“外部”的好方法,因为任何可以创建PTR记录的人都可以创建一个引用他们选择的任何域的PTR记录。
All of the security considerations given in the base Sieve specification also apply to this extension.
基本筛规范中给出的所有安全注意事项也适用于此扩展。
The following template specifies the IANA registration of the Sieve extension specified in this document:
以下模板规定了本文件中规定的筛网扩展的IANA注册:
To: iana@iana.org Subject: Registration of new Sieve extension
致:iana@iana.org主题:新筛网扩展的注册
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 5183 Contact address: Sieve discussion list <ietf-mta-filters@imc.org>
功能名称:环境描述:“环境”扩展提供了一个新的环境测试,可用于实现脚本,这些脚本在从一个系统移动到另一个系统或在不同上下文中操作时表现不同。RFC编号:RFC 5183联系地址:筛讨论列表<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. The initial contents of the registry are given in the following section.
该规范还为筛选环境项名称定义了一个新的IANA注册表。第4.3节给出了该注册表的详细信息。注册表的初始内容见下一节。
The following template specifies the initial IANA registrations for the environment items defined in this document:
以下模板指定了本文档中定义的环境项的初始IANA注册:
To: iana@iana.org Subject: Registration of new Sieve environment items
致:iana@iana.org主题:新筛环境项目的注册
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.
功能名称:域描述:与筛选执行上下文关联的主DNS域,通常但不总是主机名的正确后缀。
Capability name: host Description: The fully-qualified domain name of the host where the Sieve script is executing.
功能名称:主机描述:执行筛选脚本的主机的完全限定域名。
Capability name: location Description: Type of service executing the Sieve script.
功能名称:位置描述:执行筛选脚本的服务类型。
Capability name: name Description: The product name associated with the Sieve interpreter.
功能名称:名称描述:与筛解释器关联的产品名称。
Capability name: phase Description: Point relative to final delivery at which the Sieve script is being evaluated.
能力名称:阶段描述:与最终交付相关的点,在该点上评估筛选脚本。
Capability name: remote-host Description: Host name of remote SMTP client, if applicable and available.
功能名称:远程主机描述:远程SMTP客户端的主机名(如果适用且可用)。
Capability name: remote-ip Description: IP address of remote SMTP client, if applicable and available.
功能名称:远程ip描述:远程SMTP客户端的ip地址(如果适用且可用)。
Capability name: version Description: The product version associated with the Sieve interpreter.
功能名称:版本描述:与筛解释器关联的产品版本。
RFC number: RFC 5183 Contact address: Sieve discussion list <ietf-mta-filters@imc.org>
RFC number: RFC 5183 Contact address: Sieve discussion list <ietf-mta-filters@imc.org>
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC2119]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,1997年3月。
[RFC2821] Klensin, J., "Simple Mail Transfer Protocol", RFC 2821, April 2001.
[RFC2821]Klensin,J.,“简单邮件传输协议”,RFC 28212001年4月。
[RFC5228] Guenther, P. and T. Showalter, "Sieve: An Email Filtering Language", RFC 5228, January 2008.
[RFC5228]Guenther,P.和T.Showalter,“筛选:电子邮件过滤语言”,RFC 5228,2008年1月。
[RFC5231] Segmuller, W. and B. Leiba, "Sieve Email Filtering: Relational Extension", RFC 5231, January 2008.
[RFC5231]Segmuler,W.和B.Leiba,“筛选电子邮件过滤:关系扩展”,RFC 52312008年1月。
[EMAIL-ARCH] Crocker, D., "Internet Mail Architecture", Work in Progress, February 2008.
[EMAIL-ARCH]Crocker,D.,“互联网邮件架构”,正在进行的工作,2008年2月。
[RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1", RFC 3501, March 2003.
[RFC3501]Crispin,M.,“互联网消息访问协议-版本4rev1”,RFC 35012003年3月。
Brian Carpenter, Dave Crocker, Cyrus Daboo, Philip Guenther, Kjetil Torgrim Homme, John Klensin, Mark Mallett, Alexey Melnikov, and Dilyan Palauzo provided helpful suggestions and corrections.
Brian Carpenter、Dave Crocker、Cyrus Daboo、Philip Guenther、Kjetil Torgrim Homme、John Klensin、Mark Mallett、Alexey Melnikov和Dilyan Palauzo提供了有益的建议和更正。
Author's Address
作者地址
Ned Freed Sun Microsystems 3401 Centrelake Drive, Suite 410 Ontario, CA 92761-1205 USA
Ned Freed Sun Microsystems 3401 Centrelake Drive,美国加利福尼亚州安大略省410号套房92761-1205
Phone: +1 909 457 4293 EMail: ned.freed@mrochek.com
Phone: +1 909 457 4293 EMail: ned.freed@mrochek.com
Full Copyright Statement
完整版权声明
Copyright (C) The IETF Trust (2008).
版权所有(C)IETF信托基金(2008年)。
This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights.
本文件受BCP 78中包含的权利、许可和限制的约束,除其中规定外,作者保留其所有权利。
This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
本文件及其包含的信息以“原样”为基础提供,贡献者、他/她所代表或赞助的组织(如有)、互联网协会、IETF信托基金和互联网工程任务组不承担任何明示或暗示的担保,包括但不限于任何保证,即使用本文中的信息不会侵犯任何权利,或对适销性或特定用途适用性的任何默示保证。
Intellectual Property
知识产权
The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights. Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and BCP 79.
IETF对可能声称与本文件所述技术的实施或使用有关的任何知识产权或其他权利的有效性或范围,或此类权利下的任何许可可能或可能不可用的程度,不采取任何立场;它也不表示它已作出任何独立努力来确定任何此类权利。有关RFC文件中权利的程序信息,请参见BCP 78和BCP 79。
Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr.
向IETF秘书处披露的知识产权副本和任何许可证保证,或本规范实施者或用户试图获得使用此类专有权利的一般许可证或许可的结果,可从IETF在线知识产权存储库获取,网址为http://www.ietf.org/ipr.
The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org.
IETF邀请任何相关方提请其注意任何版权、专利或专利申请,或其他可能涵盖实施本标准所需技术的专有权利。请将信息发送至IETF的IETF-ipr@ietf.org.