Internet Engineering Task Force (IETF)                          N. Freed
Request for Comments: 6009                                        Oracle
Category: Standards Track                                   October 2010
ISSN: 2070-1721
        
Internet Engineering Task Force (IETF)                          N. Freed
Request for Comments: 6009                                        Oracle
Category: Standards Track                                   October 2010
ISSN: 2070-1721
        

Sieve Email Filtering: Delivery Status Notifications and Deliver-By Extensions

筛选电子邮件筛选:传递状态通知和按扩展传递

Abstract

摘要

This document describes the "envelope-dsn", "redirect-dsn", "envelope-deliverby", and "redirect-deliverby" extensions to the Sieve email filtering language. The "envelope-dsn" and "envelope-deliverby" extensions provide access to additional envelope information provided by the delivery status notification (DSN) and Deliver-By SMTP extensions, respectively. The "redirect-dsn" and "redirect-deliverby" extensions extend Sieve's redirect action to provide control over delivery status notification and Deliver-By parameters, respectively.

本文档描述了Sieve电子邮件过滤语言的“信封dsn”、“重定向dsn”、“信封投递员比”和“重定向投递员比”扩展。“信封dsn”和“信封投递方式”扩展分别提供对投递状态通知(dsn)和SMTP扩展提供的其他信封信息的访问。“redirect dsn”和“redirect deliverby”扩展扩展扩展了Sieve的重定向操作,分别提供对交付状态通知和按参数交付的控制。

Status of This Memo

关于下段备忘

This is an Internet Standards Track document.

这是一份互联网标准跟踪文件。

This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 5741.

本文件是互联网工程任务组(IETF)的产品。它代表了IETF社区的共识。它已经接受了公众审查,并已被互联网工程指导小组(IESG)批准出版。有关互联网标准的更多信息,请参见RFC 5741第2节。

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc6009.

有关本文件当前状态、任何勘误表以及如何提供反馈的信息,请访问http://www.rfc-editor.org/info/rfc6009.

Copyright Notice

版权公告

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

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

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.

本文件受BCP 78和IETF信托有关IETF文件的法律规定的约束(http://trustee.ietf.org/license-info)自本文件出版之日起生效。请仔细阅读这些文件,因为它们描述了您对本文件的权利和限制。从本文件中提取的代码组件必须包括信托法律条款第4.e节中所述的简化BSD许可证文本,并提供简化BSD许可证中所述的无担保。

Table of Contents

目录

   1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . . .  3
   2.  Conventions Used in This Document  . . . . . . . . . . . . . .  3
   3.  Capability Identifiers . . . . . . . . . . . . . . . . . . . .  4
   4.  Envelope-dsn Extension . . . . . . . . . . . . . . . . . . . .  4
     4.1.  Examples . . . . . . . . . . . . . . . . . . . . . . . . .  5
   5.  Envelope-deliverby Extension . . . . . . . . . . . . . . . . .  6
     5.1.  Examples . . . . . . . . . . . . . . . . . . . . . . . . .  7
   6.  redirect-dsn Extension . . . . . . . . . . . . . . . . . . . .  9
     6.1.  MAIL FROM Address Selection  . . . . . . . . . . . . . . .  9
     6.2.  Example  . . . . . . . . . . . . . . . . . . . . . . . . .  9
   7.  redirect-deliverby Extension . . . . . . . . . . . . . . . . . 10
     7.1.  MAIL FROM Address Selection  . . . . . . . . . . . . . . . 11
     7.2.  Example  . . . . . . . . . . . . . . . . . . . . . . . . . 11
   8.  Security Considerations  . . . . . . . . . . . . . . . . . . . 11
   9.  IANA Considerations  . . . . . . . . . . . . . . . . . . . . . 12
   10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 13
     10.1. Normative References . . . . . . . . . . . . . . . . . . . 13
     10.2. Informative References . . . . . . . . . . . . . . . . . . 14
   Appendix A.  Acknowledgements  . . . . . . . . . . . . . . . . . . 15
        
   1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . . .  3
   2.  Conventions Used in This Document  . . . . . . . . . . . . . .  3
   3.  Capability Identifiers . . . . . . . . . . . . . . . . . . . .  4
   4.  Envelope-dsn Extension . . . . . . . . . . . . . . . . . . . .  4
     4.1.  Examples . . . . . . . . . . . . . . . . . . . . . . . . .  5
   5.  Envelope-deliverby Extension . . . . . . . . . . . . . . . . .  6
     5.1.  Examples . . . . . . . . . . . . . . . . . . . . . . . . .  7
   6.  redirect-dsn Extension . . . . . . . . . . . . . . . . . . . .  9
     6.1.  MAIL FROM Address Selection  . . . . . . . . . . . . . . .  9
     6.2.  Example  . . . . . . . . . . . . . . . . . . . . . . . . .  9
   7.  redirect-deliverby Extension . . . . . . . . . . . . . . . . . 10
     7.1.  MAIL FROM Address Selection  . . . . . . . . . . . . . . . 11
     7.2.  Example  . . . . . . . . . . . . . . . . . . . . . . . . . 11
   8.  Security Considerations  . . . . . . . . . . . . . . . . . . . 11
   9.  IANA Considerations  . . . . . . . . . . . . . . . . . . . . . 12
   10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 13
     10.1. Normative References . . . . . . . . . . . . . . . . . . . 13
     10.2. Informative References . . . . . . . . . . . . . . . . . . 14
   Appendix A.  Acknowledgements  . . . . . . . . . . . . . . . . . . 15
        
1. Introduction
1. 介绍

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]服务器上,因为它没有用户控制的循环或运行外部程序的能力。

