Internet Engineering Task Force (IETF)                          B. Leiba
Request for Comments: 6785                           Huawei Technologies
Updates: 5228                                              November 2012
Category: Standards Track
ISSN: 2070-1721
        
Internet Engineering Task Force (IETF)                          B. Leiba
Request for Comments: 6785                           Huawei Technologies
Updates: 5228                                              November 2012
Category: Standards Track
ISSN: 2070-1721
        

Support for Internet Message Access Protocol (IMAP) Events in Sieve

在Sieve中支持Internet消息访问协议(IMAP)事件

Abstract

摘要

Sieve defines an email filtering language that can, in principle, plug into any point in the processing of an email message. As defined in the base specification, it plugs into mail delivery. This document defines how Sieve can plug into points in IMAP where messages are created or changed, adding the option of user-defined or installation-defined filtering (or, with Sieve extensions, features such as notifications). Because this requires future Sieve extensions to specify their interactions with this one, this document updates the base Sieve specification, RFC 5228.

Sieve定义了一种电子邮件过滤语言,原则上可以插入电子邮件处理过程中的任何一点。根据基本规范中的定义,它插入邮件传递。本文档定义了Sieve如何插入IMAP中创建或更改消息的点,并添加了用户定义或安装定义的过滤选项(或者,使用Sieve扩展,添加通知等功能)。因为这需要未来的筛子扩展来指定它们与这个筛子的交互,所以本文档更新了基本筛子规范RFC 5228。

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/rfc6785.

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

Copyright Notice

版权公告

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

版权所有(c)2012 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
      1.1. Overview ...................................................3
      1.2. Differences between IMAP Events and Mail Delivery ..........4
      1.3. Conventions Used in This Document ..........................5
   2. The "IMAP Events in Sieve" Extension ............................5
      2.1. The "imapsieve" Capability Strings .........................5
      2.2. Existing IMAP Functions Affected by IMAP Events in Sieve ...5
           2.2.1. The IMAP APPEND Command .............................6
           2.2.2. The IMAP COPY Command ...............................6
           2.2.3. Changes to IMAP Message Flags .......................6
           2.2.4. When Script Actions Set the \Deleted Flag ...........7
      2.3. New Functions Defined by IMAP Events in Sieve ..............7
           2.3.1. Interaction with Metadata ...........................7
   3. Applicable Sieve Actions and Interactions .......................8
      3.1. The Implicit Keep ..........................................9
      3.2. The "keep" Action ..........................................9
      3.3. The "fileinto" Action ......................................9
      3.4. The "redirect" Action ......................................9
      3.5. The "discard" Action ......................................10
      3.6. The "notify" Action .......................................10
      3.7. The "addheader" and "deleteheader" Actions ................10
      3.8. The "setflag", "deleteflag", and "removeflag" Actions .....11
      3.9. MIME Part Tests and Replacement ...........................11
      3.10. spamtest and virustest ...................................11
      3.11. Inapplicable Actions .....................................11
      3.12. Future Sieve Actions .....................................12
        
   1. Introduction ....................................................3
      1.1. Overview ...................................................3
      1.2. Differences between IMAP Events and Mail Delivery ..........4
      1.3. Conventions Used in This Document ..........................5
   2. The "IMAP Events in Sieve" Extension ............................5
      2.1. The "imapsieve" Capability Strings .........................5
      2.2. Existing IMAP Functions Affected by IMAP Events in Sieve ...5
           2.2.1. The IMAP APPEND Command .............................6
           2.2.2. The IMAP COPY Command ...............................6
           2.2.3. Changes to IMAP Message Flags .......................6
           2.2.4. When Script Actions Set the \Deleted Flag ...........7
      2.3. New Functions Defined by IMAP Events in Sieve ..............7
           2.3.1. Interaction with Metadata ...........................7
   3. Applicable Sieve Actions and Interactions .......................8
      3.1. The Implicit Keep ..........................................9
      3.2. The "keep" Action ..........................................9
      3.3. The "fileinto" Action ......................................9
      3.4. The "redirect" Action ......................................9
      3.5. The "discard" Action ......................................10
      3.6. The "notify" Action .......................................10
      3.7. The "addheader" and "deleteheader" Actions ................10
      3.8. The "setflag", "deleteflag", and "removeflag" Actions .....11
      3.9. MIME Part Tests and Replacement ...........................11
      3.10. spamtest and virustest ...................................11
      3.11. Inapplicable Actions .....................................11
      3.12. Future Sieve Actions .....................................12
        
   4. Interaction with Sieve Environment .............................12
      4.1. Base Sieve Environment Items: location and phase ..........12
      4.2. New Sieve Environment Items: imap.user and imap.email .....12
      4.3. New Sieve Environment Item: imap.cause ....................13
      4.4. New Sieve Environment Item: imap.mailbox ..................13
      4.5. New Sieve Environment Item: imap.changedflags .............13
      4.6. Interaction with Sieve Tests (Comparisons) ................13
   5. Examples .......................................................14
   6. Security Considerations ........................................15
   7. IANA Considerations ............................................16
      7.1. Registration of "imapsieve" IMAP Capability ...............16
      7.2. Registration of "imapsieve" Sieve Extension ...............16
      7.3. Registration of Sieve Environment Items ...................16
           7.3.1. Registration of Sieve Environment Item:
                  imap.cause .........................................16
           7.3.2. Registration of Sieve Environment Item:
                  imap.mailbox .......................................17
           7.3.3. Registration of Sieve Environment Item:
                  imap.changedflags ..................................17
           7.3.4. Registration of Sieve Environment Item: imap.user ..17
           7.3.5. Registration of Sieve Environment Item:
                  imap.email .........................................17
      7.4. Registration of IMAP METADATA Mailbox Entry Name ..........18
      7.5. Registration of IMAP METADATA Server Entry Name ...........18
   8. References .....................................................18
      8.1. Normative References ......................................18
      8.2. Informative References ....................................19
        
   4. Interaction with Sieve Environment .............................12
      4.1. Base Sieve Environment Items: location and phase ..........12
      4.2. New Sieve Environment Items: imap.user and imap.email .....12
      4.3. New Sieve Environment Item: imap.cause ....................13
      4.4. New Sieve Environment Item: imap.mailbox ..................13
      4.5. New Sieve Environment Item: imap.changedflags .............13
      4.6. Interaction with Sieve Tests (Comparisons) ................13
   5. Examples .......................................................14
   6. Security Considerations ........................................15
   7. IANA Considerations ............................................16
      7.1. Registration of "imapsieve" IMAP Capability ...............16
      7.2. Registration of "imapsieve" Sieve Extension ...............16
      7.3. Registration of Sieve Environment Items ...................16
           7.3.1. Registration of Sieve Environment Item:
                  imap.cause .........................................16
           7.3.2. Registration of Sieve Environment Item:
                  imap.mailbox .......................................17
           7.3.3. Registration of Sieve Environment Item:
                  imap.changedflags ..................................17
           7.3.4. Registration of Sieve Environment Item: imap.user ..17
           7.3.5. Registration of Sieve Environment Item:
                  imap.email .........................................17
      7.4. Registration of IMAP METADATA Mailbox Entry Name ..........18
      7.5. Registration of IMAP METADATA Server Entry Name ...........18
   8. References .....................................................18
      8.1. Normative References ......................................18
      8.2. Informative References ....................................19
        
1. Introduction
1. 介绍
1.1. Overview
1.1. 概述

