Internet Engineering Task Force (IETF)                    A. Gulbrandsen
Request for Comments: 6851
Category: Standards Track                                  N. Freed, Ed.
ISSN: 2070-1721                                                   Oracle
                                                            January 2013
        
Internet Engineering Task Force (IETF)                    A. Gulbrandsen
Request for Comments: 6851
Category: Standards Track                                  N. Freed, Ed.
ISSN: 2070-1721                                                   Oracle
                                                            January 2013
        

Internet Message Access Protocol (IMAP) - MOVE Extension

Internet消息访问协议(IMAP)-移动扩展

Abstract

摘要

This document defines an IMAP extension consisting of two new commands, MOVE and UID MOVE, that are used to move messages from one mailbox to another.

本文档定义了一个IMAP扩展,它由两个新命令MOVE和UID MOVE组成,用于将邮件从一个邮箱移动到另一个邮箱。

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

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

Copyright Notice

版权公告

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

版权所有(c)2013 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许可证中所述的无担保。

1. Introduction
1. 介绍

This document defines an IMAP [RFC3501] extension to facilitate moving messages from one mailbox to another. This is accomplished by defining a new MOVE command and extending the UID command to allow UID MOVE.

本文档定义了IMAP[RFC3501]扩展,以便于将邮件从一个邮箱移动到另一个邮箱。这是通过定义一个新的MOVE命令并扩展UID命令以允许UID移动来实现的。

A move function is not provided in the base IMAP specification, so clients have instead had to use a combination of the COPY, STORE, and EXPUNGE commands to perform this very common operation.

基本IMAP规范中没有提供移动功能,因此客户机必须结合使用COPY、STORE和EXPUNGE命令来执行此非常常见的操作。

Implementors have long pointed out some shortcomings with this approach. Because the moving of a message is not an atomic process, interruptions can leave messages in intermediate states. Because multiple clients can be accessing the mailboxes at the same time, clients can see messages in intermediate states even without interruptions. If the source mailbox contains other messages that are flagged for deletion, the third step can have the side effect of expunging more than just the set of moved messages. Additionally, servers with certain types of back-end message stores might have efficient ways of moving messages, which don't involve the actual copying of data. Such efficiencies are often not available to the COPY/STORE/EXPUNGE process.

实施者早就指出了这种方法的一些缺点。由于消息的移动不是一个原子过程,因此中断会使消息处于中间状态。由于多个客户端可以同时访问邮箱,因此客户端甚至可以在不中断的情况下看到处于中间状态的消息。如果源邮箱包含标记为删除的其他邮件,则第三步可能会产生副作用,即删除的不仅仅是移动的邮件集。此外,具有特定类型后端消息存储的服务器可能具有移动消息的有效方法,而不涉及数据的实际复制。这种效率通常不适用于复制/存储/删除过程。

The MOVE extension is present in any IMAP implementation that returns "MOVE" as one of the supported capabilities to the CAPABILITY command.

MOVE扩展存在于任何将“MOVE”作为支持的功能之一返回到CAPABILITY命令的IMAP实现中。

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

Formal syntax is specified using ABNF [RFC5234].

使用ABNF[RFC5234]指定形式语法。

Example lines prefaced by "C:" are sent by the client and ones prefaced by "S:" by the server.

以“C:”开头的示例行由客户端发送,以“S:”开头的示例行由服务器发送。

3. MOVE and UID MOVE
3. 移动和移动
3.1. MOVE Command
3.1. 移动命令

Arguments: sequence set mailbox name

参数:序列集邮箱名称

Responses: no specific responses for this command

响应:此命令没有特定的响应

Result: OK - move completed

结果:确定-移动已完成

NO - move error: can't move those messages or to that name

否-移动错误:无法将这些邮件或移动到该名称

BAD - command unknown or arguments invalid

错误-命令未知或参数无效

3.2. UID MOVE Command
3.2. UID移动命令

This extends the first form of the UID command (see [RFC3501], Section 6.4.8) to add the MOVE command defined above as a valid argument.

这扩展了UID命令的第一种形式(请参见[RFC3501],第6.4.8节),以添加上面定义为有效参数的MOVE命令。

3.3. Semantics of MOVE and UID MOVE
3.3. MOVE和UID-MOVE的语义