The base Sieve specification defines the envelope extension and test to access information in the message envelope. Only information available in regular SMTP [RFC5321] is provided; additional information added to the SMTP envelope by SMTP extensions cannot be accessed.

基本筛选规范定义了访问消息信封中信息的信封扩展和测试。仅提供常规SMTP[RFC5321]中可用的信息;无法访问由SMTP扩展插件添加到SMTP信封的其他信息。

The "envelope-dsn" extension extends the envelope test to allow access to the additional envelope fields defined by the SMTP extension for delivery status notifications (DSNs) specified in RFC 3461 [RFC3461]. The "envelope-deliverby" extension extends the envelope test to allow access to the additional envelope fields defined by the Deliver-By SMTP extension defined in [RFC2852].

“信封dsn”扩展扩展信封测试,以允许访问RFC 3461[RFC3461]中指定的用于传递状态通知(dsn)的SMTP扩展定义的其他信封字段。“信封递送者”扩展扩展信封测试,以允许访问[RFC2852]中定义的SMTP递送扩展定义的其他信封字段。

The base Sieve specification also defines the redirect action, which sends the message to a different address. Redirect only allows specification of the new recipient address. The "redirect-dsn" extension extends redirect to allow specification of some fields defined by the delivery status notification SMTP extension. "redirect-deliverby" in turn provides the ability to set a time limit for delivery as specified in RFC 2852 [RFC2852].

基本筛规范还定义了重定向操作,该操作将消息发送到不同的地址。重定向只允许指定新的收件人地址。“redirect dsn”扩展扩展了redirect,以允许指定由传递状态通知SMTP扩展定义的某些字段。“redirect deliverby”反过来提供了设置RFC 2852[RFC2852]中规定的交付时间限制的功能。

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

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

The terms used to describe the various components of the Sieve language are taken from Section 1.1 of [RFC5228]. The nature and handling of Sieve errors are described in Section 2.10.6 of [RFC5228].

用于描述筛子语言各组成部分的术语取自[RFC5228]第1.1节。[RFC5228]第2.10.6节描述了筛网误差的性质和处理。

This document uses the ABNF notation specified in [RFC5234], and refers to the notify-esmtp-value ABNF production defined in Section 4.1 of [RFC3461].

本文件使用[RFC5234]中规定的ABNF符号,并参考[RFC3461]第4.1节中定义的notify esmtp值ABNF production。

3. Capability Identifiers
3. 能力标识符

The capability strings associated with the extensions defined in this document are "envelope-dsn", "redirect-dsn", "envelope-deliverby", and "redirect-deliverby".

与本文档中定义的扩展相关联的功能字符串是“信封dsn”、“重定向dsn”、“信封交付方”和“重定向交付方”。

4. Envelope-dsn Extension
4. 信封dsn扩展

The "envelope-dsn" extension does not define any new tests or actions; rather, it adds four values to the list of possible (case-insensitive) envelope-part strings defined in Section 5.4 of [RFC5228]:

“信封dsn”扩展未定义任何新的测试或操作;相反,它向[RFC5228]第5.4节中定义的可能(不区分大小写)信封部分字符串列表中添加了四个值:

notify - Match the list of notification conditions, or NOTIFY values, associated with the TO address used in the SMTP RCPT TO command that resulted in this message getting delivered to this user. More than one notification condition can be in effect at once; each condition that is in effect is tested separately, and any match causes the test to succeed. The syntax and semantics of the NOTIFY parameter are defined in Section 4.1 of RFC 3461 [RFC3461] . Currently, the possible notification condition values are "NEVER", "SUCCESS", "FAILURE", and "DELAY". Note that the value "NEVER" is never combined with any other value.

notify-匹配与SMTP RCPT TO命令中使用的TO地址关联的通知条件或通知值列表,该命令导致此邮件传递到此用户。一次可以生效多个通知条件;有效的每个条件都会单独测试,任何匹配都会导致测试成功。NOTIFY参数的语法和语义在RFC 3461[RFC3461]的第4.1节中定义。目前,可能的通知条件值为“从不”、“成功”、“失败”和“延迟”。请注意,“从不”值从不与任何其他值组合。

orcpt - Match the original recipient, or ORCPT, value associated with the TO address used in the SMTP RCPT TO command that resulted in this message getting delivered to this user, with xtext encoding removed. The syntax and semantics of the ORCPT parameter are defined in Section 4.2 of RFC 3461 [RFC3461].

orcpt-匹配原始收件人或orcpt值,该值与SMTP RCPT TO命令中使用的TO地址关联,该命令导致将此邮件传递给此用户,并删除xtext编码。ORCPT参数的语法和语义在RFC 3461[RFC3461]第4.2节中定义。

