Network Working Group                                        A. Melnikov
Request for Comments: 5490                                 Isode Limited
Category: Standards Track                                     March 2009
        
Network Working Group                                        A. Melnikov
Request for Comments: 5490                                 Isode Limited
Category: Standards Track                                     March 2009
        

The Sieve Mail-Filtering Language -- Extensions for Checking Mailbox Status and Accessing Mailbox Metadata

Sieve邮件过滤语言--用于检查邮箱状态和访问邮箱元数据的扩展

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)。本备忘录的分发不受限制。

Copyright Notice

版权公告

Copyright (c) 2009 IETF Trust and the persons identified as the document authors. All rights reserved.

版权所有(c)2009 IETF信托基金和确定为文件作者的人员。版权所有。

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.

本文件受BCP 78和IETF信托在本文件出版之日生效的与IETF文件有关的法律规定的约束(http://trustee.ietf.org/license-info). 请仔细阅读这些文件,因为它们描述了您对本文件的权利和限制。

This document may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. The person(s) controlling the copyright in some of this material may not have granted the IETF Trust the right to allow modifications of such material outside the IETF Standards Process. Without obtaining an adequate license from the person(s) controlling the copyright in such materials, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process, except to format it for publication as an RFC or to translate it into languages other than English.

本文件可能包含2008年11月10日之前发布或公开的IETF文件或IETF贡献中的材料。控制某些材料版权的人员可能未授予IETF信托允许在IETF标准流程之外修改此类材料的权利。在未从控制此类材料版权的人员处获得充分许可的情况下,不得在IETF标准流程之外修改本文件,也不得在IETF标准流程之外创建其衍生作品,除了将其格式化以RFC形式发布或将其翻译成英语以外的其他语言。

Abstract

摘要

This memo defines an extension to the Sieve mail filtering language (RFC 5228) for accessing mailbox and server annotations, checking for mailbox existence, and controlling mailbox creation on "fileinto" action.

此备忘录定义了对筛选邮件筛选语言(RFC 5228)的扩展,用于访问邮箱和服务器批注、检查邮箱是否存在以及在“fileinto”操作中控制邮箱创建。

Table of Contents

目录

   1. Introduction ....................................................2
   2. Conventions Used in This Document ...............................2
   3. "mailbox" and "mboxmetadata" Extensions .........................2
      3.1. Test "mailboxexists" .......................................2
      3.2. ":create" Argument to "fileinto" Command ...................3
      3.3. Test "metadata" ............................................4
      3.4. Test "metadataexists" ......................................4
   4. "servermetadata" Extension ......................................5
      4.1. Test "servermetadata" ......................................5
      4.2. Test "servermetadataexists" ................................6
   5. Security Considerations .........................................6
   6. IANA Considerations .............................................7
   7. Acknowledgements ................................................7
   8. References ......................................................8
      8.1. Normative References .......................................8
      8.2. Informative References .....................................8
        
   1. Introduction ....................................................2
   2. Conventions Used in This Document ...............................2
   3. "mailbox" and "mboxmetadata" Extensions .........................2
      3.1. Test "mailboxexists" .......................................2
      3.2. ":create" Argument to "fileinto" Command ...................3
      3.3. Test "metadata" ............................................4
      3.4. Test "metadataexists" ......................................4
   4. "servermetadata" Extension ......................................5
      4.1. Test "servermetadata" ......................................5
      4.2. Test "servermetadataexists" ................................6
   5. Security Considerations .........................................6
   6. IANA Considerations .............................................7
   7. Acknowledgements ................................................7
   8. References ......................................................8
      8.1. Normative References .......................................8
      8.2. Informative References .....................................8
        
1. Introduction
1. 介绍

This memo defines an extension to the Sieve mail filtering language [SIEVE] for accessing mailbox and server annotations. This allows for customization of the Sieve engine behaviour based on variables set using [METADATA].

此备忘录定义了Sieve邮件过滤语言[Sieve]的扩展,用于访问邮箱和服务器批注。这允许基于使用[元数据]设置的变量定制筛选引擎行为。

This document also defines an extension for checking for mailbox existence and for controlling mailbox creation on "fileinto" action.

本文档还定义了一个扩展,用于检查邮箱是否存在以及控制“fileinto”操作上的邮箱创建。

2. Conventions Used in This Document
2. 本文件中使用的公约

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 [KEYWORDS].

本文件中的关键词“必须”、“不得”、“必需”、“应”、“不应”、“应”、“不应”、“建议”、“可”和“可选”应按照[关键词]中所述进行解释。

Conventions for notations are as in [SIEVE] Section 1.1, including the use of [ABNF].

符号惯例见[SIFE]第1.1节,包括[ABNF]的使用。

This document is written with an assumption that readers are familiar with the data model and terms defined in Section 3 of [METADATA].

本文档的编写假设读者熟悉[元数据]第3节中定义的数据模型和术语。

3. "mailbox" and "mboxmetadata" Extensions
3. “邮箱”和“mboxmetadata”扩展
3.1. Test "mailboxexists"
3.1. 测试“邮箱存在”
   Usage:  mailboxexists <mailbox-names: string-list>
        
   Usage:  mailboxexists <mailbox-names: string-list>
        

The "mailboxexists" test is true if all mailboxes listed in the "mailbox-names" argument exist in the mailstore, and each allows the user in whose context the Sieve script runs to "deliver" messages into it. When the mailstore is an IMAP server, "delivery" of messages is possible if:

如果mailstore中存在“mailbox names”参数中列出的所有邮箱,并且每个邮箱都允许在其上下文中运行筛选脚本的用户“传递”消息,则“mailboxexists”测试为真。当mailstore是IMAP服务器时,如果满足以下条件,则可以“传递”邮件:

a. the READ-WRITE response code is present for the mailbox (see Section 7.1 of [IMAP]), if IMAP Access Control List (ACL) [IMAPACL] is not supported by the server, or

a. 如果服务器不支持IMAP访问控制列表(ACL)[IMAPACL],则存在邮箱的读写响应代码(请参阅[IMAP]第7.1节),或者

b. the user has 'p' or 'i' rights for the mailbox (see Section 5.2 of [IMAPACL]).

b. 用户拥有邮箱的“p”或“i”权限(请参见[IMAPACL]第5.2节)。

Note that a successful "mailboxexists" test for a mailbox doesn't necessarily mean that a "fileinto" action on this mailbox would succeed. For example, the "fileinto" action might put user over quota. The "mailboxexists" only verifies existence of the mailbox and whether the user in whose context the Sieve script runs has permissions to execute "fileinto" on it.

请注意,邮箱的“mailboxexists”测试成功并不一定意味着此邮箱的“fileinto”操作会成功。例如,“fileinto”操作可能会使用户超过配额。“mailboxexists”仅验证邮箱的存在,以及在其上下文中运行筛选脚本的用户是否有权对其执行“fileinto”。

The capability string for use with the require command is "mailbox".

与require命令一起使用的功能字符串是“mailbox”。

Example: The following example assumes that the Sieve engine also supports "reject" [REJECT] and "fileinto" [SIEVE]. However, these extensions are not required in order to implement the "mailbox" extension.

示例:以下示例假设筛引擎还支持“拒绝”[reject]和“fileinto”[Sieve]。但是,这些扩展不是实现“邮箱”扩展所必需的。

        require ["fileinto", "reject", "mailbox"];
        if mailboxexists "Partners" {
           fileinto "Partners";
        } else {
           reject "This message was not accepted by the Mailstore";
        }
        
        require ["fileinto", "reject", "mailbox"];
        if mailboxexists "Partners" {
           fileinto "Partners";
        } else {
           reject "This message was not accepted by the Mailstore";
        }
        
3.2. ":create" Argument to "fileinto" Command
3.2. “:create”参数到“fileinto”命令
   Usage:  fileinto [:create] <mailbox: string>
        
   Usage:  fileinto [:create] <mailbox: string>
        

If the optional ":create" argument is specified with "fileinto", it instructs the Sieve interpreter to create the specified mailbox, if needed, before attempting to deliver the message into the specified mailbox. If the mailbox already exists, this argument is ignored. Failure to create the specified mailbox is considered to be an error.

如果可选的“:create”参数指定为“fileinto”,则它会指示Sieve解释器在尝试将邮件传递到指定邮箱之前创建指定邮箱(如果需要)。如果邮箱已存在,则忽略此参数。未能创建指定的邮箱被视为错误。

The capability string for use with the ":create" parameter is "mailbox".

与“:create”参数一起使用的功能字符串是“mailbox”。

3.3. Test "metadata"
3.3. 测试“元数据”
   Usage:  metadata [MATCH-TYPE] [COMPARATOR]
           <mailbox: string>
           <annotation-name: string> <key-list: string-list>
        
   Usage:  metadata [MATCH-TYPE] [COMPARATOR]
           <mailbox: string>
           <annotation-name: string> <key-list: string-list>
        

This test retrieves the value of the mailbox annotation "annotation-name" for the mailbox "mailbox" [METADATA]. The retrieved value is compared to the "key-list". The test returns true if the annotation exists and its value matches any of the keys.

此测试检索邮箱“邮箱”[元数据]的邮箱批注“批注名称”的值。将检索到的值与“键列表”进行比较。如果注释存在且其值与任何键匹配,则测试返回true。

The default match type is ":is" [SIEVE]. The default comparator is "i;ascii-casemap" [SIEVE].

默认匹配类型为“:is”[SIEVE]。默认的比较器是“i;ascii casemap”[SIEVE]。

The capability string for use with the require command is "mboxmetadata".

与require命令一起使用的功能字符串是“mboxmetadata”。

Annotations MUST be accessed with the permissions of the user in whose context the Sieve script runs, and annotations starting with the "/private" prefix MUST be those of the user in whose context the Sieve script runs.

必须使用Sieve脚本在其上下文中运行的用户的权限访问注释,并且以“/private”前缀开头的注释必须是Sieve脚本在其上下文中运行的用户的注释。

Example: The following example assumes that the Sieve engine also supports the "vacation" [VACATION] extension. However, this extension is not required in order to implement the "mboxmetadata" extension.

示例:下面的示例假设筛引擎还支持“休假”[休假]扩展。但是,实现“mboxmetadata”扩展并不需要此扩展。

require ["mboxmetadata", "vacation"];

要求[“mboxmetadata”,“休假”];

       if metadata :is "INBOX"
          "/private/vendor/vendor.isode/auto-replies" "on" {
        
       if metadata :is "INBOX"
          "/private/vendor/vendor.isode/auto-replies" "on" {
        

vacation text: I'm away on holidays till March 2009. Expect a delay. . }

假期文本:我休假到2009年3月。预计会有延迟..}

3.4. Test "metadataexists"
3.4. 测试“metadataexists”
   Usage:  metadataexists <mailbox: string> <annotation-names: string-
           list>
        
   Usage:  metadataexists <mailbox: string> <annotation-names: string-
           list>
        

The "metadataexists" test is true if all of the annotations listed in the "annotation-names" argument exist (i.e., have non-NIL values) for the specified mailbox.

如果指定邮箱的“annotation names”参数中列出的所有批注都存在(即具有非NIL值),则“metadataexists”测试为真。

The capability string for use with the require command is "mboxmetadata".

与require命令一起使用的功能字符串是“mboxmetadata”。

4. "servermetadata" Extension
4. “服务器元数据”扩展
4.1. Test "servermetadata"
4.1. 测试“服务器元数据”
   Usage:  servermetadata [MATCH-TYPE] [COMPARATOR]
           <annotation-name: string> <key-list: string-list>
        
   Usage:  servermetadata [MATCH-TYPE] [COMPARATOR]
           <annotation-name: string> <key-list: string-list>
        

This test retrieves the value of the server annotation "annotation-name" [METADATA]. The retrieved value is compared to the "key-list". The test returns true if the annotation exists and its value matches any of the keys.

此测试检索服务器批注“批注名称”[元数据]的值。将检索到的值与“键列表”进行比较。如果注释存在且其值与任何键匹配,则测试返回true。

The default match type is ":is". The default comparator is "i;ascii-casemap".

默认匹配类型为“:is”。默认的比较器是“i;ascii casemap”。

The capability string for use with the require command is "servermetadata".

与require命令一起使用的功能字符串是“servermetadata”。

Annotations MUST be accessed with the permissions of the user in whose context the Sieve script runs, and annotations starting with the "/private" prefix MUST be those of the user in whose context the Sieve script runs.

必须使用Sieve脚本在其上下文中运行的用户的权限访问注释,并且以“/private”前缀开头的注释必须是Sieve脚本在其上下文中运行的用户的注释。

Example: The following example assumes that the Sieve engine also supports "variables" [VARIABLES], "enotify" [NOTIFY], and "envelope" [SIEVE] extensions. However, these extensions are not required in order to implement the "servermetadata" extension.

示例:以下示例假设筛引擎还支持“变量”[variables]、“enotify”[NOTIFY]和“信封”[Sieve]扩展。但是,这些扩展不是实现“servermetadata”扩展所必需的。

require ["enotify", "servermetadata", "variables", "envelope"];

需要[“enotify”、“servermetadata”、“variables”、“envelope”];

       if servermetadata :matches
          "/private/vendor/vendor.isode/notification-uri" "*" {
           set "notif_uri" "${0}";
       }
        
       if servermetadata :matches
          "/private/vendor/vendor.isode/notification-uri" "*" {
           set "notif_uri" "${0}";
       }
        
       if not string :is "${notif_uri}" "none" {
           # :matches is used to get the MAIL FROM address
           if envelope :all :matches "from" "*" {
               set "env_from" " [really: ${1}]";
           }
        
       if not string :is "${notif_uri}" "none" {
           # :matches is used to get the MAIL FROM address
           if envelope :all :matches "from" "*" {
               set "env_from" " [really: ${1}]";
           }
        
           # :matches is used to get the value of the Subject header
           if header :matches "Subject" "*" {
               set "subject" "${1}";
           }
        
           # :matches is used to get the value of the Subject header
           if header :matches "Subject" "*" {
               set "subject" "${1}";
           }
        
           # :matches is used to get the address from the From header
           if address :matches :all "from" "*" {
               set "from_addr" "${1}";
           }
        
           # :matches is used to get the address from the From header
           if address :matches :all "from" "*" {
               set "from_addr" "${1}";
           }
        
           notify :message "${from_addr}${env_from}: ${subject}"
                  "${notif_uri}";
       }
        
           notify :message "${from_addr}${env_from}: ${subject}"
                  "${notif_uri}";
       }
        
4.2. Test "servermetadataexists"
4.2. 测试“servermetadataexists”
   Usage:  servermetadataexists
           <annotation-names: string-list>
        
   Usage:  servermetadataexists
           <annotation-names: string-list>
        

The "servermetadataexists" test is true if all of the server annotations listed in the "annotation-names" argument exist (i.e., have non-NIL values).

如果“annotation names”参数中列出的所有服务器注释都存在(即具有非NIL值),则“servermetadataexists”测试为真。

The capability string for use with the require command is "servermetadata".

与require命令一起使用的功能字符串是“servermetadata”。

5. Security Considerations
5. 安全考虑

Extensions defined in this document deliberately don't provide a way to modify annotations.

本文档中定义的扩展故意不提供修改注释的方法。

A failure to retrieve data due to the server storing the annotations being down or otherwise inaccessible may alter the result of Sieve processing. So implementations SHOULD treat a temporary failure to retrieve annotations in the same manner as a temporary failure to retrieve a Sieve script. For example, if the Sieve script is stored in the Lightweight Directory Access Protocol (LDAP) and the script can't be retrieved when a message is processed, then the agent performing Sieve processing can, for example, assume that the script doesn't exist or delay message delivery until the script can be retrieved successfully. Annotations should be treated as if they are a part of the script itself, so a temporary failure to retrieve them should be handled in the same way as a temporary failure to retrieve the Sieve script itself.

由于存储注释的服务器关闭或无法访问而导致检索数据失败可能会改变筛选处理的结果。因此,实现应该以与检索筛选脚本的临时失败相同的方式来处理检索注释的临时失败。例如,如果筛选脚本存储在轻量级目录访问协议(LDAP)中,并且在处理消息时无法检索该脚本,则执行筛选处理的代理可以假设该脚本不存在,或者延迟消息传递,直到成功检索该脚本。注释应被视为脚本本身的一部分,因此检索注释的临时失败应以与检索脚本本身的临时失败相同的方式进行处理。

Protocols/APIs used to retrieve annotations MUST provide at least the same level of confidentiality as protocols/APIs used to retrieve Sieve scripts. For example, if Sieve scripts are retrieved using LDAP secured with Transport Layer Security (TLS) encryption, then the protocol used to retrieve annotations must use a comparable mechanism for providing connection confidentiality. In particular, the protocol used to retrieve annotations must not be lacking encryption.

用于检索注释的协议/API必须至少提供与用于检索脚本的协议/API相同的保密级别。例如,如果使用带有传输层安全性(TLS)加密的LDAP检索筛选脚本,则用于检索注释的协议必须使用类似的机制来提供连接机密性。特别是,用于检索注释的协议不能缺少加密。

6. IANA Considerations
6. IANA考虑

IANA has added the following registrations to the list of Sieve extensions:

IANA已将以下注册添加到筛网扩展列表中:

To: iana@iana.org Subject: Registration of new Sieve extension Capability name: mailbox Description: adds test for checking for mailbox existence and a new optional argument to fileinto for creating a mailbox before attempting mail delivery. RFC number: this RFC Contact address: The Sieve discussion list <ietf-mta-filters@imc.org>

致:iana@iana.org主题:注册新的筛选扩展功能名称:邮箱描述:添加用于检查邮箱是否存在的测试,并向fileinto添加用于在尝试邮件传递之前创建邮箱的新可选参数。RFC编号:此RFC联系人地址:筛讨论列表<ietf mta-filters@imc.org>

Capability name: mboxmetadata Description: adds tests for checking for mailbox metadata item existence and for retrieving of a mailbox metadata value. RFC number: this RFC Contact address: The Sieve discussion list <ietf-mta-filters@imc.org>

功能名称:mboxmetadata描述:添加用于检查邮箱元数据项是否存在和检索邮箱元数据值的测试。RFC编号:此RFC联系人地址:筛讨论列表<ietf mta-filters@imc.org>

Capability name: servermetadata Description: adds tests for checking for server metadata item existence and for retrieving of a server metadata value. RFC number: this RFC Contact address: The Sieve discussion list <ietf-mta-filters@imc.org>

功能名称:servermetadata描述:添加用于检查服务器元数据项是否存在和检索服务器元数据值的测试。RFC编号:此RFC联系人地址:筛讨论列表<ietf mta-filters@imc.org>

7. Acknowledgements
7. 致谢

Thanks to Cyrus Daboo for initial motivation for this document.

感谢Cyrus Daboo对本文档的最初动机。

Thanks to Barry Leiba, Randall Gellens, and Aaron Stone for helpful comments on this document.

感谢Barry Leiba、Randall Gellens和Aaron Stone对本文档的有用评论。

The author also thanks the Open Mobile Alliance's Mobile Email working group for providing a set of requirements for mobile devices, guiding some of the extensions in this document.

作者还感谢开放移动联盟的移动电子邮件工作组为移动设备提供了一套要求,指导了本文中的一些扩展。

8. References
8. 工具书类
8.1. Normative References
8.1. 规范性引用文件

[ABNF] Crocker, D. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", STD 68, RFC 5234, January 2008.

[ABNF]Crocker,D.和P.Overell,“语法规范的扩充BNF:ABNF”,STD 68,RFC 5234,2008年1月。

[IMAP] Crispin, M., "Internet Message Access Protocol - Version 4rev1", RFC 3501, March 2003.

[IMAP]Crispin,M.,“互联网消息访问协议-版本4rev1”,RFC 35012003年3月。

[IMAPACL] Melnikov, A., "IMAP4 Access Control List (ACL) Extension", RFC 4314, December 2005.

[IMAPACL]Melnikov,A.,“IMAP4访问控制列表(ACL)扩展”,RFC 4314,2005年12月。

[KEYWORDS] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.

[关键词]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,1997年3月。

[METADATA] Daboo, C., "The IMAP METADATA Extension", RFC 5464, February 2009.

[元数据]Daboo,C.,“IMAP元数据扩展”,RFC 54642009年2月。

[SIEVE] Guenther, P. and T. Showalter, "Sieve: An Email Filtering Language", RFC 5228, January 2008.

[筛]Guenther,P.和T.Showalter,“筛:电子邮件过滤语言”,RFC 52282008年1月。

8.2. Informative References
8.2. 资料性引用

[NOTIFY] Melnikov, A., Leiba, B., Segmuller, W., and T. Martin, "Sieve Email Filtering: Extension for Notifications", RFC 5435, January 2009.

[通知]Melnikov,A.,Leiba,B.,Segmuller,W.,和T.Martin,“筛选电子邮件过滤:通知扩展”,RFC 54352009年1月。

[REJECT] Stone, A., "Sieve Email Filtering: Reject and Extended Reject Extensions", RFC 5429, March 2009.

[拒绝]Stone,A.,“筛选电子邮件过滤:拒绝和扩展拒绝扩展”,RFC 54292009年3月。

[VACATION] Showalter, T. and N. Freed, "Sieve Email Filtering: Vacation Extension", RFC 5230, January 2008.

[假期]Showalter,T.和N.Freed,“筛选电子邮件过滤:假期延长”,RFC 5230,2008年1月。

[VARIABLES] Homme, K., "Sieve Email Filtering: Variables Extension", RFC 5229, January 2008.

[VARIABLES]Homme,K.,“筛选电子邮件过滤:变量扩展”,RFC 52292008年1月。

Author's Address

作者地址

Alexey Melnikov Isode Limited 5 Castle Business Village 36 Station Road Hampton, Middlesex TW12 2BX UK

英国米德尔塞克斯郡汉普顿车站路36号城堡商业村5号Alexey Melnikov Isode Limited TW12 2BX

   EMail: Alexey.Melnikov@isode.com
        
   EMail: Alexey.Melnikov@isode.com