Some applications have a need to apply Sieve filters [RFC5228] in contexts other than initial mail delivery. This is especially true in diverse service environments, such as when the client is sporadically connected, is connected through a high-latency or high-cost channel, or is on a limited-function device. For such clients, it may be very important, for higher performance and reliability, to take advantage of server capabilities, including those provided by Sieve filtering (and Sieve extensions, such as Notify [RFC5435]).

有些应用程序需要在初始邮件交付以外的上下文中应用筛滤器[RFC5228]。在不同的服务环境中尤其如此,例如客户端偶尔连接、通过高延迟或高成本通道连接,或者在功能有限的设备上。对于此类客户机,为了获得更高的性能和可靠性,利用服务器功能可能非常重要,包括由筛选筛选(和筛选扩展,如Notify[RFC5435])提供的功能。

This specification defines extensions to IMAP [RFC3501] to support the invocation of Sieve scripts at times when the IMAP server creates new messages or modifies existing ones. It also defines how Sieve scripts will process these invocations. Support for IMAP events in Sieve also requires support for the following:

本规范定义了对IMAP[RFC3501]的扩展,以支持在IMAP服务器创建新消息或修改现有消息时调用筛选脚本。它还定义了筛脚本将如何处理这些调用。在Sieve中支持IMAP事件还需要支持以下内容:

o IMAP Metadata [RFC5464], because Metadata is used to associate scripts with IMAP mailboxes.

o IMAP元数据[RFC5464],因为元数据用于将脚本与IMAP邮箱关联。

o Sieve Environment [RFC5183], because it defines an important way for Sieve scripts to test the conditions under which they have been invoked.

o Sieve环境[RFC5183],因为它为Sieve脚本定义了一种重要的方法来测试它们被调用的条件。

o Sieve imap4flags [RFC5232], because it provides important functionality in handling IMAP events related to flag changes.

o 筛选imap4flags[RFC5232],因为它在处理与标志更改相关的IMAP事件时提供了重要功能。

Because this requires future Sieve extensions to specify their interactions with this one (see Section 3.12), this document updates the base Sieve specification, RFC 5228.

因为这需要未来的筛子扩展来指定它们与此筛子的相互作用(见第3.12节),所以本文件更新了基本筛子规范RFC 5228。

1.2. Differences between IMAP Events and Mail Delivery
1.2. IMAP事件和邮件传递之间的差异

Invoking Sieve scripts in a context other than initial mail delivery introduces new situations; this changes the applicability of Sieve features, creates implementation challenges, and creates user interface issues. This section discusses some of those differences, challenges, and issues.

在初始邮件交付以外的上下文中调用筛选脚本会引入新的情况;这改变了Sieve特性的适用性,带来了实现挑战,并带来了用户界面问题。本节讨论其中的一些差异、挑战和问题。

At times other than message delivery, delivery "envelope" information might not be available. With messages added through IMAP APPEND, there might be no way to even guess who the intended recipient is, and no concept of who "sent" the message. Sieve actions that relate to contacting the sender, for example, will not be applicable.

在邮件传递以外的时间,传递“信封”信息可能不可用。对于通过IMAP APPEND添加的消息,甚至可能无法猜测预期收件人是谁,也无法知道是谁“发送”了消息。例如,与联系发件人相关的筛选操作将不适用。

Because IMAP events will often be triggered by user actions, and because user interfaces allow bulk actions that differ from individual message arrival, it now becomes possible for a single user action, such as drag-and-drop, to initiate Sieve script processing on a large number of messages at once. Implementations will have to deal with such situations as a "COPY" action or flag changes on dozens, or even thousands, of messages.

由于IMAP事件通常由用户操作触发,并且由于用户界面允许与单个消息到达不同的批量操作,因此现在可以通过单个用户操作(如拖放)一次对大量消息启动筛选脚本处理。实现将必须处理诸如“复制”操作或在数十条甚至数千条消息上标记更改之类的情况。

Other issues might surface as this extension is deployed and experience with it develops.

随着此扩展的部署和经验的积累,可能会出现其他问题。

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

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]中所述进行解释。

2. The "IMAP Events in Sieve" Extension
2. “筛选中的IMAP事件”扩展
2.1. The "imapsieve" Capability Strings
2.1. “imapsieve”功能字符串

An IMAP server advertises support for IMAP events in Sieve through the "imapsieve" capability. A server that advertises "imapsieve" is claiming to be in compliance with this specification in all aspects. The syntax of the "imapsieve" capability string is defined as follows:

IMAP服务器通过“imapsieve”功能在Sieve中宣传对IMAP事件的支持。广告“imapsieve”的服务器声称在所有方面都符合本规范。“imapsieve”功能字符串的语法定义如下:

   capability /=  "IMAPSIEVE=" sieveurl-server
           ; <sieveurl-server> is defined in RFC 5804, Section 3
        
   capability /=  "IMAPSIEVE=" sieveurl-server
           ; <sieveurl-server> is defined in RFC 5804, Section 3
        

Only one "imapsieve" capability string, specifying one sieveurl-server, is allowed to be present. The sieveurl-server identifies the ManageSieve server that clients need to contact for managing Sieve scripts associated with this IMAP server.

只允许存在一个“imapsieve”功能字符串,指定一个sieverl服务器。SiveEURL服务器标识客户端需要联系的ManageSeeve服务器,以管理与此IMAP服务器关联的筛脚本。

The corresponding Sieve implementation uses the Sieve capability string "imapsieve", and Sieve scripts that depend upon the IMAP events MUST include that string in their "required" lists.

相应的Sieve实现使用Sieve功能字符串“imapsieve”,依赖于IMAP事件的Sieve脚本必须在其“必需”列表中包含该字符串。

Implementations that support IMAP events in Sieve MUST also support IMAP Metadata [RFC5464] and Sieve Environment [RFC5183], because Metadata is used to associate scripts with IMAP mailboxes and Environment defines an important way for Sieve scripts to test the conditions under which they have been invoked. Notwithstanding the support requirement, scripts that directly use Environment MUST also include its capability string in their "required" lists.

在Sieve中支持IMAP事件的实现还必须支持IMAP元数据[RFC5464]和Sieve环境[RFC5183],因为元数据用于将脚本与IMAP邮箱关联,而环境为Sieve脚本定义了一种重要的方法来测试调用它们的条件。尽管有支持要求,但直接使用环境的脚本也必须在其“必需”列表中包含其功能字符串。

2.2. Existing IMAP Functions Affected by IMAP Events in Sieve
2.2. 受Sieve中IMAP事件影响的现有IMAP函数

The subsections below describe in detail the IMAP commands and situations on which IMAP events in Sieve have an effect. Not all Sieve actions make sense in the case of messages affected by IMAP commands. See Section 3 for details.

下面的小节详细描述了IMAP命令和SIVE中IMAP事件的影响情况。对于受IMAP命令影响的消息,并非所有筛选操作都有意义。详见第3节。

It's important to note that since the base Sieve specification (see [RFC5228]) and its extensions define functions for scripts that are invoked during initial mail delivery, those function definitions are necessarily tailored to and limited by that context. This document extends those function definitions for use during IMAP events. By

需要注意的是,由于基本筛选规范(请参见[RFC5228])及其扩展为在初始邮件传递期间调用的脚本定义了函数,因此这些函数定义必须根据该上下文进行定制和限制。本文档扩展了这些函数定义,以便在IMAP事件期间使用。通过