ret - Match the return of content, or RET, value given in the SMTP MAIL FROM command. The syntax and semantics of the RET parameter are defined in Section 4.3 of RFC 3461 [RFC3461]. The possible return of content values are "FULL" and "HDRS".

ret-匹配SMTP MAIL FROM命令中给定的内容返回或ret值。RET参数的语法和语义在RFC 3461[RFC3461]第4.3节中定义。可能返回的内容值为“FULL”和“HDRS”。

envid - Match the envelope identifier, or ENVID, value in decoded form given in the SMTP MAIL FROM command. The syntax and semantics of the ENVID parameter are defined in Section 4.4 of RFC 3461 [RFC3461].

envid-匹配SMTP MAIL FROM命令中给定的解码形式的信封标识符或envid值。ENVID参数的语法和语义在RFC 3461[RFC3461]的第4.4节中定义。

The envelope test fails unconditionally for each of these envelope-part strings if the specified envelope parameter does not exist for the current message or recipient.

如果当前邮件或收件人不存在指定的信封参数,则这些信封部分字符串的信封测试将无条件失败。

The envelope test's ADDRESS-PART argument assumes the string being tested has the syntax of an email address. None of the new envelope parts defined here have address syntax; accordingly, it is an error to specify an ADDRESS-PART argument in conjunction with these new envelope parts.

信封测试的ADDRESS-PART参数假定正在测试的字符串具有电子邮件地址的语法。这里定义的新信封部分都没有地址语法;因此,将地址部分参数与这些新信封部分一起指定是错误的。

The "relational" extension [RFC5231] adds a match type called ":count". The count of an envelope test with an envelope-part of "orcpt", "ret", and "envid" is 1 if the corresponding SMTP parameter is present and 0 otherwise. The count of an envelope test with an envelope-part of "notify" is equal to the number of notification conditions specified and 0 if the NOTIFY parameter is not present.

“关系”扩展[RFC5231]添加了一个名为“:count”的匹配类型。如果存在相应的SMTP参数,则信封部分为“orcpt”、“ret”和“envid”的信封测试的计数为1,否则为0。信封部分为“notify”的信封测试计数等于指定的通知条件数,如果notify参数不存在,则等于0。

4.1. Examples
4.1. 例子

The fact that the NOTIFY envelope parameter is multivalued and the notify envelope-part turns this into a list of values makes it easy to check to see if a given value is present without having to worry about other values:

NOTIFY envelope参数是多值的,NOTIFY envelope部分将其转换为一个值列表,这样就可以轻松检查给定值是否存在,而不必担心其他值:

require ["envelope", "envelope-dsn"];

要求[“信封”、“信封dsn”];

   # Check whether SUCCESS notifications were requested,
   # irrespective of any other requests that were made
   if envelope "notify" "SUCCESS"
   {
       # do whatever
   }
        
   # Check whether SUCCESS notifications were requested,
   # irrespective of any other requests that were made
   if envelope "notify" "SUCCESS"
   {
       # do whatever
   }
        

Checking to see if a given request is the only one present is a little trickier, however:

但是,检查给定的请求是否是唯一存在的请求有点棘手:

require ["envelope", "envelope-dsn", "relational", "comparator-i;ascii-numeric"];

要求[“信封”、“信封dsn”、“关系”、“比较器-i;ascii数字”];

   # Check whether only FAILURE notifications were requested
   if allof ( envelope "notify" "FAILURE",
              envelope :comparator "i;ascii-numeric"
                       :count "eq" "notify" "1"
            )
   {
       # do whatever
   }
        
   # Check whether only FAILURE notifications were requested
   if allof ( envelope "notify" "FAILURE",
              envelope :comparator "i;ascii-numeric"
                       :count "eq" "notify" "1"
            )
   {
       # do whatever
   }
        

The orcpt envelope-part always contains an address type indicator prefix in addition to an address, which must be taken into account in any tests:

orcpt信封部分除地址外,始终包含地址类型指示符前缀,在任何测试中都必须考虑该前缀:

require ["envelope", "envelope-dsn"];

要求[“信封”、“信封dsn”];

   # See if the orcpt is an RFC822 address in the example.com
   # domain
   if envelope :matches "orcpt" "rfc822;*@example.com"
   {
       # do whatever
   }
        
   # See if the orcpt is an RFC822 address in the example.com
   # domain
   if envelope :matches "orcpt" "rfc822;*@example.com"
   {
       # do whatever
   }
        
5. Envelope-deliverby Extension
5. 信封递送分机

The "envelope-deliverby" extension does not define any new tests or actions; rather, it adds four values to the list of possible (case-insensitive) envelope-part strings defined in Section 5.4 of [RFC5228] and an optional :zone tagged argument. This updates the usage description for envelope to:

“信封递送者”扩展未定义任何新的测试或操作;相反,它向[RFC5228]第5.4节中定义的可能(不区分大小写)信封部分字符串列表中添加了四个值和一个可选的:区域标记参数。这会将信封的使用说明更新为:

   Usage:   envelope [COMPARATOR] [ADDRESS-PART]
                     [MATCH-TYPE] [:zone <time-zone: string>]
                     <envelope-part: string-list>
                     <key-list: string-list>
        
   Usage:   envelope [COMPARATOR] [ADDRESS-PART]
                     [MATCH-TYPE] [:zone <time-zone: string>]
                     <envelope-part: string-list>
                     <key-list: string-list>
        

These new envelope parts correspond to the new MAIL FROM parameters defined in Section 4 of [RFC2852]. They are:

这些新信封部分对应于[RFC2852]第4节中定义的新邮件发件人参数。他们是:

bytimeabsolute - Match the current value of the initial integer part of the Deliver-By extension's BY parameter on the SMTP MAIL FROM command, converted into an absolute time represented in restricted ISO 8601 format. The restricted ISO 8601 format is specified by the date-time ABNF production given in [RFC3339], Section 5.6, with the added restrictions that the letters "T" and "Z" MUST be in upper case, and a time zone offset of zero MUST be represented by "Z" and not "+00:00".

bytimeabsolute—匹配SMTP MAIL FROM命令上Deliver By扩展名的By参数的初始整数部分的当前值,该值转换为以受限ISO 8601格式表示的绝对时间。受限ISO 8601格式由[RFC3339]第5.6节中给出的日期-时间ABNF生产规定,并增加了字母“T”和“Z”必须大写的限制,并且零时区偏移必须用“Z”而不是“+00:00”表示。

bytimerelative - Match the current value of the initial integer part of the Deliver-By extension's BY parameter specified in the SMTP MAIL FROM command.

bytimerelative-匹配SMTP MAIL FROM命令中指定的Deliver By扩展名的By参数的初始整数部分的当前值。

bymode - Match a string computed from the by-mode part of the Deliver-By extension's BY parameter. The possible values are "notify" and "return", which correspond to the BY parameter mode specifier characters "N" and "R", respectively.

bymode-匹配从Delivery by扩展的by参数的by mode部分计算的字符串。可能的值为“notify”和“return”,分别对应于BY参数模式说明符字符“N”和“R”。

bytrace - Match the trace modifier computed from the by-trace modifier on the Deliver-By extension's BY parameter. The possible values are "trace" and "" (the empty string). These values correspond to the presence or absence of the by-trace "T" modifier, respectively.

bytrace-匹配从Deliver by扩展的by参数上的by trace修饰符计算的跟踪修饰符。可能的值是“trace”和“”(空字符串)。这些值分别对应于是否存在“T”修饰符。

The envelope test fails unconditionally for each of these envelope-part strings if the BY SMTP MAIL FROM parameter does not exist for the current message or recipient.

如果当前邮件或收件人不存在BY SMTP MAIL FROM参数,则这些信封部分字符串的信封测试将无条件失败。

The new :zone argument specifies a time zone offset string that any bytimeabsolute value is to be shifted to prior to testing. :zone has no effect on envelope-parts other than bytimeabsolute. The value of the time zone offset string MUST be an offset relative to UTC with the following syntax:

new:zone参数指定一个时区偏移量字符串,在测试之前,任何bytimeabsolute值都将被移动到该字符串:除bytimeabsolute外,zone对封套零件没有任何影响。时区偏移量字符串的值必须是相对于UTC的偏移量,语法如下:

   time-zone  =  ( "+" / "-" ) 4DIGIT
        
   time-zone  =  ( "+" / "-" ) 4DIGIT
        

The "+" or "-" indicates whether the time-of-day is ahead of (i.e., east of) or behind (i.e., west of) UTC. The first two digits indicate the number of hours difference from Universal Time, and the last two digits indicate the number of minutes difference from Universal Time. Note that this agrees with the [RFC5322] format for time zone offsets, not the ISO 8601 format. The local time zone MUST be used for bytimeabsolute if the :zone argument is omitted.

“+”或“-”表示一天中的时间是在UTC之前(即东)还是在UTC之后(即西)。前两位数字表示与世界时相差的小时数,后两位数字表示与世界时相差的分钟数。注意,这与时区偏移的[RFC5322]格式一致,而不是ISO 8601格式。如果省略:zone参数,则必须将本地时区用于bytimeabsolute。

The envelope test's ADDRESS-PART argument assumes the string being tested has the syntax of an email address. None of the new envelope parts defined here have address syntax; accordingly, it is an error to specify an ADDRESS-PART argument in conjunction with these new envelope parts.

信封测试的ADDRESS-PART参数假定正在测试的字符串具有电子邮件地址的语法。这里定义的新信封部分都没有地址语法;因此,将地址部分参数与这些新信封部分一起指定是错误的。

The "relational" extension [RFC5231] adds a match type called ":count". The count of an envelope test with an envelope-part of "bytime", "bymode", and "bytrace" is 1 if the BY parameter is present and 0 otherwise.

“关系”扩展[RFC5231]添加了一个名为“:count”的匹配类型。如果存在BY参数,则信封部分为“bytime”、“bymode”和“bytrace”的信封测试计数为1,否则为0。