The MOVE command takes two arguments: a message set (sequence numbers for MOVE, UIDs for UID MOVE) and a named mailbox. Each message included in the set is moved, rather than copied, from the selected (source) mailbox to the named (target) mailbox.

MOVE命令有两个参数:消息集(MOVE的序列号,UID表示UID MOVE)和命名邮箱。集合中包含的每封邮件都将从选定(源)邮箱移动而不是复制到命名(目标)邮箱。

This means that a new message is created in the target mailbox with a new UID, the original message is removed from the source mailbox, and it appears to the client as a single action. This has the same effect for each message as this sequence:

这意味着将使用新UID在目标邮箱中创建新邮件,原始邮件将从源邮箱中删除,并且在客户端看来,它是一个操作。这对每条消息的效果与此序列相同:

1. [UID] COPY

1. [UID]复制

2. [UID] STORE +FLAGS.SILENT \DELETED

2. [UID]存储+标志。无提示\已删除

3. UID EXPUNGE

3. UID清除

Although the effect of the MOVE is the same as the preceding steps, the semantics are not identical: The intermediate states produced by those steps do not occur, and the response codes are different. In particular, though the COPY and EXPUNGE response codes will be returned, response codes for a STORE MUST NOT be generated and the \DELETED flag MUST NOT be set for any message.

虽然移动的效果与前面的步骤相同,但语义并不相同:这些步骤产生的中间状态不会出现,响应代码也不同。特别是,尽管将返回复制和删除响应代码,但不能生成存储的响应代码,也不能为任何消息设置\DELETED标志。

Because a MOVE applies to a set of messages, it might fail partway through the set. Regardless of whether the command is successful in moving the entire set, each individual message SHOULD either be moved or unaffected. The server MUST leave each message in a state where it is in at least one of the source or target mailboxes (no message can be lost or orphaned). The server SHOULD NOT leave any message in both mailboxes (it would be bad for a partial failure to result in a bunch of duplicate messages). This is true even if the server returns a tagged NO response to the command.

由于移动应用于一组消息,因此可能会在该组消息的中途失败。无论命令是否成功移动整个集合,每个单独的消息都应被移动或不受影响。服务器必须使每条邮件保持至少一个源邮箱或目标邮箱中的状态(不能丢失或孤立任何邮件)。服务器不应在两个邮箱中都保留任何消息(如果部分故障导致大量重复消息,则情况会很糟糕)。即使服务器对命令返回标记的NO响应,这也是正确的。

Because of the similarity of MOVE to COPY, extensions that affect COPY affect MOVE in the same way. Response codes such as TRYCREATE (see [RFC3501], Section 6.4.7), as well as those defined by extensions, are sent as appropriate. See Section 4 for more information about how MOVE interacts with other IMAP extensions.

由于移动到复制的相似性,影响复制的扩展以相同的方式影响移动。响应代码,如TRYCREATE(参见[RFC3501],第6.4.7节),以及扩展定义的代码,视情况发送。有关MOVE如何与其他IMAP扩展交互的更多信息,请参见第4节。

An example:

例如:

       C: a UID MOVE 42:69 foo
       S: * OK [COPYUID 432432 42:69 1202:1229]
       S: * 22 EXPUNGE
       S: (more expunges)
       S: a OK Done
        
       C: a UID MOVE 42:69 foo
       S: * OK [COPYUID 432432 42:69 1202:1229]
       S: * 22 EXPUNGE
       S: (more expunges)
       S: a OK Done
        

Note that the server may send unrelated EXPUNGE responses as well, if any happen to have been expunged at the same time; this is normal IMAP operation.

请注意,如果同时删除了任何响应,服务器也可能发送不相关的删除响应;这是正常的IMAP操作。

Implementers will need to read [RFC4315] to understand what UID EXPUNGE does, though full implementation of [RFC4315] is not necessary.

实现者需要阅读[RFC4315]来理解UID EXPUNGE的作用,尽管完全实现[RFC4315]是不必要的。

Note that moving a message to the currently selected mailbox (that is, where the source and target mailboxes are the same) is allowed when copying the message to the currently selected mailbox is allowed.

请注意,当允许将邮件复制到当前选定的邮箱时,允许将邮件移动到当前选定的邮箱(即,源邮箱和目标邮箱相同的邮箱)。