nature of that, Sieve functions, in this extended context, may behave somewhat differently, though their extended behavior will still be consistent with the functions' goals.

本质上,在这种扩展上下文中,筛选函数的行为可能有所不同,尽管它们的扩展行为仍然与函数的目标一致。

If more than one message is affected at the same time, each message triggers the execution of a Sieve script separately. The scripts MAY be run in parallel.

如果一条以上的消息同时受到影响,则每条消息分别触发一个筛选脚本的执行。这些脚本可以并行运行。

2.2.1. The IMAP APPEND Command
2.2.1. IMAP APPEND命令

A message may be added to a mailbox through the IMAP APPEND command. In a server that advertises "imapsieve", new messages added in this way MUST trigger the execution of a Sieve script, subject to the settings defined through Metadata (see Section 2.3.1).

可以通过IMAP APPEND命令将邮件添加到邮箱。在播发“imapsieve”的服务器中,以这种方式添加的新消息必须触发筛选脚本的执行,这取决于通过元数据定义的设置(参见第2.3.1节)。

If the IMAP server also supports the IMAP MULTIAPPEND extension [RFC3502], the APPEND command can create more than one message at a time. In that case, each message creation is considered a separate event, and any applicable Sieve script is called once for each message.

如果IMAP服务器还支持IMAP MULTIAPPEND扩展[RFC3502],APPEND命令一次可以创建多条消息。在这种情况下,每个消息创建都被视为一个单独的事件,并且对每个消息调用一次任何适用的Sieve脚本。

2.2.2. The IMAP COPY Command
2.2.2. IMAP COPY命令

One or more messages may be added to a mailbox through the IMAP COPY command. In a server that advertises "imapsieve", new messages added in this way MUST trigger the execution of a Sieve script, subject to the settings defined through Metadata.

可以通过IMAP COPY命令将一封或多封邮件添加到邮箱中。在播发“imapsieve”的服务器中,以这种方式添加的新消息必须触发筛选脚本的执行,这取决于通过元数据定义的设置。

2.2.3. Changes to IMAP Message Flags
2.2.3. 对IMAP消息标志的更改

One or more existing messages can have their flags changed in a number of ways, including:

一个或多个现有邮件可以通过多种方式更改其标志,包括:

o The FETCH command (may cause the \Seen flag to be set).

o FETCH命令(可能导致设置\Seen标志)。

o The STORE command (may cause the \Answered, \Deleted, \Draft, \Flagged, and \Seen flags to be set or reset, and may cause keywords to be set or reset).

o STORE命令(可能导致设置或重置\response、\Deleted、\Draft、\Flagged和\Seen标志,并可能导致设置或重置关键字)。

o The invocation of a Sieve script on an existing message, where the script uses one of the actions defined in the imap4flags extension [RFC5232] to change the flags.

o 对现有消息调用筛选脚本,脚本使用imap4flags扩展[RFC5232]中定义的操作之一更改标志。

In a server that advertises "imapsieve", messages whose flags are changed in any way (except as explained in the next sentence) MUST trigger the execution of a Sieve script, subject to the settings defined through Metadata. The exception is that in order to avoid script loops, flag changes that are made as a result of a script that

在播发“imapsieve”的服务器中,其标志以任何方式更改的消息(下一句中解释的除外)必须触发筛选脚本的执行,这取决于通过元数据定义的设置。例外情况是,为了避免脚本循环,标记由于脚本

was itself invoked because of flag changes SHOULD NOT result in a further invocation of the script. In any case, implementations MUST take steps to avoid such loops.

由于标志更改而调用的本身不应导致进一步调用脚本。在任何情况下,实现都必须采取措施避免这种循环。

For flag-change events, the Sieve script will see the message flags as they are AFTER the changes.

对于标志更改事件,Sieve脚本将看到更改后的消息标志。

2.2.4. When Script Actions Set the \Deleted Flag
2.2.4. 当脚本操作设置\Deleted标志时

There are times when the actions "fileinto" (see Section 3.3), "redirect" (see Section 3.4), and "discard" (see Section 3.5) will set the \Deleted flag on the message. In those cases, the following apply:

有时,操作“fileinto”(参见第3.3节)、“redirect”(参见第3.4节)和“discard”(参见第3.5节)将在消息上设置\Deleted标志。在这些情况下,以下各项适用:

When the \Deleted flag is set by the script, a flag-change Sieve script is not invoked.

当脚本设置\已删除标志时,不会调用标志更改脚本。

The implementation MAY then expunge the original message (WITHOUT expunging other messages in the mailbox). Alternatively, it might have expunges batched or done by a user. (It might be helpful to allow the user to make this choice through a preference.)

然后,实现可以删除原始邮件(而不删除邮箱中的其他邮件)。或者,它可能已批量删除或由用户完成。(允许用户通过首选项进行选择可能会有所帮助。)

If the server does the expunge, the effect is as though a client had flagged the message and done a UID EXPUNGE (see [RFC4315]) on the affected message(s) only. Handling it this way allows clients to handle messages consistently and avoids hidden changes that might invalidate their message caches.

如果服务器执行删除操作,其效果就好像客户端标记了消息并仅对受影响的消息执行了UID删除(请参见[RFC4315])。通过这种方式处理,客户端可以一致地处理消息,并避免可能使其消息缓存失效的隐藏更改。

2.3. New Functions Defined by IMAP Events in Sieve
2.3. Sieve中IMAP事件定义的新函数
2.3.1. Interaction with Metadata
2.3.1. 与元数据的交互

Support for IMAP events in Sieve requires support for IMAP Metadata [RFC5464] as well, since the latter is used to associate scripts with IMAP mailboxes.

在Sieve中支持IMAP事件还需要支持IMAP元数据[RFC5464],因为后者用于将脚本与IMAP邮箱关联。

When an applicable event occurs on an IMAP mailbox, if there is an IMAP metadata entry named "/shared/imapsieve/script" for the mailbox, that entry is used. If there is not, but there is an IMAP metadata entry named "/shared/imapsieve/script" for the server, that entry is used (providing a way to define a global script for all mailboxes on a server). If neither entry exists, then no script will be invoked.

当IMAP邮箱上发生适用事件时,如果邮箱中有名为“/shared/imapsieve/script”的IMAP元数据条目,则使用该条目。如果服务器没有,但有一个名为“/shared/imapsieve/script”的IMAP元数据条目,则使用该条目(提供一种为服务器上的所有邮箱定义全局脚本的方法)。如果两个条目都不存在,则不会调用脚本。

If a "/shared/imapsieve/script" metadata entry was selected above, its value is used as the name of the Sieve script that will be invoked in response to the IMAP event. If the value is empty, then no script is run. The selection of which metadata entry to use

如果上面选择了“/shared/imapsieve/script”元数据条目,则其值将用作将在响应IMAP事件时调用的筛选脚本的名称。如果该值为空,则不运行脚本。选择要使用的元数据项

happens before any examination of the contents of the entry. If the mailbox entry is selected and is then found to be unusable or empty, the server entry is not used as a backup: no script is run.

在对条目内容进行任何检查之前发生。如果选择了邮箱条目,然后发现该条目不可用或为空,则不会将该服务器条目用作备份:不会运行任何脚本。

This specifies the mechanism for "activating" a script for a given mailbox (or for all mailboxes) but does not specify a mechanism for creating, storing, or validating the script. Implementations MUST support ManageSieve [RFC5804] and can use the PUTSCRIPT command to store the script without using the SETACTIVE command to activate it.