It is important to note that the Deliver-By by-time is decremented as the message passes through the transport infrastructure. Accordingly, it is not possible to tell what the message originator set the value to; only the amount of time remaining at the moment the sieve is run can be determined. Additionally, note that bytimerelative values can be negative, making it necessary to either perform additional checks or else use a comparator that, unlike i;ascii-numeric, is capable of handling signed integers.

重要的是要注意,随着消息通过传输基础设施,按时间交付的时间会减少。因此,不可能知道消息发起人将值设置为什么;只能确定筛子运行时的剩余时间。此外,请注意bytimerelative值可能为负值,因此有必要执行额外的检查,或者使用比较器,而不像i;ascii数字,能够处理有符号整数。

5.1. Examples
5.1. 例子

As noted above, this extension does not provide access to the originator's initial by-time setting for the simple reason that this information is not part of the envelope. It can, however, be used to check and see if the message was delivered within the allotted time. Note the additional check to see if the value is negative:

如上所述,此扩展不提供对发端人初始时间设置的访问,原因很简单,即此信息不是信封的一部分。但是,它可以用来检查消息是否在指定的时间内送达。注意附加检查以查看值是否为负值:

require ["envelope", "envelope-deliverby", "relational", "comparator-i;ascii-numeric"];

要求[“信封”、“信封递送器”、“关系”、“比较器-i;ascii数字”];

   # Check to see if this message didn't make it in the time allotted by
   # the originator.
   if anyof (envelope :contains "bytimerelative" "-",
             envelope :value "eq" :comparator "i;ascii-numeric"
                      "bytimerelative" "0")
   {
       # do whatever
   }
        
   # Check to see if this message didn't make it in the time allotted by
   # the originator.
   if anyof (envelope :contains "bytimerelative" "-",
             envelope :value "eq" :comparator "i;ascii-numeric"
                      "bytimerelative" "0")
   {
       # do whatever
   }
        

This operation can be done more simply if the date [RFC5260] and variables [RFC5229] extensions are available:

如果日期[RFC5260]和变量[RFC5229]扩展可用,则可以更简单地执行此操作:

require ["envelope", "envelope-deliverby", "relational", "date", "variables"];

要求[“信封”、“信封递送人”、“关系”、“日期”、“变量”];

   # Check to see if this message didn't make it in the time allotted by
   # the originator.
   if currentdate :matches "iso8601" "*" {
       set "cdate" "${0}";
       if envelope :value "ge" "bytimeabsolute" "${cdate}" {
           # do whatever
       }
   }
        
   # Check to see if this message didn't make it in the time allotted by
   # the originator.
   if currentdate :matches "iso8601" "*" {
       set "cdate" "${0}";
       if envelope :value "ge" "bytimeabsolute" "${cdate}" {
           # do whatever
       }
   }
        

Note that there is no need to force the use of a particular time zone since both currentdate and the bytimeabsolute value are required to default to the local time zone. A similar check could be written using :zone if the action taken depends on having the by-time represented in a particular zone:

请注意,无需强制使用特定时区,因为currentdate和bytimeabsolute值都需要默认为本地时区。如果所采取的操作取决于在特定区域中表示by时间,则可以使用:zone编写类似的检查:

require ["envelope", "envelope-deliverby", "relational", "date", "variables"];

要求[“信封”、“信封递送人”、“关系”、“日期”、“变量”];

   # If the message didn't make it in time, file it according to when it
   # should have been received
   if envelope :matches :zone "+0000" "bytimeabsolute" "*T*:*:*" {
       set "bdate" "${0}";
       set "bhour" "${2}";
       if currentdate :zone "+0000" :value "lt" "iso8601" "${bdate}")
           fileinto "missed-${bhour}";
       }
   }
        
   # If the message didn't make it in time, file it according to when it
   # should have been received
   if envelope :matches :zone "+0000" "bytimeabsolute" "*T*:*:*" {
       set "bdate" "${0}";
       set "bhour" "${2}";
       if currentdate :zone "+0000" :value "lt" "iso8601" "${bdate}")
           fileinto "missed-${bhour}";
       }
   }
        
6. redirect-dsn Extension
6. 重定向dsn扩展

The "redirect-dsn" extension does not define any new tests or actions; rather, it adds two new arguments, NOTIFY and RET, to the redirect action defined in Section 4.2 of [RFC5228]. This updates the usage description for redirect to:

“重定向dsn”扩展未定义任何新的测试或操作;相反,它向[RFC5228]第4.2节中定义的重定向操作添加了两个新参数NOTIFY和RET。这将更新重定向到的使用说明:

   Usage:   redirect [:notify "value"] [:ret "FULL"|"HDRS"]
                     <address: string>
        
   Usage:   redirect [:notify "value"] [:ret "FULL"|"HDRS"]
                     <address: string>
        

The syntax for the NOTIFY and RET arguments are:

NOTIFY和RET参数的语法为:

   NOTIFY = ":notify" notify-value
   notify-value = DQUOTE ("NEVER" / notify-esmtp-list) DQUOTE
   notify-esmtp-list = notify-list-element *("," notify-list-element)
        
   NOTIFY = ":notify" notify-value
   notify-value = DQUOTE ("NEVER" / notify-esmtp-list) DQUOTE
   notify-esmtp-list = notify-list-element *("," notify-list-element)
        
   RET = ":ret" ret-value
   ret-value = DQUOTE ("FULL" / "HDRS") DQUOTE
        
   RET = ":ret" ret-value
   ret-value = DQUOTE ("FULL" / "HDRS") DQUOTE
        