The server may send EXPUNGE (or VANISHED) responses before the tagged response, so the client cannot safely send more commands with message sequence number arguments while the server is processing MOVE or UID MOVE.

服务器可能会在标记的响应之前发送“删除”(或“消失”)响应,因此在服务器处理移动或UID移动时,客户端无法安全地发送更多带有消息序列号参数的命令。

Both MOVE and UID MOVE can be pipelined with other commands, but care has to be taken. Both commands modify sequence numbers and also allow unrelated EXPUNGE responses. The renumbering of other messages in the source mailbox following any EXPUNGE response can be surprising and makes it unsafe to pipeline any command that relies on message sequence numbers after a MOVE or UID MOVE. Similarly, MOVE

MOVE和UID MOVE都可以通过管道与其他命令连接,但必须小心。这两个命令都修改序列号,还允许不相关的删除响应。在任何删除响应之后对源邮箱中的其他邮件进行重新编号可能会令人惊讶,并使在移动或UID移动之后对依赖于邮件序列号的任何命令进行管道传输变得不安全。同样,移动

cannot be pipelined with a command that might cause message renumbering. See [RFC3501], Section 5.5, for more information about ambiguities as well as handling requirements for both clients and servers.

无法使用可能导致邮件重新编号的命令进行管道化。请参阅[RFC3501],第5.5节,了解有关客户机和服务器的模糊性以及处理要求的更多信息。

4. Interaction with Other Extensions
4. 与其他扩展的交互

This section describes how MOVE interacts with some other IMAP extensions.

本节介绍MOVE如何与其他一些IMAP扩展交互。

4.1. RFC 2087, QUOTA
4.1. RFC2087,配额

The QUOTA extension (defined by [RFC2087]) may interact with MOVE on some servers, in the sense that a MOVE command may succeed where COPY would cause a quota overrun.

配额扩展(由[RFC2087]定义)可能与某些服务器上的MOVE交互,这意味着MOVE命令可能会在复制导致配额溢出的情况下成功。

4.2. RFC 4314, Access Control List (ACL)
4.2. RFC 4314,访问控制列表(ACL)

The ACL rights [RFC4314] required for MOVE and UID MOVE are the union of the ACL rights required for UID STORE, UID COPY, and UID EXPUNGE.

移动和UID移动所需的ACL权限[RFC4314]是UID存储、UID复制和UID删除所需的ACL权限的并集。

4.3. RFC 4315, UIDPLUS
4.3. RFC 4315,UIDPLUS

Servers supporting UIDPLUS [RFC4315] SHOULD send COPYUID in response to a UID MOVE command. For additional information see Section 3 of [RFC4315].

支持UIDPLUS[RFC4315]的服务器应发送COPYUID以响应UID MOVE命令。有关更多信息,请参见[RFC4315]第3节。

Servers implementing UIDPLUS are also advised to send the COPYUID response code in an untagged OK before sending EXPUNGE or moved responses. (Sending COPYUID in the tagged OK, as described in the UIDPLUS specification, means that clients first receive an EXPUNGE for a message and afterwards COPYUID for the same message. It can be unnecessarily difficult to process that sequence usefully.)

还建议实现UIDPLUS的服务器在发送删除或移动响应之前,以未标记的OK形式发送COPYUID响应代码。(如UIDPLUS规范中所述,在标记的OK中发送COPYUID意味着客户端首先接收消息的删除,然后接收同一消息的COPYUID。有效地处理该序列可能会有不必要的困难。)

4.4. RFC 5162, QRESYNC
4.4. RFC5162,QRESYNC

The QRESYNC extension [RFC5162] states that the server SHOULD send VANISHED rather than EXPUNGE in response to the UID EXPUNGE command. The same requirement applies to MOVE, and a QRESYNC-enabled client needs to handle both VANISHED and EXPUNGE responses to a UID MOVE command.

QRESYNC扩展[RFC5162]声明服务器应发送EXPENSE而不是EXPUNGE以响应UID EXPUNGE命令。同样的要求也适用于MOVE,启用QRESYNC的客户端需要处理对UID MOVE命令的消失和删除响应。