这指定了用于“激活”给定邮箱(或所有邮箱)脚本的机制,但未指定用于创建、存储或验证脚本的机制。实现必须支持ManageSife[RFC5804],并且可以使用PUTSCRIPT命令存储脚本,而无需使用SETACTIVE命令激活脚本。

Script names used in "/shared/imapsieve/script" metadata entries are the script names used on the corresponding ManageSieve server. If a "/shared/imapsieve/script" metadata entry contains a script name that doesn't exist in the ManageSieve server, then no Sieve script will be invoked for IMAP Sieve events.

“/shared/imapsieve/Script”元数据项中使用的脚本名称是在相应的ManageSeve服务器上使用的脚本名称。如果“/shared/imapsieve/script”元数据条目包含ManageSeve服务器中不存在的脚本名称,则不会为IMAP筛选事件调用筛选脚本。

Only one Sieve script may currently be defined per mailbox, eliminating the complexity and possible ambiguity involved with coordinating the results of multiple scripts. Any sub-filtering is done in the Sieve script. For example, if it's only necessary to deal with flag changes, but not with new messages appended or copied, the Sieve script will still be invoked for all events, and the script is responsible for checking the event type.

每个邮箱当前只能定义一个筛选脚本,消除了协调多个脚本结果所涉及的复杂性和可能的模糊性。任何子筛选都是在Sieve脚本中完成的。例如,如果只需要处理标志更改,而不需要添加或复制新消息,则仍然会为所有事件调用Sieve脚本,并且该脚本负责检查事件类型。

The possibility is open for an extension to add support for multiple scripts -- for example, per-client scripts on a multi-client user's inbox, or per-user scripts on a mailbox that is shared among users.

扩展可以添加对多个脚本的支持,例如,多客户端用户收件箱中的每客户端脚本,或用户之间共享的邮箱中的每用户脚本。