The notify-list-element ABNF production is defined in Section 4.1 of [RFC3461].

[RFC3461]第4.1节定义了ABNF production的notify list元素。

When these arguments are specified, they set the corresponding NOTIFY ESMTP RCPT TO and RET ESMTP MAIL FROM parameters, respectively. These arguments are only honored if the delivery status notification (DSN) ESMTP extension is available. When the DSN extension is not available, these arguments MUST be ignored and MUST NOT cause an error.

指定这些参数后,它们分别将相应的NOTIFY ESMTP RCPT设置为和RET ESMTP MAIL FROM参数。仅当传递状态通知(DSN)ESMTP扩展可用时,才使用这些参数。当DSN扩展不可用时,必须忽略这些参数,并且不得导致错误。

6.1. MAIL FROM Address Selection
6.1. 邮件发件人地址选择

RFC 5228 does not require that any particular envelope sender address be associated with redirected messages. However, the redirect-dsn extension isn't terribly useful if the place where the delivery status notifications are sent isn't known. Accordingly, when either :notify or :ret is specified and the envelope sender address isn't empty, implementations MUST set the envelope sender address to the address of the sieve owner.

RFC 5228不要求任何特定的信封发送者地址与重定向消息相关联。但是,如果发送传递状态通知的位置未知,则重定向dsn扩展并不十分有用。因此,当指定了:notify或:ret且信封发送者地址不为空时,实现必须将信封发送者地址设置为所有者的地址。

6.2. Example
6.2. 实例

One possible use of :notify on redirect is to combine the copy extension [RFC3894] with the ability to suppress nondelivery notifications to generate a private copy of selected messages with no side effects or error notifications:

:notify on redirect的一个可能用途是将复制扩展[RFC3894]与抑制未送达通知的功能结合起来,以生成所选邮件的专用副本,而不会产生任何副作用或错误通知:

require ["copy", "redirect-dsn"];

要求[“复制”、“重定向dsn”];

   # Make a private copy of messages from user@example.com
   if address "from" "user@example.com"
   {
       redirect :copy :notify "NEVER" "elsewhere@example.com";
   }
        
   # Make a private copy of messages from user@example.com
   if address "from" "user@example.com"
   {
       redirect :copy :notify "NEVER" "elsewhere@example.com";
   }
        
7. redirect-deliverby Extension
7. 重定向传递路径扩展

The "redirect-deliverby" extension does not define any new tests or actions; rather, it adds three new arguments, BYTIME, BYMODE, and BYTRACE, to the redirect action defined in Section 4.2 of [RFC5228]. This updates the usage description for redirect to:

“redirect deliverby”扩展没有定义任何新的测试或操作;相反,它向[RFC5228]第4.2节中定义的重定向操作添加了三个新参数,即BYTIME、BYMODE和BYTRACE。这将更新重定向到的使用说明:

   Usage:   redirect [:bytimerelative <rlimit: number> /
                      :bytimeabsolute <alimit:string>
                      [:bymode "notify"|"return"] [:bytrace]]
                     <address: string>
        
   Usage:   redirect [:bytimerelative <rlimit: number> /
                      :bytimeabsolute <alimit:string>
                      [:bymode "notify"|"return"] [:bytrace]]
                     <address: string>
        

:bytimerelative specifies the number of seconds within which the message should be delivered. This parameter does not allow specification of negative values; it should not be necessary to specify such values in this context. :bytimeabsolute specifies an absolute time limit on delivery. The limit in this case is specified in the restricted ISO 8601 format specified by the date-time ABNF production given in [RFC3339].

:bytimerelative指定传递消息的秒数。此参数不允许指定负值;无需在此上下文中指定此类值:bytimeabsolute指定交付的绝对时间限制。这种情况下的限值以[RFC3339]中给出的ABNF生产日期时间指定的受限ISO 8601格式指定。

:bymode specifies whether a notification should be sent or the message simply returned if the time limit is exceeded. The default is "return" if :bymode is not specified. :bytrace, if specified, activates message tracing.

:bymode指定如果超过时间限制,是应发送通知还是仅返回消息。如果未指定:bymode,则默认为“return”:如果指定bytrace,则激活消息跟踪。

The semantics of delivery time limits and these parameters are specified and discussed at length in [RFC2852].

交付时间限制和这些参数的语义在[RFC2852]中有详细说明和讨论。

It is an error to specify either :bymode or :bytrace without either :bytimeabsolute or :bytimerelative.

指定:bymode或:bytrace而不指定:bytimeabsolute或:bytimerelative是错误的。

When these arguments are specified, they are used to construct the corresponding BY ESMTP MAIL FROM parameter. The :bytimeabsolute or :bytimerelative value becomes the by-time, the :bymode becomes the by-mode value, and :bytrace sets the by-trace modifier. If the Deliver-By extension is unavailable, the handling of the redirected message MUST conform to the semantics specified in [RFC2852], Section 4.1.4 for relaying to a server that does not support the Deliver-By SMTP extension.