If the server is capable of storing modification sequences for the selected mailbox, it MUST increment the per-mailbox mod-sequence if at least one message was permanently moved due to the execution of the MOVE/UID MOVE command. For each permanently removed message, the server MUST remember the incremented mod-sequence and corresponding UID. If at least one message was moved, the server MUST send the

如果服务器能够存储所选邮箱的修改序列,则如果由于执行MOVE/UID MOVE命令至少有一封邮件被永久移动,则必须增加每个邮箱的修改序列。对于每个永久删除的消息,服务器必须记住递增的mod序列和相应的UID。如果至少移动了一封邮件,服务器必须发送

updated per-mailbox modification sequence using the HIGHESTMODSEQ response code (defined in [RFC4551]) in the tagged or untagged OK response.

在标记或未标记的OK响应中,使用HIGHESTMODSEQ响应代码(在[RFC4551]中定义)更新每个邮箱修改序列。

When one or more messages are moved to a target mailbox, if the server is capable of storing modification sequences for the mailbox, the server MUST generate and assign new modification sequence numbers to the moved messages that are higher than the highest modification sequence of the messages originally in the mailbox.

将一封或多封邮件移动到目标邮箱时,如果服务器能够存储邮箱的修改序列,则服务器必须为移动的邮件生成并分配新的修改序列号,这些修改序列号高于邮箱中原始邮件的最高修改序列号。

4.5. IMAP Events in Sieve
4.5. Sieve中的IMAP事件

MOVE applies to IMAP events in Sieve [RFC6785] in the same way as COPY does. Therefore, MOVE can cause a Sieve script to be invoked with the imap.cause set to "COPY". Because MOVE does not cause flags to be changed, a MOVE command will not result in a script invocation with the imap.cause set to "FLAG".

移动应用于Sieve[RFC6785]中的IMAP事件,方式与复制相同。因此,MOVE会导致在imap.cause设置为“COPY”的情况下调用Sieve脚本。由于MOVE不会导致更改标志,所以MOVE命令不会导致将imap.cause设置为“FLAG”的脚本调用。

5. Formal Syntax
5. 形式语法

The following syntax specification uses the Augmented Backus-Naur Form (ABNF) notation as specified in [RFC5234]. [RFC3501] defines the non-terminals "capability", "command-select", "sequence-set", and "mailbox".

以下语法规范使用[RFC5234]中指定的增广巴科斯诺尔形式(ABNF)表示法。[RFC3501]定义了非终端“能力”、“命令选择”、“序列集”和“邮箱”。

Except as noted otherwise, all alphabetic characters are case insensitive. The use of upper or lower case characters to define token strings is for editorial clarity only. Implementations MUST accept these strings in a case-insensitive fashion.

除非另有说明,否则所有字母字符都不区分大小写。使用大写或小写字符定义标记字符串仅为编辑目的。实现必须以不区分大小写的方式接受这些字符串。

capability =/ "MOVE"

能力=/“移动”

   command-select =/ move
   move           = "MOVE" SP sequence-set SP mailbox
   uid            = "UID" SP (copy / fetch / search / store / move)
        
   command-select =/ move
   move           = "MOVE" SP sequence-set SP mailbox
   uid            = "UID" SP (copy / fetch / search / store / move)
        
6. Security Considerations
6. 安全考虑

MOVE does not introduce any new capabilities to IMAP, and this limits the security impact. However, the transactional semantics of MOVE may interact with specific implementations in ways that could have unexpected consequences. For example, moving messages between mailboxes under the quota root may require temporary suspension of quota checking.

MOVE没有向IMAP引入任何新功能,这限制了安全影响。然而,MOVE的事务语义可能以可能产生意外后果的方式与特定实现交互。例如,在配额根目录下的邮箱之间移动邮件可能需要临时暂停配额检查。

An additional area of concern is interaction with antispam, antivirus, and other security scanning and auditing mechanisms. Different mailboxes may have different security policies that could

另一个值得关注的领域是与反垃圾邮件、防病毒和其他安全扫描和审核机制的交互。不同的邮箱可能具有不同的安全策略,这些策略可能会

interact with MOVE in complex ways. Scanning with updated rules may also be required when messages are moved even when the underlying policy has not changed.

以复杂的方式与MOVE互动。移动邮件时,即使基础策略未更改,也可能需要使用更新的规则进行扫描。