Because this metadata name is associated with the mailbox, there can (and it's expected that there will) be different scripts associated with events for different mailboxes. Indeed, most mailboxes will probably invoke no script at all.

由于此元数据名称与邮箱相关联,因此可以(并且预期会)有不同的脚本与不同邮箱的事件相关联。实际上,大多数邮箱可能根本不会调用脚本。

3. Applicable Sieve Actions and Interactions
3. 适用的筛分作用和相互作用

Since some Sieve actions relate specifically to the delivery of mail, not all actions and extensions make sense when the messages are created by other means or when changes are made to data associated with existing messages. This section describes how actions in the base Sieve specification, and those in extensions known at the time of this writing, relate to this specification.

由于某些筛选操作专门与邮件传递相关,因此当通过其他方式创建邮件或更改与现有邮件相关的数据时,并非所有操作和扩展都有意义。本节描述基本筛规范中的操作以及撰写本文时已知的扩展中的操作如何与本规范相关。

In addition to what is specified here, interactions noted in the individual specifications apply and must be considered.

除此处规定的内容外,各规范中注明的相互作用也适用,必须予以考虑。

3.1. The Implicit Keep
3.1. 隐性保留

For all cases that fall under IMAP events in Sieve, the implicit keep means that the message is treated as it would have been if no Sieve script were run. For APPEND and COPY, the message is stored into the target mailbox normally. For flag changes, the message is left in the mailbox. If actions have been taken that change the message, those changes are considered transient and MUST NOT be retained for any "keep" action (because IMAP messages are immutable). No error is generated, but the original message, without the changes, is kept.

对于Sieve中属于IMAP事件的所有情况,隐式keep意味着,如果没有运行Sieve脚本,则消息将被视为原始消息。对于附加和复制,邮件通常存储在目标邮箱中。对于标志更改,邮件保留在邮箱中。如果已采取更改消息的操作,则这些更改被视为暂时的,并且不得为任何“保留”操作保留这些更改(因为IMAP消息是不可变的)。不会生成任何错误,但保留原始消息,不进行更改。

3.2. The "keep" Action
3.2. “保持”行动

The "keep" action is applicable in all cases that fall under IMAP events in Sieve. Its behavior is as described for implicit keep, in Section 3.1.

“保留”操作适用于SIFE中属于IMAP事件的所有情况。其行为如第3.1节中关于隐式保持的描述。

3.3. The "fileinto" Action
3.3. “fileinto”操作

If the Sieve implementation supports the "fileinto" action, that action is applicable in all cases that fall under IMAP events in Sieve. If the "copy" extension [RFC3894] is available and the :copy option is specified, the implicit keep is retained; otherwise, fileinto cancels the implicit keep, as specified in the base Sieve specification.

如果Sieve实现支持“fileinto”操作,则该操作适用于Sieve中属于IMAP事件的所有情况。如果“复制”扩展名[RFC3894]可用并且指定了:copy选项,则隐式保留被保留;否则,fileinto将取消隐式保留,如基本筛选规范中所指定。

For APPEND and COPY, the message is stored into the fileinto mailbox IN ADDITION TO the original target mailbox. For flag changes, the message is COPIED into the fileinto mailbox, without removing the original. In all cases, fileinto always creates a new message, separate from the original.

对于附加和复制,邮件除了存储在原始目标邮箱中之外,还存储在fileinto邮箱中。对于标志更改,将邮件复制到fileinto邮箱中,而不删除原始邮件。在所有情况下,fileinto总是创建一条新消息,与原始消息分开。

The "fileinto" action is not an IMAP APPEND or COPY and therefore does not result in a subsequent event (see also the Security Considerations, Section 6).

“fileinto”操作不是IMAP追加或复制,因此不会导致后续事件(另请参见第6节的安全注意事项)。

If a "keep" action is not also in effect, the original message is then marked with the \Deleted flag (see Section 2.2.4).

如果“保留”操作未生效,则原始消息将标记为\Deleted标志(见第2.2.4节)。

3.4. The "redirect" Action
3.4. “重定向”行动

The "redirect" action is applicable in all cases that fall under IMAP events in Sieve. It causes the message to be sent, as specified in the base Sieve specification, to the designated address. If the "copy" extension [RFC3894] is available and the :copy option is specified, the implicit keep is retained; otherwise, redirect cancels the implicit keep, as specified in the base Sieve specification.

“重定向”操作适用于Sieve中属于IMAP事件的所有情况。它使消息按照基本筛规范的规定发送到指定的地址。如果“复制”扩展名[RFC3894]可用并且指定了:copy选项,则隐式保留被保留;否则,重定向将取消隐式保留,如基本筛选规范中所指定。

It's possible that a message processed in this way does not have the information necessary to be redirected properly. It might lack necessary header information, and there might not be appropriate information for the MAIL FROM command. In such cases, the "redirect" action uses message submission [RFC6409], and it is up to the Sieve engine to supply the missing information. The redirect address is, of course, used for the "RCPT TO", and the "MAIL FROM" SHOULD be set to the address of the owner of the mailbox. The message submission server is allowed, according to the message submission protocol, to perform necessary fix-up to the message (see Section 8 of RFC 6409). It can also reject the submission attempt if the message is too ill-formed for submission.

以这种方式处理的消息可能没有正确重定向所需的信息。它可能缺少必要的头信息,并且可能没有适用于MAIL FROM命令的信息。在这种情况下,“重定向”操作使用消息提交[RFC6409],由筛选引擎提供缺少的信息。当然,重定向地址用于“RCPT-TO”,而“MAIL-FROM”应该设置为邮箱所有者的地址。根据消息提交协议,允许消息提交服务器对消息执行必要的修复(请参阅RFC 6409第8节)。如果消息格式太差,无法提交,它还可以拒绝提交尝试。

For APPEND and COPY, the message is stored into the target mailbox in addition to being redirected. For flag changes, the message remains in its original mailbox.

对于附加和复制,邮件除了被重定向外,还被存储到目标邮箱中。对于标志更改,邮件将保留在其原始邮箱中。

If a "keep" action is not also in effect, the original message is then marked with the \Deleted flag (see Section 2.2.4).

如果“保留”操作未生效,则原始消息将标记为\Deleted标志(见第2.2.4节)。

3.5. The "discard" Action
3.5. “放弃”行动

The "discard" action is applicable in all cases that fall under IMAP events in Sieve. For APPEND and COPY, the message is first stored into the target mailbox. If an explicit "keep" action is also in effect, the "discard" action now does nothing. Otherwise, the original message is then marked with the \Deleted flag (see Section 2.2.4).

“放弃”操作适用于SIFE中属于IMAP事件的所有情况。对于附加和复制,邮件首先存储到目标邮箱中。如果显式的“保留”操作也有效,“放弃”操作现在不起任何作用。否则,原始消息将被标记为\已删除标志(见第2.2.4节)。

3.6. The "notify" Action
3.6. “通知”行动

If the Sieve notify extension [RFC5435] is available, the "notify" action is applicable in all cases that fall under IMAP events in Sieve. The result is that the requested notification is sent and that the message is otherwise handled as it would normally have been.

如果Sieve notify扩展[RFC5435]可用,“notify”操作适用于Sieve中属于IMAP事件的所有情况。其结果是发送请求的通知,并以正常方式处理消息。

3.7. The "addheader" and "deleteheader" Actions
3.7. “addheader”和“deleteheader”操作

If the editheader extension [RFC5293] is available, it can be used to make transient changes to header fields, which aren't saved in place, such as for "redirect" or "fileinto" actions. Because messages in IMAP mailboxes are immutable, such changes are not applicable for the "keep" action (explicit or implicit). See Section 3.1.

如果editheader扩展[RFC5293]可用,则可以使用它对未保存到位的标题字段进行临时更改,例如“重定向”或“文件导入”操作。由于IMAP邮箱中的消息是不可变的,因此此类更改不适用于“保留”操作(显式或隐式)。见第3.1节。

3.8. The "setflag", "deleteflag", and "removeflag" Actions
3.8. “setflag”、“deleteflag”和“removeflag”操作

Implementations of IMAP events in Sieve MUST also support the imap4flags extension [RFC5232], and the actions associated with it are all applicable to any case that falls under IMAP events in Sieve.

Sieve中IMAP事件的实现还必须支持imap4flags扩展[RFC5232],与之相关的操作都适用于Sieve中属于IMAP事件的任何情况。

It is worth noting also that the "hasflag" test that is defined in the imap4flags extension might be particularly useful in scripts triggered by flag changes ("hasflag" will see the new, changed flags). The flag changes behave as though a client had made the change.

还值得注意的是,imap4flags扩展中定义的“hasflag”测试在由标志更改触发的脚本中可能特别有用(“hasflag”将看到新的、更改的标志)。标志更改的行为就像是客户机进行了更改一样。

As explained above, in order to avoid script loops, flag changes that are made as a result of a script that was itself invoked because of flag changes SHOULD NOT result in another script invocation. In any case, implementations MUST take steps to avoid such loops.

如上所述,为了避免脚本循环,由于标记更改而调用的脚本所做的标记更改不应导致另一个脚本调用。在任何情况下,实现都必须采取措施避免这种循环。

3.9. MIME Part Tests and Replacement
3.9. MIME部件测试和更换

If the MIME Part Tests extension [RFC5703] is available, all of its functions can be used, but any changes made to the message, using the "replace" or "enclose" action, MUST be considered transient and are only applicable with actions such as "redirect" and "fileinto". Because messages in IMAP mailboxes are immutable, such changes are not applicable for the "keep" action (explicit or implicit). See Section 3.1.

如果MIME部件测试扩展[RFC5703]可用,则可以使用其所有功能,但使用“替换”或“封闭”操作对消息所做的任何更改都必须被视为是暂时的,并且仅适用于“重定向”和“文件插入”等操作。由于IMAP邮箱中的消息是不可变的,因此此类更改不适用于“保留”操作(显式或隐式)。见第3.1节。

3.10. spamtest and virustest
3.10. spamtest和virustest

If the spamtest and virustest extensions [RFC5235] are available, they are applicable in all cases that fall under IMAP events in Sieve.

如果spamtest和virustest扩展[RFC5235]可用,则它们适用于Sieve中属于IMAP事件的所有情况。

3.11. Inapplicable Actions
3.11. 不适用行为

The following actions and extensions are not applicable to any case that falls under IMAP events in Sieve, because they are specifically designed to respond to delivery of a new email message. Their appearance in the "require" control or their use in an IMAP event MUST result in an error condition that will terminate the Sieve script:

以下操作和扩展不适用于Sieve中属于IMAP事件的任何情况,因为它们是专门为响应新电子邮件的传递而设计的。它们在“require”控件中的出现或在IMAP事件中的使用都会导致错误情况,从而终止筛选脚本:

reject [RFC5228]

拒绝[RFC5228]

ereject [RFC5429]

电子对象[RFC5429]

vacation [RFC5230]

假期[RFC5230]

Future extensions that are specifically designed to respond to delivery of a new email message will likewise not be applicable to this extension.

专门设计用于响应新电子邮件传递的未来扩展同样不适用于此扩展。

3.12. Future Sieve Actions
3.12. 未来的筛选行动

As noted above, future extensions that are specifically designed to respond to delivery of a new email message will not be applicable to this extension, because this extension does not involve acting at new-message delivery time.

如上所述,专门设计用于响应新电子邮件传递的未来扩展将不适用于此扩展,因为此扩展不涉及在新邮件传递时执行操作。

In general, future extensions to Sieve that define new actions MUST specify the applicability of those actions to this specification.

通常,定义新操作的筛选的未来扩展必须指定这些操作对本规范的适用性。

4. Interaction with Sieve Environment
4. 与环境的相互作用
4.1. Base Sieve Environment Items: location and phase
4.1. 基本筛选环境项目:位置和阶段

The Sieve Environment extension defines a set of standard environment items (see [RFC5183], Section 4.1). Two of those items are affected when the script is invoked through an IMAP event.

筛环境扩展定义了一组标准环境项(见[RFC5183],第4.1节)。当通过IMAP事件调用脚本时,其中两项会受到影响。

The value of "location" is set to "MS" -- evaluation is being performed by a Message Store.

“location”的值设置为“MS”--消息存储正在执行评估。

The value of "phase" is set to "post" -- processing is taking place after (or perhaps instead of, in the case of APPEND) final delivery.

“phase”的值设置为“post”--处理在最终交付之后进行(或者在APPEND的情况下,可能是代替)。

4.2. New Sieve Environment Items: imap.user and imap.email
4.2. 新的筛选环境项:imap.user和imap.email

In the normal case, when Sieve is used in final delivery, there is no identity for the "filer" -- the user who is creating or changing the message. In this case, there is such an identity, and a Sieve script might want to access that identity.

在正常情况下,当在最终交付中使用Sieve时,“文件管理者”——创建或更改消息的用户——没有标识。在本例中,存在这样一个标识,筛选脚本可能希望访问该标识。

Implementations MUST set and make available two new environment items:

实施必须设置并提供两个新的环境项:

"imap.user" -- the identity (login ID) of the IMAP user that caused the action. This MUST be the empty string if it is accessed during normal (final delivery) Sieve processing.

“imap.user”--导致该操作的imap用户的身份(登录ID)。如果在正常(最终交付)筛选处理期间访问,则必须为空字符串。

"imap.email" -- the primary email address of the IMAP user that caused the action (the user identified by "imap.user"). In some implementations, "imap.user" and "imap.email" might have the same value. This MUST be the empty string if it is accessed during normal (final delivery) Sieve processing.

“imap.email”--导致该操作的imap用户(由“imap.user”标识的用户)的主要电子邮件地址。在某些实现中,“imap.user”和“imap.email”可能具有相同的值。如果在正常(最终交付)筛选处理期间访问,则必须为空字符串。

4.3. New Sieve Environment Item: imap.cause
4.3. 新筛环境项:imap.cause

Each mailbox uses a single script for all the change conditions described in this document (append, copy, flag changes). To support that, the implementation MUST set the Environment [RFC5183] item "imap.cause", which contains the name of the action that caused the script to be invoked. Its value is one of the following:

对于本文档中描述的所有更改条件(追加、复制、标记更改),每个邮箱都使用一个脚本。为了支持这一点,实现必须设置环境[RFC5183]项“imap.cause”,其中包含导致调用脚本的操作的名称。其值为以下值之一:

o APPEND (for invocations resulting from APPEND commands)

o APPEND(用于由APPEND命令产生的调用)

o COPY (for invocations resulting from COPY commands)

o 复制(用于由复制命令产生的调用)

o FLAG (for invocations resulting from flag changes)

o 标志(用于由标志更改引起的调用)

Future extensions might define new events and, thus, new causes. Such extensions will come with their own capability strings, and the events they define will only be presented when their capabilities are requested. Scripts that do not request those capabilities will not see those events and will not encounter the new cause strings.

未来的扩展可能会定义新的事件,从而定义新的原因。这些扩展将附带它们自己的功能字符串,它们定义的事件将仅在请求它们的功能时显示。不请求这些功能的脚本将不会看到这些事件,也不会遇到新的原因字符串。

4.4. New Sieve Environment Item: imap.mailbox
4.4. 新的筛选环境项:imap.mailbox

The implementation MUST set the Environment [RFC5183] item "imap.mailbox" to the name of the mailbox that the affected message is in, in the case of existing messages, or is targeted to be stored into, in the case of new messages. The value of this item is fixed when the script begins, and, in particular, MUST NOT change as a result of any action, such as "fileinto".

对于现有邮件,实现必须将环境[RFC5183]项“imap.mailbox”设置为受影响邮件所在邮箱的名称;对于新邮件,实现必须将受影响邮件的目标邮箱名称设置为要存储到其中。当脚本开始时,此项的值是固定的,特别是不得因任何操作(如“fileinto”)而更改。

4.5. New Sieve Environment Item: imap.changedflags
4.5. 新筛环境项:imap.changedflags

If the script was invoked because of flag changes to an existing message, the implementation MUST set the Environment [RFC5183] item "imap.changedflags" to the name(s) of the flag(s) that have changed. If the script was not invoked because of flag changes, the value of this item MUST be the empty string. The script will not know from this item whether the flags have been set or reset, but it can use the "hasflag" test to determine the current value. See example 2 in Section 5 for an example of how this might be used.

如果由于现有消息的标志更改而调用脚本,则实现必须将环境[RFC5183]项“imap.changedflags”设置为已更改标志的名称。如果由于标志更改而未调用脚本,则此项的值必须为空字符串。脚本无法从该项中知道标志是否已设置或重置,但它可以使用“hasflag”测试来确定当前值。请参见第5节中的示例2,了解如何使用它。

4.6. Interaction with Sieve Tests (Comparisons)
4.6. 与筛试验的相互作用(比较)

Any tests against message envelope information, including the "envelope" test in the Sieve base specification, as well as any such test defined in extensions, are either inapplicable or have serious interoperability issues when performed at other than final-delivery time. Therefore, envelope tests MUST NOT be permitted in the cases described here, and their use MUST generate a runtime error.

任何针对消息信封信息的测试,包括筛基规范中的“信封”测试,以及扩展中定义的任何此类测试,在非最终交付时间执行时,要么不适用,要么存在严重的互操作性问题。因此,在这里描述的情况下,信封测试是不允许的,它们的使用必须产生运行时错误。

This extension does not affect the operation of other tests or comparisons in the Sieve base specification.

此扩展不影响筛基规范中其他测试或比较的操作。

5. Examples
5. 例子

Example 1: If a new message is added to the "ActionItems" mailbox, a copy is sent to the address "actionitems@example.com".

示例1:如果将新邮件添加到“ActionItems”邮箱,则会将副本发送到“ActionItems”邮箱actionitems@example.com".

require ["copy", "environment", "imapsieve"];

要求[“复制”、“环境”、“imapsieve”];

     if anyof (environment :is "imap.cause" "APPEND",
               environment :is "imap.cause" "COPY")  {
         if environment :is "imap.mailbox" "ActionItems" {
             redirect :copy "actionitems@example.com";
         }
     }
        
     if anyof (environment :is "imap.cause" "APPEND",
               environment :is "imap.cause" "COPY")  {
         if environment :is "imap.mailbox" "ActionItems" {
             redirect :copy "actionitems@example.com";
         }
     }
        

Example 2: If the script is called for any message with the \Flagged flag set (tested through the imap4flags extension [RFC5232]) AND this script invocation represents a change to that flag, then a notification is sent using the Sieve notify extension [RFC5435]. No notification will be sent, though, if we're called with an existing message that already had that flag set.

示例2:如果为设置了\Flagged标志(通过imap4flags扩展[RFC5232]测试)的任何消息调用脚本,并且此脚本调用表示对该标志的更改,则使用Sieve notify扩展[RFC5435]发送通知。但是,如果使用已设置该标志的现有消息调用我们,则不会发送通知。

require ["enotify", "imap4flags", "variables", "environment", "imapsieve"];

需要[“enotify”、“imap4flags”、“变量”、“环境”、“IMAPSIEV”];

     if environment :matches "imap.mailbox" "*" {
         set "mailbox" "${1}";
     }
        
     if environment :matches "imap.mailbox" "*" {
         set "mailbox" "${1}";
     }
        
     if allof (hasflag "\\Flagged",
               environment :contains "imap.changedflags" "\\Flagged") {
       notify :message "Important message in ${mailbox}"
           "xmpp:tim@example.com?message;subject=SIEVE";
     }
        
     if allof (hasflag "\\Flagged",
               environment :contains "imap.changedflags" "\\Flagged") {
       notify :message "Important message in ${mailbox}"
           "xmpp:tim@example.com?message;subject=SIEVE";
     }
        

Example 3: This shows an example IMAP CAPABILITY response when this extension is supported. The client has done STARTTLS with the server and is now inspecting capabilities. (The untagged CAPABILITY response is split here for readability only, but it will be in one response message.)

示例3:这显示了支持此扩展时的IMAP功能响应示例。客户机已经对服务器执行了STARTTLS,现在正在检查功能。(此处拆分未标记的功能响应只是为了可读性,但它将包含在一条响应消息中。)

     C:  A01 CAPABILITY
     S:  * CAPABILITY IMAP4rev1 AUTH=PLAIN UIDPLUS LIST-EXTENDED
           ACL IMAPSIEVE=sieve://sieve.example.com MULTISEARCH
     S:  A01 OK done
        
     C:  A01 CAPABILITY
     S:  * CAPABILITY IMAP4rev1 AUTH=PLAIN UIDPLUS LIST-EXTENDED
           ACL IMAPSIEVE=sieve://sieve.example.com MULTISEARCH
     S:  A01 OK done
        
6. Security Considerations
6. 安全考虑

It is possible to introduce script processing loops by having a Sieve script that is triggered by flag changes use the actions defined in the imap4flags extension [RFC5232]. Implementations MUST take steps to prevent script loops. One way to avoid this problem is that if a script is invoked by flag changes, and that script further changes the flags, those flag changes SHOULD NOT trigger a Sieve script invocation.

可以通过使用imap4flags扩展[RFC5232]中定义的操作,使用由标志更改触发的筛选脚本来引入脚本处理循环。实现必须采取措施防止脚本循环。避免此问题的一种方法是,如果通过标志更改调用脚本,并且该脚本进一步更改标志,则这些标志更改不应触发筛选脚本调用。

The "fileinto" action never results in the invocation of a script. If an implementation did invoke a script as the result of a fileinto, as though an IMAP APPEND or COPY had been done, script loops could result (mailbox A responds to all COPY events by doing "fileinto B", and mailbox B responds to all COPY events by doing "fileinto A"). In general, actions taken as a result of the Sieve script are not IMAP events and do not themselves trigger Sieve script invocations.

“fileinto”操作不会导致调用脚本。如果一个实现确实调用了一个脚本作为fileinto的结果,就像IMAP追加或复制已经完成一样,那么可能会产生脚本循环(邮箱a通过执行“fileinto B”响应所有复制事件,邮箱B通过执行“fileinto a”响应所有复制事件)。通常,由于Sieve脚本而执行的操作不是IMAP事件,它们本身也不会触发Sieve脚本调用。

It is also possible to introduce loops through the "redirect" or "notify" actions. See Sieve [RFC5228], Section 10, Sieve Notify [RFC5435], Section 8, and the Security Considerations sections of the applicable notification-method documents for loop-prevention information. This extension does not change any of that advice.

还可以通过“重定向”或“通知”操作引入循环。有关环路预防信息,请参见筛[RFC5228],第10节,筛通知[RFC5435],第8节,以及适用通知方法文件的安全注意事项部分。此扩展不会改变任何建议。

This extension introduces side effects to IMAP commands that users and script authors might not be aware of and that can accidentally be triggered by an operation that the user would expect to be innocuous. In particular, certain actions, such as "redirect", can cause a message (such as a message appended to a mailbox by a user) to be sent to the Internet in response to something as simple as a flag change. For example, a script might cause messages marked for deletion to be sent to some off-site archiving service. If a user appends a draft message to a mailbox (perhaps an unencrypted draft message) and then marks it for deletion, it might be very surprising to the user that the message is sent off site. Script authors need to be careful not to create these kinds of surprises, especially when creating global scripts.

此扩展为IMAP命令引入了用户和脚本作者可能不知道的副作用,这些副作用可能会意外地由用户认为无害的操作触发。特别是,某些操作(如“重定向”)可能导致消息(如用户附加到邮箱的消息)被发送到Internet,以响应标记更改等简单操作。例如,脚本可能会导致将标记为删除的消息发送到某些非现场存档服务。如果用户将草稿邮件附加到邮箱(可能是未加密的草稿邮件),然后将其标记为删除,用户可能会非常惊讶该邮件被发送到异地。脚本作者需要小心,不要创造这些惊喜,尤其是在创建全局脚本时。

Other security considerations are discussed in IMAP [RFC3501] and Sieve [RFC5228], as well as in some of the other extension documents.

IMAP[RFC3501]和SIVE[RFC5228]以及一些其他扩展文档中讨论了其他安全注意事项。

7. IANA Considerations
7. IANA考虑
7.1. Registration of "imapsieve" IMAP Capability
7.1. 注册“IMAPSIEV”IMAP功能

IANA has added "IMAPSIEVE=" to the IMAP 4 Capabilities registry (<http://www.iana.org/assignments/imap4-capabilities>), according to the IMAP 4 specification [RFC3501].

IANA已将“IMAPSIEVE=”添加到IMAP 4功能注册表中(<http://www.iana.org/assignments/imap4-capabilities>),根据IMAP 4规范[RFC3501]。

7.2. Registration of "imapsieve" Sieve Extension
7.2. 注册“imapsieve”筛网扩展

The following information has been added to the Sieve Extensions registry (<http://www.iana.org/assignments/sieve-extensions>), according to the Sieve specification [RFC5228].

以下信息已添加到Sieve Extensions注册表中(<http://www.iana.org/assignments/sieve-extensions>),根据筛规范[RFC5228]。

   Capability name: imapsieve
   Description: Add Sieve processing for IMAP events.
   RFC number: 6785
   Contact address: Sieve mailing list <sieve@ietf.org>
        
   Capability name: imapsieve
   Description: Add Sieve processing for IMAP events.
   RFC number: 6785
   Contact address: Sieve mailing list <sieve@ietf.org>
        
7.3. Registration of Sieve Environment Items
7.3. 环境项目的登记

The following subsections register items in the Sieve Environment Items registry (<http://www.iana.org/assignments/sieve-environment-items>), according to the Environment extension [RFC5183].

以下各小节在Sieve环境项注册表中注册项(<http://www.iana.org/assignments/sieve-environment-items>),根据环境扩展[RFC5183]。

7.3.1. Registration of Sieve Environment Item: imap.cause
7.3.1. 筛选环境项的注册:imap.cause

Item name: imap.cause Description: The name of the action that caused the script to be invoked. Its value is one of the following:

项名称:imap.cause Description:导致调用脚本的操作的名称。其值为以下值之一:

o APPEND (for invocations resulting from APPEND commands)

o APPEND(用于由APPEND命令产生的调用)

o COPY (for invocations resulting from COPY commands)

o 复制(用于由复制命令产生的调用)

o FLAG (for invocations resulting from flag changes)

o 标志(用于由标志更改引起的调用)

   RFC number: 6785
   Contact address: Sieve mailing list <sieve@ietf.org>
        
   RFC number: 6785
   Contact address: Sieve mailing list <sieve@ietf.org>
        
7.3.2. Registration of Sieve Environment Item: imap.mailbox
7.3.2. 筛选环境项的注册:imap.mailbox

Item name: imap.mailbox Description: The name of the mailbox that the affected message is in, in the case of existing messages, or is targeted to be stored into, in the case of new messages. The value of this item is fixed when the script begins, and, in particular, MUST NOT change as a result of any action, such as "fileinto". RFC number: 6785 Contact address: Sieve mailing list <sieve@ietf.org>

项目名称:imap.mailbox Description:受影响邮件所在的邮箱的名称(如果是现有邮件),或要存储到的邮箱的名称(如果是新邮件)。当脚本开始时,此项的值是固定的,特别是不得因任何操作(如“fileinto”)而更改。RFC号码:6785联系地址:SIVE邮件列表<sieve@ietf.org>

7.3.3. Registration of Sieve Environment Item: imap.changedflags
7.3.3. 筛选环境项的注册:imap.changedflags
   Item name: imap.changedflags
   Description: If the script was invoked because of flag changes to an
      existing message, this contains the name(s) of the flag(s) that
      have changed.  Otherwise, the value of this item MUST be the
      empty string.
   RFC number: 6785
   Contact address: Sieve mailing list <sieve@ietf.org>
        
   Item name: imap.changedflags
   Description: If the script was invoked because of flag changes to an
      existing message, this contains the name(s) of the flag(s) that
      have changed.  Otherwise, the value of this item MUST be the
      empty string.
   RFC number: 6785
   Contact address: Sieve mailing list <sieve@ietf.org>
        
7.3.4. Registration of Sieve Environment Item: imap.user
7.3.4. 筛选环境项的注册:imap.user
   Item name: imap.user
   Description: The identity (IMAP login ID) of the IMAP user that
      caused the action.
   RFC number: 6785
   Contact address: Sieve mailing list <sieve@ietf.org>
        
   Item name: imap.user
   Description: The identity (IMAP login ID) of the IMAP user that
      caused the action.
   RFC number: 6785
   Contact address: Sieve mailing list <sieve@ietf.org>
        
7.3.5. Registration of Sieve Environment Item: imap.email
7.3.5. 筛选环境项目注册:imap.email
   Item name: imap.email
   Description: The primary email address of the IMAP user that
      caused the action (the user identified by "imap.user").
   RFC number: 6785
   Contact address: Sieve mailing list <sieve@ietf.org>
        
   Item name: imap.email
   Description: The primary email address of the IMAP user that
      caused the action (the user identified by "imap.user").
   RFC number: 6785
   Contact address: Sieve mailing list <sieve@ietf.org>
        
7.4. Registration of IMAP METADATA Mailbox Entry Name
7.4. 注册IMAP元数据邮箱条目名称

The following information has been added to the IMAP METADATA Mailbox Entry Registry (<http://www.iana.org/assignments/imap-metadata>), according to the METADATA extension [RFC5464].

以下信息已添加到IMAP元数据邮箱条目注册表中(<http://www.iana.org/assignments/imap-metadata>),根据元数据扩展[RFC5464]。

   Type: Mailbox
   Name: /shared/imapsieve/script
   Description: This entry name is used to define mailbox metadata
      associated with IMAP events in Sieve for the associated mailbox.
      Specifically, this specifies the Sieve script that will be invoked
      when IMAP events occur on the specified mailbox.
   Content-type: text/plain; charset=utf-8
   RFC number: 6785
   Contact address: Sieve mailing list <sieve@ietf.org>
        
   Type: Mailbox
   Name: /shared/imapsieve/script
   Description: This entry name is used to define mailbox metadata
      associated with IMAP events in Sieve for the associated mailbox.
      Specifically, this specifies the Sieve script that will be invoked
      when IMAP events occur on the specified mailbox.
   Content-type: text/plain; charset=utf-8
   RFC number: 6785
   Contact address: Sieve mailing list <sieve@ietf.org>
        
7.5. Registration of IMAP METADATA Server Entry Name
7.5. 注册IMAP元数据服务器条目名称

The following information has been added to the IMAP METADATA Server Entry Registry (<http://www.iana.org/assignments/imap-metadata>), according to the METADATA extension [RFC5464].

以下信息已添加到IMAP元数据服务器条目注册表中(<http://www.iana.org/assignments/imap-metadata>),根据元数据扩展[RFC5464]。

   Type: Server
   Name: /shared/imapsieve/script
   Description: This entry name is used to define metadata associated
      globally with IMAP events in Sieve for the associated server.
      Specifically, this specifies the Sieve script that will be invoked
      when IMAP events occur on any mailbox in the server that does not
      have its own mailbox-level /shared/imapsieve/script entry.
   Content-type: text/plain; charset=utf-8
   RFC number: 6785
   Contact address: Sieve mailing list <sieve@ietf.org>
        
   Type: Server
   Name: /shared/imapsieve/script
   Description: This entry name is used to define metadata associated
      globally with IMAP events in Sieve for the associated server.
      Specifically, this specifies the Sieve script that will be invoked
      when IMAP events occur on any mailbox in the server that does not
      have its own mailbox-level /shared/imapsieve/script entry.
   Content-type: text/plain; charset=utf-8
   RFC number: 6785
   Contact address: Sieve mailing list <sieve@ietf.org>
        
8. References
8. 工具书类
8.1. Normative References
8.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月。

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

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

[RFC3502] Crispin, M., "Internet Message Access Protocol (IMAP) - MULTIAPPEND Extension", RFC 3502, March 2003.

[RFC3502]Crispin,M.,“互联网消息访问协议(IMAP)-多附加扩展”,RFC 35022003年3月。

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

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

[RFC5183] Freed, N., "Sieve Email Filtering: Environment Extension", RFC 5183, May 2008.

[RFC5183]弗里德,N.,“筛选电子邮件过滤:环境扩展”,RFC 5183,2008年5月。

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

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

[RFC5232] Melnikov, A., "Sieve Email Filtering: Imap4flags Extension", RFC 5232, January 2008.

[RFC5232]Melnikov,A.,“筛选电子邮件过滤:Imap4flags扩展”,RFC 5232,2008年1月。

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

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

[RFC5804] Melnikov, A. and T. Martin, "A Protocol for Remotely Managing Sieve Scripts", RFC 5804, July 2010.

[RFC5804]Melnikov,A.和T.Martin,“远程管理筛选脚本的协议”,RFC 58042010年7月。

[RFC6409] Gellens, R. and J. Klensin, "Message Submission for Mail", STD 72, RFC 6409, November 2011.

[RFC6409]Gellens,R.和J.Klensin,“邮件信息提交”,STD 72,RFC 6409,2011年11月。

8.2. Informative References
8.2. 资料性引用

[RFC4315] Crispin, M., "Internet Message Access Protocol (IMAP) - UIDPLUS extension", RFC 4315, December 2005.

[RFC4315]Crispin,M.,“互联网消息访问协议(IMAP)-UIDPLUS扩展”,RFC 4315,2005年12月。

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

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

[RFC5235] Daboo, C., "Sieve Email Filtering: Spamtest and Virustest Extensions", RFC 5235, January 2008.

[RFC5235]Daboo,C.,“筛选电子邮件过滤:垃圾邮件测试和病毒测试扩展”,RFC5352008年1月。

[RFC5293] Degener, J. and P. Guenther, "Sieve Email Filtering: Editheader Extension", RFC 5293, August 2008.

[RFC5293]Degener,J.和P.Guenther,“筛选电子邮件过滤:Editheader扩展”,RFC 5293,2008年8月。

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

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

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

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

[RFC5703] Hansen, T. and C. Daboo, "Sieve Email Filtering: MIME Part Tests, Iteration, Extraction, Replacement, and Enclosure", RFC 5703, October 2009.

[RFC5703]Hansen,T.和C.Daboo,“筛选电子邮件过滤:MIME部分测试、迭代、提取、替换和封装”,RFC 57032009年10月。

Author's Address

作者地址

Barry Leiba Huawei Technologies

巴里·雷巴华为技术有限公司

   Phone: +1 646 827 0648
   EMail: barryleiba@computer.org
   URI:   http://internetmessagingtechnology.org/
        
   Phone: +1 646 827 0648
   EMail: barryleiba@computer.org
   URI:   http://internetmessagingtechnology.org/