指定这些参数后,它们将用于构造相应的BY-ESMTP-MAIL-FROM参数。:bytimeabsolute或:bytimerelative值变为by time,:bymode变为by mode值,:bytrace设置by trace修改器。如果通过扩展传递不可用,则重定向邮件的处理必须符合[RFC2852]第4.1.4节中规定的语义,以便中继到不支持通过SMTP扩展传递的服务器。

7.1. MAIL FROM Address Selection
7.1. 邮件发件人地址选择

RFC 5228 does not require that any particular envelope sender address be associated with redirected messages. However, the redirect-deliverby extension, like the redirect-dsn extension, isn't terribly useful if the place where any delivery status notifications are sent isn't known. Accordingly, when either :bytimeabsolute or :bytimerelative is specified and the envelope sender address isn't empty, implementations MUST set the envelope sender address to the address of the sieve owner.

RFC 5228不要求任何特定的信封发送者地址与重定向消息相关联。但是,如果不知道发送任何传递状态通知的位置,那么重定向deliverby扩展(与重定向dsn扩展一样)就没有多大用处。因此,当指定:bytimeabsolute或:bytimerelative且信封发送者地址不为空时,实现必须将信封发送者地址设置为所有者的地址。

7.2. Example
7.2. 实例

The obvious use of "redirect-deliverby" is to specify a limit on delivery attempts for a redirected message:

“redirect deliverby”的明显用途是指定对重定向邮件的传递尝试的限制:

require ["copy", "redirect-deliverby"];

要求[“复制”、“重定向传递者”];

   # Send a copy to my cell phone, time out after 10 minutes
   if address "from" "user@example.com"
   {
       redirect :copy :bytimerelative 600 "cellphone@example.com";
   }
        
   # Send a copy to my cell phone, time out after 10 minutes
   if address "from" "user@example.com"
   {
       redirect :copy :bytimerelative 600 "cellphone@example.com";
   }
        

Limits on delivery after a particular time of day may also be constructed:

在一天中的某个特定时间之后的交货限制也可以设定为:

require ["copy", "redirect-deliverby", "date", "variables", "relational", "comparator-i;ascii-numeric"];

要求[“复制”、“重定向传递”、“日期”、“变量”、“关系”、“比较器-i;ascii数字”];

   # Send a copy to my cell phone to be delivered before 10PM
   if currentdate :value "lt"
                  :comparator "i;ascii-numeric" "hour" "22"
   {
       if currentdate :matches "date" "*" {set "date" "${0}";}
       if currentdate :matches "zone" "*" {set "zone" "${0}";}
       redirect :copy :bytimeabsolute "${date}T20:00:00${zone}"
                :bymode "return" "cellphone@example.com";
   }
        
   # Send a copy to my cell phone to be delivered before 10PM
   if currentdate :value "lt"
                  :comparator "i;ascii-numeric" "hour" "22"
   {
       if currentdate :matches "date" "*" {set "date" "${0}";}
       if currentdate :matches "zone" "*" {set "zone" "${0}";}
       redirect :copy :bytimeabsolute "${date}T20:00:00${zone}"
                :bymode "return" "cellphone@example.com";
   }
        
8. Security Considerations
8. 安全考虑

The envelope-dsn and envelope-deliverby extensions provide access to additional message envelope information. This is not believed to raise any additional security issues beyond those for the Sieve "envelope" test.

信封dsn和信封投递扩展提供了对其他邮件信封信息的访问。除了筛子“信封”测试之外,这不会引起任何额外的安全问题。

The redirect-dsn extension allows specification of the delivery status notification's NOTIFY parameter, which can cause the generation of notification messages that might otherwise not be generated, especially if notification in the event of successful delivery is required. Sites that limit the ability to request success notifications will also need to restrict the ability to request them using the redirect-dsn extension.

重定向dsn扩展允许指定传递状态通知的NOTIFY参数,这可能会导致生成可能无法生成的通知消息,特别是在需要在成功传递时发出通知的情况下。限制请求成功通知能力的站点还需要限制使用重定向dsn扩展请求成功通知的能力。

Similarly, the redirect-deliverby extension is used to control how long the transport infrastructure will continue to attempt to deliver a message before giving up, which could result in the generation of additional notification messages. While the underlying Deliver-By extension does have a minimum by-time limit, sites may wish to impose additional limits on the minimum by-time allowed in a redirect action.

类似地,redirect deliverby扩展用于控制传输基础结构在放弃之前继续尝试传递消息的时间,这可能导致生成额外的通知消息。虽然基础的“按扩展交付”确实有一个“按时间最小”限制,但站点可能希望对重定向操作中允许的“按时间最小”施加额外限制。

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

基本筛规范中给出的所有安全注意事项也适用于此扩展。

9. IANA Considerations
9. IANA考虑

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 extensions

致:iana@iana.org主题:新筛网扩展的注册

Capability name: envelope-dsn Description: The "envelope-dsn" extension extends the envelope test to allow checking of information associated with the DSN ESMTP extension defined in RFC 3461. RFC number: RFC 6009 Contact address: Sieve discussion list <sieve@ietf.org>