MOVE does relieve a problem with the base specification, since client authors currently have to devise and implement complicated algorithms to handle partial failures of the STORE/COPY/EXPUNGE trio. Incomplete or improper implementation of these algorithms can lead to mail loss.

MOVE确实缓解了基本规范的问题,因为客户机作者目前必须设计和实现复杂的算法来处理STORE/COPY/EXPUNGE trio的部分故障。这些算法的不完整或不当实现可能会导致邮件丢失。

7. IANA Considerations
7. IANA考虑

The IANA has added MOVE to the "IMAP 4 Capabilities" registry, <http://www.iana.org/assignments/imap4-capabilities>.

IANA已将移动添加到“IMAP 4功能”注册表中<http://www.iana.org/assignments/imap4-capabilities>.

8. Acknowledgments
8. 致谢

This document is dedicated to the memory of Mark Crispin, the inventor of the IMAP protocol, author of the IMAP protocol specification [RFC3501], and contributor to many other email specifications in the IETF.

本文档专门用于纪念Mark Crispin,他是IMAP协议的发明者、IMAP协议规范[RFC3501]的作者,也是IETF中许多其他电子邮件规范的贡献者。

An extension like this has been proposed many times, by many people. This document is based on several of those proposals, most recently that by Witold Krecicki. Witold, Benoit Claise, Adrien W. de Croy, Stephen Farrell, Bron Gondwana, Dan Karp, Christian Ketterer, Murray Kucherawy, Jan Kundrat, Barry Leiba, Alexey Melnikov, Kathleen Moriarty, Zoltan Ordogh, Pete Resnick, Timo Sirainen, Michael Slusarz, and others provided valuable comments.

像这样的扩展已经被许多人多次提出。本文件基于其中几项建议,最近的一项是维托尔德·克雷西茨基的建议。维托德、贝诺特·克莱斯、阿德里安·德克罗伊、斯蒂芬·法雷尔、布隆·冈瓦纳、丹·卡普、克里斯蒂安·凯特勒、默里·库奇拉维、扬·昆德拉、巴里·莱巴、亚历克西·梅尔尼科夫、凯瑟琳·莫里亚蒂、佐尔坦·奥多格、皮特·雷斯尼克、蒂莫·西莱宁、迈克尔·斯卢萨兹和其他人提供了宝贵的评论。

9. References
9. 工具书类
9.1. Normative References
9.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月。

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

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

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

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

[RFC4551] Melnikov, A. and S. Hole, "IMAP Extension for Conditional STORE Operation or Quick Flag Changes Resynchronization", RFC 4551, June 2006.

[RFC4551]Melnikov,A.和S.Hole,“条件存储操作或快速标志更改再同步的IMAP扩展”,RFC 45512006年6月。

[RFC5162] Melnikov, A., Cridland, D., and C. Wilson, "IMAP4 Extensions for Quick Mailbox Resynchronization", RFC 5162, March 2008.

[RFC5162]Melnikov,A.,Cridland,D.,和C.Wilson,“用于快速邮箱重新同步的IMAP4扩展”,RFC 51622008年3月。

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

9.2. Informative References
9.2. 资料性引用

[RFC2087] Myers, J., "IMAP4 QUOTA extension", RFC 2087, January 1997.

[RFC2087]迈尔斯,J.,“IMAP4配额延长”,RFC2087,1997年1月。

[RFC6785] Leiba, B., "Support for Internet Message Access Protocol (IMAP) Events in Sieve", RFC 6785, November 2012.

[RFC6785]Leiba,B.,“互联网信息访问协议(IMAP)事件在Sieve中的支持”,RFC 6785,2012年11月。

Authors' Addresses

作者地址

Arnt Gulbrandsen Schweppermannstr. 8 D-81671 Muenchen Germany

阿恩特·古尔布兰森·施韦珀·曼斯特。德国慕尼黑8D-81671

   Fax:   +49 89 4502 9758
   EMail: arnt@gulbrandsen.priv.no
        
   Fax:   +49 89 4502 9758
   EMail: arnt@gulbrandsen.priv.no
        

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

Ned Freed(编辑)美国加利福尼亚州蒙罗维亚皇家橡树园Oracle 800 91016-6347

   EMail: ned+ietf@mrochek.com
        
   EMail: ned+ietf@mrochek.com