功能名称:信封dsn说明:“信封dsn”扩展扩展信封测试,以允许检查与RFC 3461中定义的dsn ESMTP扩展相关的信息。RFC编号:RFC 6009联系地址:筛讨论列表<sieve@ietf.org>

Capability name: envelope-deliverby Description: The "envelope-deliverby" extension extends the envelope test to allow checking of information associated with the Deliver-By ESMTP extension defined in RFC 2852. RFC number: RFC 6009 Contact address: Sieve discussion list <sieve@ietf.org>

功能名称:信封交付方式说明:“信封交付方式”扩展扩展了信封测试,以允许检查与RFC 2852中定义的“通过ESMTP交付”扩展相关的信息。RFC编号:RFC 6009联系地址:筛讨论列表<sieve@ietf.org>

Capability name: redirect-dsn Description: The "redirect-dsn" extension extends the redirect action to allow specification of the NOTIFY and RET ESMTP parameters associated with the DSN SMTP extension defined in RFC 3461. RFC number: RFC 6009 Contact address: Sieve discussion list <sieve@ietf.org>

功能名称:重定向dsn说明:“重定向dsn”扩展扩展重定向操作,以允许指定与RFC 3461中定义的dsn SMTP扩展相关联的NOTIFY和RET ESMTP参数。RFC编号:RFC 6009联系地址:筛讨论列表<sieve@ietf.org>

Capability name: redirect-deliverby Description: The "redirect-deliverby" extension extends the redirect action to allow specification of the BY ESMTP parameter associated with the Deliver-By SMTP extension defined in RFC 2852. RFC number: RFC 6009 Contact address: Sieve discussion list <sieve@ietf.org>

功能名称:redirect deliverby描述:“redirect deliverby”扩展扩展了重定向操作,以允许指定与RFC 2852中定义的Deliver BY SMTP扩展关联的BY ESMTP参数。RFC编号:RFC 6009联系地址:筛讨论列表<sieve@ietf.org>

This information has been added to the list of Sieve extensions available from http://www.iana.org.

此信息已添加到可从中获得的筛网扩展列表中http://www.iana.org.

10. References
10. 工具书类
10.1. Normative References
10.1. 规范性引用文件

[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月。

[RFC2852] Newman, D., "Deliver By SMTP Service Extension", RFC 2852, June 2000.

[RFC2852]Newman,D.,“通过SMTP服务扩展交付”,RFC 2852000年6月。

[RFC3339] Klyne, G., Ed. and C. Newman, "Date and Time on the Internet: Timestamps", RFC 3339, July 2002.

[RFC3339]Klyne,G.,Ed.和C.Newman,“互联网上的日期和时间:时间戳”,RFC33392002年7月。

[RFC3461] Moore, K., "Simple Mail Transfer Protocol (SMTP) Service Extension for Delivery Status Notifications (DSNs)", RFC 3461, January 2003.

[RFC3461]Moore,K.,“用于传递状态通知(DSN)的简单邮件传输协议(SMTP)服务扩展”,RFC 3461,2003年1月。

[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月。

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

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

[RFC5321] Klensin, J., "Simple Mail Transfer Protocol", RFC 5321, October 2008.

[RFC5321]Klensin,J.,“简单邮件传输协议”,RFC 53212008年10月。

[RFC5322] Resnick, P., Ed., "Internet Message Format", RFC 5322, October 2008.

[RFC5322]Resnick,P.,Ed.“互联网信息格式”,RFC5222008年10月。

10.2. Informative References
10.2. 资料性引用

[RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1", RFC 3501, March 2003.

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

[RFC3894] Degener, J., "Sieve Extension: Copying Without Side Effects", RFC 3894, October 2004.

[RFC3894]Degener,J.,“筛子扩展:无副作用的复制”,RFC 38942004年10月。

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

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

[RFC5260] Freed, N., "Sieve Email Filtering: Date and Index Extensions", RFC 5260, July 2008.

[RFC5260]Freed,N.,“筛选电子邮件过滤:日期和索引扩展”,RFC 52602008年7月。

Appendix A. Acknowledgements
附录A.确认书

Cyrus Daboo, Derek Diget, Philip Guenther, Arnt Gulbrandsen, Tero Kivinen, Barry Leiba, Andrew McKeon, Alexey Melnikov, Chris Newman, Aaron Stone, and Alexandros Vellis provided helpful suggestions and corrections.

赛勒斯·达布、德里克·迪吉特、菲利普·根瑟、阿恩特·古尔布兰森、泰罗·基维宁、巴里·莱巴、安德鲁·麦基恩、阿列克谢·梅尔尼科夫、克里斯·纽曼、艾伦·斯通和亚历山德罗斯·维利斯提供了有益的建议和更正。

Author's Address

作者地址

Ned Freed Oracle 800 Royal Oaks Monrovia, CA 91016-6347 USA

美国加利福尼亚州蒙罗维亚皇家橡树园800号,邮编91016-6347

   EMail: ned.freed@mrochek.com
        
   EMail: ned.freed@mrochek.com