Internet Engineering Task Force (IETF)                       A. Melnikov
Request for Comments: 7162                                     Isode Ltd
Obsoletes: 4551, 5162                                        D. Cridland
Updates: 2683                                               Surevine Ltd
Category: Standards Track                                       May 2014
ISSN: 2070-1721
        
Internet Engineering Task Force (IETF)                       A. Melnikov
Request for Comments: 7162                                     Isode Ltd
Obsoletes: 4551, 5162                                        D. Cridland
Updates: 2683                                               Surevine Ltd
Category: Standards Track                                       May 2014
ISSN: 2070-1721
        

IMAP Extensions: Quick Flag Changes Resynchronization (CONDSTORE) and Quick Mailbox Resynchronization (QRESYNC)

IMAP扩展:快速标志更改重新同步(CONDSTORE)和快速邮箱重新同步(QRESYNC)

Abstract

摘要

Often, multiple IMAP (RFC 3501) clients need to coordinate changes to a common IMAP mailbox. Examples include different clients working on behalf of the same user and multiple users accessing shared mailboxes. These clients need a mechanism to efficiently synchronize state changes for messages within the mailbox.

通常,多个IMAP(RFC 3501)客户端需要协调对公共IMAP邮箱的更改。示例包括代表同一用户和多个用户访问共享邮箱的不同客户端。这些客户端需要一种机制来高效地同步邮箱中邮件的状态更改。

Initially defined in RFC 4551, the Conditional Store facility provides a protected update mechanism for message state information and a mechanism for requesting only changes to the message state. This memo updates that mechanism and obsoletes RFC 4551, based on operational experience.

条件存储设施最初在RFC 4551中定义,它为消息状态信息提供了一种受保护的更新机制,以及一种仅请求更改消息状态的机制。本备忘录根据运行经验更新了该机制并淘汰了RFC 4551。

This document additionally updates another IMAP extension, Quick Resynchronization, which builds on the Conditional STORE extension to provide an IMAP client the ability to fully resynchronize a mailbox as part of the SELECT/EXAMINE command, without the need for additional server-side state or client round trips. Hence, this memo obsoletes RFC 5162.

本文档还更新了另一个IMAP扩展Quick Resynchronization,该扩展基于条件存储扩展,使IMAP客户端能够作为SELECT/EXAME命令的一部分完全重新同步邮箱,而无需额外的服务器端状态或客户端往返。因此,本备忘录废除了RFC 5162。

Finally, this document also updates the line-length recommendation in Section 3.2.1.5 of RFC 2683.

最后,本文件还更新了RFC 2683第3.2.1.5节中的线路长度建议。

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

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

Copyright Notice

版权公告

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

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

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

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

Table of Contents

目录

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   4
   2.  Requirements Notation . . . . . . . . . . . . . . . . . . . .   5
   3.  IMAP Protocol Changes . . . . . . . . . . . . . . . . . . . .   5
     3.1.  CONDSTORE Extension . . . . . . . . . . . . . . . . . . .   5
       3.1.1.  Advertising Support for CONDSTORE . . . . . . . . . .   8
       3.1.2.  New OK Untagged Responses for SELECT and EXAMINE  . .   8
       3.1.3.  STORE and UID STORE Commands  . . . . . . . . . . . .  10
       3.1.4.  FETCH and UID FETCH Commands  . . . . . . . . . . . .  16
       3.1.5.  MODSEQ Search Criterion in SEARCH . . . . . . . . . .  19
       3.1.6.  Modified SEARCH Untagged Response . . . . . . . . . .  20
       3.1.7.  HIGHESTMODSEQ Status Data Items . . . . . . . . . . .  21
       3.1.8.  CONDSTORE Parameter to SELECT and EXAMINE . . . . . .  21
       3.1.9.  Interaction with IMAP SORT and THREAD Extensions  . .  22
       3.1.10. Interaction with IMAP ESORT and ESEARCH Extensions  .  22
       3.1.11. Additional Quality-of-Implementation Issues . . . . .  23
       3.1.12. CONDSTORE Server Implementation Considerations  . . .  23
     3.2.  QRESYNC Extension . . . . . . . . . . . . . . . . . . . .  24
       3.2.1.  Impact on CONDSTORE-only Clients  . . . . . . . . . .  25
       3.2.2.  Advertising Support for QRESYNC . . . . . . . . . . .  25
       3.2.3.  Use of ENABLE . . . . . . . . . . . . . . . . . . . .  25
       3.2.4.  Additional Requirements on QRESYNC Servers  . . . . .  26
       3.2.5.  QRESYNC Parameter to SELECT/EXAMINE . . . . . . . . .  26
       3.2.6.  VANISHED UID FETCH Modifier . . . . . . . . . . . . .  31
       3.2.7.  EXPUNGE Command . . . . . . . . . . . . . . . . . . .  32
       3.2.8.  CLOSE Command . . . . . . . . . . . . . . . . . . . .  33
       3.2.9.  UID EXPUNGE Command . . . . . . . . . . . . . . . . .  34
       3.2.10. VANISHED Response . . . . . . . . . . . . . . . . . .  35
       3.2.11. CLOSED Response Code  . . . . . . . . . . . . . . . .  38
   4.  Long Command Lines (Update to RFC 2683) . . . . . . . . . . .  39
   5.  QRESYNC Server Implementation Considerations  . . . . . . . .  39
     5.1.  Server Implementations That Don't Store Extra State . . .  39
     5.2.  Server Implementations Storing Minimal State  . . . . . .  40
     5.3.  Additional State Required on the Server . . . . . . . . .  40
   6.  Updated Synchronization Sequence  . . . . . . . . . . . . . .  41
   7.  Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . .  44
   8.  Security Considerations . . . . . . . . . . . . . . . . . . .  48
   9.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  48
   10. References  . . . . . . . . . . . . . . . . . . . . . . . . .  48
     10.1.  Normative References . . . . . . . . . . . . . . . . . .  48
     10.2.  Informative References . . . . . . . . . . . . . . . . .  49
   Appendix A.  Changes since RFC 4551 . . . . . . . . . . . . . . .  50
   Appendix B.  Changes since RFC 5162 . . . . . . . . . . . . . . .  50
   Appendix C.  Acknowledgements . . . . . . . . . . . . . . . . . .  51
        
   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   4
   2.  Requirements Notation . . . . . . . . . . . . . . . . . . . .   5
   3.  IMAP Protocol Changes . . . . . . . . . . . . . . . . . . . .   5
     3.1.  CONDSTORE Extension . . . . . . . . . . . . . . . . . . .   5
       3.1.1.  Advertising Support for CONDSTORE . . . . . . . . . .   8
       3.1.2.  New OK Untagged Responses for SELECT and EXAMINE  . .   8
       3.1.3.  STORE and UID STORE Commands  . . . . . . . . . . . .  10
       3.1.4.  FETCH and UID FETCH Commands  . . . . . . . . . . . .  16
       3.1.5.  MODSEQ Search Criterion in SEARCH . . . . . . . . . .  19
       3.1.6.  Modified SEARCH Untagged Response . . . . . . . . . .  20
       3.1.7.  HIGHESTMODSEQ Status Data Items . . . . . . . . . . .  21
       3.1.8.  CONDSTORE Parameter to SELECT and EXAMINE . . . . . .  21
       3.1.9.  Interaction with IMAP SORT and THREAD Extensions  . .  22
       3.1.10. Interaction with IMAP ESORT and ESEARCH Extensions  .  22
       3.1.11. Additional Quality-of-Implementation Issues . . . . .  23
       3.1.12. CONDSTORE Server Implementation Considerations  . . .  23
     3.2.  QRESYNC Extension . . . . . . . . . . . . . . . . . . . .  24
       3.2.1.  Impact on CONDSTORE-only Clients  . . . . . . . . . .  25
       3.2.2.  Advertising Support for QRESYNC . . . . . . . . . . .  25
       3.2.3.  Use of ENABLE . . . . . . . . . . . . . . . . . . . .  25
       3.2.4.  Additional Requirements on QRESYNC Servers  . . . . .  26
       3.2.5.  QRESYNC Parameter to SELECT/EXAMINE . . . . . . . . .  26
       3.2.6.  VANISHED UID FETCH Modifier . . . . . . . . . . . . .  31
       3.2.7.  EXPUNGE Command . . . . . . . . . . . . . . . . . . .  32
       3.2.8.  CLOSE Command . . . . . . . . . . . . . . . . . . . .  33
       3.2.9.  UID EXPUNGE Command . . . . . . . . . . . . . . . . .  34
       3.2.10. VANISHED Response . . . . . . . . . . . . . . . . . .  35
       3.2.11. CLOSED Response Code  . . . . . . . . . . . . . . . .  38
   4.  Long Command Lines (Update to RFC 2683) . . . . . . . . . . .  39
   5.  QRESYNC Server Implementation Considerations  . . . . . . . .  39
     5.1.  Server Implementations That Don't Store Extra State . . .  39
     5.2.  Server Implementations Storing Minimal State  . . . . . .  40
     5.3.  Additional State Required on the Server . . . . . . . . .  40
   6.  Updated Synchronization Sequence  . . . . . . . . . . . . . .  41
   7.  Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . .  44
   8.  Security Considerations . . . . . . . . . . . . . . . . . . .  48
   9.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  48
   10. References  . . . . . . . . . . . . . . . . . . . . . . . . .  48
     10.1.  Normative References . . . . . . . . . . . . . . . . . .  48
     10.2.  Informative References . . . . . . . . . . . . . . . . .  49
   Appendix A.  Changes since RFC 4551 . . . . . . . . . . . . . . .  50
   Appendix B.  Changes since RFC 5162 . . . . . . . . . . . . . . .  50
   Appendix C.  Acknowledgements . . . . . . . . . . . . . . . . . .  51
        
1. Introduction
1. 介绍

Often, multiple IMAP [RFC3501] clients need to coordinate changes to a common IMAP mailbox. Examples include different clients working on behalf of the same user and clients representing multiple users accessing shared mailboxes. These clients need a mechanism to synchronize state changes for messages within the mailbox. The Conditional Store ("CONDSTORE") facility allows a client to quickly resynchronize mailbox flag changes.

通常,多个IMAP[RFC3501]客户端需要协调对公共IMAP邮箱的更改。示例包括代表同一用户的不同客户端和代表访问共享邮箱的多个用户的客户端。这些客户端需要一种机制来同步邮箱中邮件的状态更改。条件存储(“CONDSTORE”)功能允许客户端快速重新同步邮箱标志更改。

The Conditional Store facility also provides a protected update mechanism for message state information that can detect and resolve conflicts between multiple writing mail clients. The mechanism can be used to guarantee that only one client can change the message state at any given time. For example, this can be used by multiple clients that treat a mailbox as a message queue.

条件存储设施还为消息状态信息提供了受保护的更新机制,可以检测和解决多个写邮件客户端之间的冲突。该机制可用于保证在任何给定时间只有一个客户端可以更改消息状态。例如,将邮箱视为消息队列的多个客户端可以使用此选项。

The Conditional Store facility is provided by associating a modification sequence (mod-sequence) with every IMAP message. This is updated whenever metadata (such as a message flag) is modified.

通过将修改序列(mod sequence)与每个IMAP消息相关联,可以提供条件存储功能。每当修改元数据(如消息标志)时,都会对其进行更新。

The CONDSTORE extension is described in more detail in Section 3.1.

第3.1节详细描述了CONDSTORE扩展。

The CONDSTORE extension gives a disconnected client the ability to quickly resynchronize IMAP flag changes for previously seen messages. This can be done using the CHANGEDSINCE FETCH modifier once a mailbox is opened. In order for the client to discover which messages have been expunged, the client still has to issue a UID FETCH or a UID SEARCH command. The Quick Mailbox Resynchronization (QRESYNC) IMAP extension is an extension to CONDSTORE that allows a reconnecting client to perform full resynchronization, including discovery of expunged messages, in a single round trip. QRESYNC also introduces a new response, VANISHED, that allows for a more compact representation of a list of expunged messages.

CONDSTORE扩展使断开连接的客户端能够快速重新同步以前看到的消息的IMAP标志更改。打开邮箱后,可以使用CHANGEDSINCE FETCH修饰符完成此操作。为了让客户端发现哪些消息已被删除,客户端仍然必须发出UID FETCH或UID SEARCH命令。快速邮箱重新同步(QRESYNC)IMAP扩展是CONDSTORE的扩展,它允许重新连接的客户端在一次往返中执行完全重新同步,包括发现已删除的邮件。QRESYNC还引入了一个新的响应,即消失,它允许更紧凑地表示已删除消息的列表。

QRESYNC can be useful for mobile clients that can experience frequent disconnects caused by environmental factors (such as battery life, signal strength, etc.). Such clients need a way to quickly reconnect to the IMAP server, while minimizing delay experienced by the user as well as the amount of traffic generated by resynchronization.

QRESYNC对于可能因环境因素(如电池寿命、信号强度等)而频繁断开连接的移动客户端非常有用。这样的客户端需要一种快速重新连接到IMAP服务器的方法,同时最大限度地减少用户所经历的延迟以及重新同步所产生的通信量。

By extending the SELECT command to perform the additional resynchronization, this also allows clients to reduce concurrent connections to the IMAP server held purely for the sake of avoiding the resynchronization.

通过扩展SELECT命令来执行额外的重新同步,这还允许客户端减少与IMAP服务器的并发连接,而这纯粹是为了避免重新同步。

The QRESYNC extension is described in more detail in Section 3.2.

第3.2节详细描述了QRESYNC扩展。

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

In the examples that follow, "C:" and "S:" indicate lines sent by the client and server, respectively. If a single "C:" or "S:" label applies to multiple lines, then the line breaks between those lines are for editorial clarity only and are not part of the actual protocol exchange. The five characters [...] means that something has been elided.

在下面的示例中,“C:”和“S:”分别表示客户端和服务器发送的行。如果单个“C:”或“S:”标签适用于多行,则这些行之间的换行符仅用于编辑清晰性,不属于实际协议交换的一部分。五个字符[…]意味着某些东西被省略了。

Formal syntax is defined using ABNF [RFC5234].

形式语法是使用ABNF[RFC5234]定义的。

The term "metadata" or "metadata item" is used throughout this document. It refers to any system- or user-defined keyword. If the server supports the IMAP ANNOTATE-EXPERIMENT-1 extension [RFC5257], then metadata also includes message annotations. Future documents may extend "metadata" to include other dynamic message data.

本文件中使用了术语“元数据”或“元数据项”。它指的是任何系统或用户定义的关键字。如果服务器支持IMAP ANNOTATE-Experience-1扩展[RFC5257],则元数据还包括消息注释。未来的文档可能会扩展“元数据”以包括其他动态消息数据。

Some IMAP mailboxes are private, accessible only to the owning user. Other mailboxes are not, either because the owner has set an Access Control List [RFC4314] that permits access by other users or because it is a shared mailbox. Let's call a metadata item "shared" for the mailbox if any changes to the metadata items are persistent and visible to all other users accessing the mailbox. Otherwise, the metadata item is called "private". Note that private metadata items are still visible to all sessions accessing the mailbox as the same user. Also, note that different mailboxes may have different metadata items as shared.

某些IMAP邮箱是专用的,只能由所属用户访问。其他邮箱不是,因为所有者设置了允许其他用户访问的访问控制列表[RFC4314],或者因为它是共享邮箱。如果元数据项的任何更改是持久的,并且对访问邮箱的所有其他用户可见,那么我们将该邮箱的元数据项称为“共享”。否则,元数据项称为“private”。请注意,私有元数据项对于以同一用户身份访问邮箱的所有会话仍然可见。另外,请注意,不同的邮箱可能共享不同的元数据项。

See Section 3.1 for the definition of a "CONDSTORE-aware client" and a "CONDSTORE enabling command".

参见第3.1节,了解“CONDSTORE感知客户端”和“CONDSTORE启用命令”的定义。

Understanding of the IMAP message sequence numbers and UIDs (see Section 2.3.1 of [RFC3501]) and the EXPUNGE response (see Section 7.4.1 of [RFC3501]) is essential when reading this document.

阅读本文件时,必须了解IMAP消息序列号和UID(见[RFC3501]第2.3.1节)以及删除响应(见[RFC3501]第7.4.1节)。

3. IMAP Protocol Changes
3. IMAP协议更改
3.1. CONDSTORE Extension
3.1. 调味品分店

An IMAP server that supports CONDSTORE MUST associate a positive unsigned 63-bit (*) value, called a mod-sequence, with every IMAP message. This is an opaque value updated by the server whenever a metadata item is modified. The server MUST guarantee that each STORE command performed on the same mailbox (including simultaneous stores

支持CONDSTORE的IMAP服务器必须将一个称为mod序列的无符号63位(*)正值与每个IMAP消息相关联。这是一个不透明值,每当修改元数据项时,服务器都会更新该值。服务器必须保证在同一邮箱(包括同时存储)上执行每个存储命令

to different metadata items from different connections) will get a different mod-sequence value. Also, for any two successful STORE operations performed in the same session on the same mailbox, the mod-sequence of the second completed operation MUST be greater than the mod-sequence of the first completed operation. Note that the latter rule disallows the direct use of the system clock as a mod-sequence because if system time changes (e.g., an NTP [NTP] client adjusting the time), the next generated value might be less than the previous one.

从不同的连接到不同的元数据项)将获得不同的mod sequence值。此外,对于在同一邮箱上的同一会话中执行的任何两个成功存储操作,第二个完成操作的mod序列必须大于第一个完成操作的mod序列。请注意,后一条规则不允许将系统时钟直接用作mod序列,因为如果系统时间发生变化(例如,NTP[NTP]客户端调整时间),则下一个生成的值可能会小于上一个值。

(*) Note: RFC 4551 defined mod-sequences as unsigned 64-bit values. In order to make implementations on various platforms (such as Java) easier, this version of the document redefines them as unsigned 63-bit values.

(*)注:RFC 4551将mod序列定义为无符号64位值。为了使各种平台(如Java)上的实现更容易,本文档版本将它们重新定义为无符号63位值。

These rules allow a client to list all metadata changes since a well-known point in time, as well as to perform conditional metadata modifications based on an assumption that the metadata state hasn't changed for a particular message.

这些规则允许客户端列出自已知时间点以来的所有元数据更改,并基于特定消息的元数据状态未更改的假设执行有条件的元数据修改。

In particular, mod-sequences allow a client that supports the CONDSTORE extension to determine if a message metadata has changed since some known moment. Whenever the state of a flag changes (i.e., the flag is added where previously it wasn't set, or the flag is removed where previously it was set), the value of the modification sequence for the message MUST be updated. Setting a flag that is already set, or clearing a flag that is not set, SHOULD NOT change the mod-sequence.

特别是,mod序列允许支持CONDSTORE扩展的客户机确定消息元数据是否在某个已知时刻发生了更改。每当标志状态发生变化时(即,在以前未设置标志的位置添加标志,或在以前设置标志的位置删除标志),必须更新消息修改序列的值。设置已设置的标志或清除未设置的标志不应改变mod序列。

When a message is appended to a mailbox (via the IMAP APPEND command, COPY to the mailbox, or using an external mechanism), the server generates a new modification sequence that is higher than the highest modification sequence of all messages in the mailbox and assigns it to the appended message.

将邮件追加到邮箱时(通过IMAP APPEND命令、复制到邮箱或使用外部机制),服务器将生成一个新的修改序列,该修改序列高于邮箱中所有邮件的最高修改序列,并将其分配给追加的邮件。

The server MAY store separate (per-message) modification sequence values for different metadata items. If the server does so, per-message mod-sequence is the highest mod-sequence of all metadata items accessible to the currently logged-in user for the specified message.

服务器可以为不同的元数据项存储单独的(每条消息)修改序列值。如果服务器执行此操作,则每消息mod sequence是当前登录用户可访问的指定消息的所有元数据项的最高mod sequence。

The server that supports CONDSTORE is not required to be able to store mod-sequences for every available mailbox. Section 3.1.2.2 describes how the server may act if a particular mailbox doesn't support the persistent storage of mod-sequences.

支持CONDSTORE的服务器不需要能够存储每个可用邮箱的mod序列。第3.1.2.2节描述了如果特定邮箱不支持mod序列的持久存储,服务器将如何操作。

CONDSTORE makes the following changes to the IMAP4 protocol:

CONDSTORE对IMAP4协议进行了以下更改:

a. adds the UNCHANGEDSINCE STORE modifier.

a. 添加未更改的自存储修改器。

b. adds the MODIFIED response code that is used with an OK response to the STORE command. (It can also be used in a NO response.)

b. 将与OK响应一起使用的修改响应代码添加到STORE命令。(也可用于无响应。)

c. adds a new MODSEQ message data item for use with the FETCH command.

c. 添加一个新的MODSEQ消息数据项,以便与FETCH命令一起使用。

d. adds the CHANGEDSINCE FETCH modifier.

d. 添加CHANGEDSINCE获取修改器。

e. adds a new MODSEQ search criterion.

e. 添加新的MODSEQ搜索条件。

f. extends the syntax of untagged SEARCH and ESEARCH responses to include mod-sequence.

f. 扩展未标记搜索和ESEARCH响应的语法,以包括mod sequence。

g. adds new OK untagged responses (HIGHESTMODSEQ and NOMODSEQ) for the SELECT and EXAMINE commands.

g. 为SELECT和EXAMINE命令添加新的OK未标记响应(HIGHESTMODSEQ和NOMODSEQ)。

h. defines an additional CONDSTORE parameter to SELECT/EXAMINE commands.

h. 定义用于选择/检查命令的附加CONDSTORE参数。

i. adds the HIGHESTMODSEQ status data item to the STATUS command.

i. 将HIGHESTMODSEQ状态数据项添加到status命令。

A client supporting the CONDSTORE extension indicates its willingness to receive mod-sequence updates in all untagged FETCH responses by issuing one of the following, which are called "CONDSTORE enabling commands":

支持CONDSTORE扩展的客户端通过发出以下命令之一(称为“CONDSTORE启用命令”)表示其愿意在所有未标记的获取响应中接收mod sequence更新:

o a SELECT or EXAMINE command with the CONDSTORE parameter,

o 带有CONDSTORE参数的SELECT或EXAMINE命令,

o a STATUS (HIGHESTMODSEQ) command,

o 状态(HIGHESTMODSEQ)命令,

o a FETCH or SEARCH command that includes the MODSEQ message data item,

o 包含MODSEQ消息数据项的获取或搜索命令,

o a FETCH command with the CHANGEDSINCE modifier,

o 带有CHANGEDSINCE修饰符的FETCH命令,

o a STORE command with the UNCHANGEDSINCE modifier, or

o 带有UNCHANGEDSINCE修饰符的STORE命令,或

o an ENABLE command containing "CONDSTORE" as one of the parameters. (This option only applies when the client is communicating with a server that also implements the ENABLE extension [RFC5161].)

o 包含“CONDSTORE”作为参数之一的ENABLE命令。(此选项仅在客户端与同时实现启用扩展[RFC5161]的服务器通信时适用。)

Once a client issues a CONDSTORE enabling command, it has announced itself as a "CONDSTORE-aware client". The server MUST then include mod-sequence data in all subsequent untagged FETCH responses (until

一旦客户机发出CONDSTORE启用命令,它就宣布自己是“CONDSTORE感知客户机”。然后,服务器必须在所有后续未标记的获取响应中包含mod sequence数据(直到

the connection is closed), whether they were caused by a regular STORE, a STORE with an UNCHANGEDSINCE modifier, or an external agent.

连接已关闭),无论它们是由常规存储、具有未更改的ince修饰符的存储还是外部代理引起的。

A future extension to this document may extend the list of CONDSTORE enabling commands. A first CONDSTORE enabling command executed in the session with a mailbox selected MUST cause the server to return HIGHESTMODSEQ (Section 3.1.2.1) for the mailbox (if any is selected), unless the server has sent a NOMODSEQ (Section 3.1.2.2) response code when the currently selected mailbox was selected.

本文档的后续扩展可能会扩展CONDSTORE启用命令的列表。在选择邮箱的会话中执行的第一个CONDSTORE启用命令必须导致服务器返回邮箱的HIGHESTMODSEQ(第3.1.2.1节)(如果选择了任何邮箱),除非在选择当前所选邮箱时服务器已发送NOMODSEQ(第3.1.2.2节)响应代码。

3.1.1. Advertising Support for CONDSTORE
3.1.1. 康德商店的广告支持

The Conditional STORE extension is present in any IMAP4 implementation that returns "CONDSTORE" as one of the supported capabilities in the CAPABILITY command response.

条件存储扩展存在于任何IMAP4实现中,该实现在CAPABILITY命令响应中将“CONDSTORE”作为支持的功能之一返回。

3.1.2. New OK Untagged Responses for SELECT and EXAMINE
3.1.2. 选择和检查的新“确定”未标记响应

This document adds two new response codes: HIGHESTMODSEQ and NOMODSEQ. One of these two response codes MUST be returned in an OK untagged response for any successful SELECT/EXAMINE command issued after a CONDSTORE enabling command.

本文档添加了两个新的响应代码:HIGHESTMODSEQ和NOMODSEQ。对于在CONDSTORE启用命令之后发出的任何成功的SELECT/inspect命令,必须在OK untaged响应中返回这两个响应代码之一。

When opening a mailbox, the server must check if the mailbox supports the persistent storage of mod-sequences. If the mailbox supports the persistent storage of mod-sequences and the mailbox open operation succeeds, the server MUST send an OK untagged response, including the HIGHESTMODSEQ response code. If the persistent storage for the mailbox is not supported, the server MUST send an OK untagged response, including the NOMODSEQ response code instead.

打开邮箱时,服务器必须检查邮箱是否支持mod序列的持久存储。如果邮箱支持mod序列的持久存储,并且邮箱打开操作成功,则服务器必须发送OK Untaged响应,包括HIGHESTMODSEQ响应代码。如果不支持邮箱的持久性存储,则服务器必须发送OK Untaged响应,包括NOMODSEQ响应代码。

3.1.2.1. HIGHESTMODSEQ Response Code
3.1.2.1. HIGHESTMODSEQ响应代码

This document adds a new response code that is returned in an OK untagged response for the SELECT and EXAMINE commands. Once a CONDSTORE enabling command is issued, a server supporting the persistent storage of mod-sequences for the mailbox MUST send an OK untagged response, including the HIGHESTMODSEQ response code with every successful SELECT or EXAMINE command:

本文档添加了一个新的响应代码,该代码在SELECT和EXAMINE命令的OK untagged响应中返回。发出CONDSTORE启用命令后,支持邮箱mod序列永久存储的服务器必须发送OK Untaged响应,包括每个成功的SELECT或EXAMINE命令的HIGHESTMODSEQ响应代码:

OK [HIGHESTMODSEQ <mod-sequence-value>]

正常[最高ModSeq<mod sequence value>]

where <mod-sequence-value> is the highest mod-sequence value of all messages in the mailbox. When the server changes UIDVALIDITY for a mailbox, it doesn't have to keep the same HIGHESTMODSEQ for the mailbox.

其中<mod sequence value>是邮箱中所有邮件的最高mod sequence值。当服务器更改邮箱的UIDVality时,它不必为邮箱保持相同的HIGHESTMODSEQ。

Note that some existing CONDSTORE servers don't start tracking mod-sequences or don't report them until after a CONDSTORE enabling command is issued. Because of that, a client wishing to receive HIGHESTMODSEQ/NOMODSEQ information must first send a CONDSTORE enabling command, for example, by using SELECT/EXAMINE with the CONDSTORE parameter (see Section 3.1.8).

请注意,一些现有的CONDSTORE服务器在发出CONDSTORE启用命令之前不会开始跟踪mod序列或报告它们。因此,希望接收HIGHESTMODSEQ/NOMODSEQ信息的客户机必须首先发送一个CONDSTORE启用命令,例如,使用带有CONDSTORE参数的SELECT/Inspect(选择/检查)(参见第3.1.8节)。

A disconnected client can use the value of HIGHESTMODSEQ to check if it has to refetch metadata from the server. If the UIDVALIDITY value has changed for the selected mailbox, the client MUST delete the cached value of HIGHESTMODSEQ. If UIDVALIDITY for the mailbox is the same, and if the HIGHESTMODSEQ value stored in the client's cache is less than the value returned by the server, then some metadata items on the server have changed since the last synchronization, and the client needs to update its cache. The client MAY use SEARCH MODSEQ (Section 3.1.5) to find out exactly which metadata items have changed. Alternatively, the client MAY issue FETCH with the CHANGEDSINCE modifier (Section 3.1.4.1) in order to fetch data for all messages that have metadata items changed since some known modification sequence.

断开连接的客户端可以使用HIGHESTMODSEQ的值来检查是否必须从服务器重新提取元数据。如果选定邮箱的UIDVality值已更改,则客户端必须删除高速缓存的HIGHESTMODSEQ值。如果邮箱的UIDVality相同,并且客户端缓存中存储的HIGHESTMODSEQ值小于服务器返回的值,则服务器上的某些元数据项自上次同步以来已更改,客户端需要更新其缓存。客户可以使用SEARCH MODSEQ(第3.1.5节)准确地找出哪些元数据项已更改。或者,客户机可以使用CHANGEDSINCE修饰符(第3.1.4.1节)发出FETCH命令,以获取元数据项在某些已知修改序列之后发生更改的所有消息的数据。

   C: A142 SELECT INBOX
   S: * 172 EXISTS
   S: * 1 RECENT
   S: * OK [UNSEEN 12] Message 12 is first unseen
   S: * OK [UIDVALIDITY 3857529045] UIDs valid
   S: * OK [UIDNEXT 4392] Predicted next UID
   S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
   S: * OK [PERMANENTFLAGS (\Deleted \Seen \*)] Limited
   S: * OK [HIGHESTMODSEQ 715194045007]
   S: A142 OK [READ-WRITE] SELECT completed
        
   C: A142 SELECT INBOX
   S: * 172 EXISTS
   S: * 1 RECENT
   S: * OK [UNSEEN 12] Message 12 is first unseen
   S: * OK [UIDVALIDITY 3857529045] UIDs valid
   S: * OK [UIDNEXT 4392] Predicted next UID
   S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
   S: * OK [PERMANENTFLAGS (\Deleted \Seen \*)] Limited
   S: * OK [HIGHESTMODSEQ 715194045007]
   S: A142 OK [READ-WRITE] SELECT completed
        

Example 1

例1

3.1.2.2. NOMODSEQ Response Code
3.1.2.2. NOMODSEQ响应代码

Once a CONDSTORE enabling command is issued, a server that doesn't support the persistent storage of mod-sequences for the mailbox MUST send an OK untagged response, including the NOMODSEQ response code with every successful SELECT or EXAMINE command. Note that some existing CONDSTORE servers don't return NOMODSEQ until after a CONDSTORE enabling command is issued. Because of that, a client wishing to receive HIGHESTMODSEQ/NOMODSEQ information must first send a CONDSTORE enabling command, for example, by using SELECT/EXAMINE with the CONDSTORE parameter (see Section 3.1.8).

发出CONDSTORE启用命令后,不支持邮箱mod序列持久存储的服务器必须发送OK Untaged响应,包括NOMODSEQ响应代码以及每个成功的SELECT或EXAMINE命令。请注意,一些现有的CONDSTORE服务器在发出CONDSTORE启用命令之前不会返回NOMODSEQ。因此,希望接收HIGHESTMODSEQ/NOMODSEQ信息的客户机必须首先发送一个CONDSTORE启用命令,例如,使用带有CONDSTORE参数的SELECT/Inspect(选择/检查)(参见第3.1.8节)。

A server that returned the NOMODSEQ response code for a mailbox MUST reject (with a tagged BAD response) any of the following commands while the mailbox remains selected:

为邮箱返回NOMODSEQ响应代码的服务器必须在邮箱保持选中状态时拒绝(带有标记的错误响应)以下任何命令:

o a FETCH command with the CHANGEDSINCE modifier,

o 带有CHANGEDSINCE修饰符的FETCH命令,

o a FETCH or SEARCH command that includes the MODSEQ message data item, or

o 包含MODSEQ消息数据项的FETCH或SEARCH命令,或

o a STORE command with the UNCHANGEDSINCE modifier.

o 带有UNCHANGEDSINCE修饰符的存储命令。

   C: A142 SELECT INBOX
   S: * 172 EXISTS
   S: * 1 RECENT
   S: * OK [UNSEEN 12] Message 12 is first unseen
   S: * OK [UIDVALIDITY 3857529045] UIDs valid
   S: * OK [UIDNEXT 4392] Predicted next UID
   S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
   S: * OK [PERMANENTFLAGS (\Deleted \Seen \*)] Limited
   S: * OK [NOMODSEQ] Sorry, this mailbox format doesn't support
       modsequences
   S: A142 OK [READ-WRITE] SELECT completed
        
   C: A142 SELECT INBOX
   S: * 172 EXISTS
   S: * 1 RECENT
   S: * OK [UNSEEN 12] Message 12 is first unseen
   S: * OK [UIDVALIDITY 3857529045] UIDs valid
   S: * OK [UIDNEXT 4392] Predicted next UID
   S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
   S: * OK [PERMANENTFLAGS (\Deleted \Seen \*)] Limited
   S: * OK [NOMODSEQ] Sorry, this mailbox format doesn't support
       modsequences
   S: A142 OK [READ-WRITE] SELECT completed
        

Example 2

例2

3.1.3. STORE and UID STORE Commands
3.1.3. STORE和UID STORE命令

This document defines the following STORE modifier (see Section 2.5 of [RFC4466]):

本文件定义了以下存储修改器(见[RFC4466]第2.5节):

UNCHANGEDSINCE <mod-sequence>

不变自<mod sequence>

For each message specified in the message set, the server performs the following. If the mod-sequence of every metadata item of the message affected by the STORE/UID STORE is equal to or less than the specified UNCHANGEDSINCE value, then the requested operation (as described by the message data item) is performed. If the operation is successful, the server MUST update the mod-sequence attribute of the message. An untagged FETCH response MUST be sent, even if the .SILENT suffix is specified, and the response MUST include the MODSEQ message data item. This is required to update the client's cache with the correct mod-sequence values. See Section 3.1.4.2 for more details.

对于消息集中指定的每条消息,服务器执行以下操作。如果受STORE/UID STORE影响的消息的每个元数据项的mod序列等于或小于指定的UNCHANGEDSINCE值,则执行请求的操作(如消息数据项所述)。如果操作成功,服务器必须更新消息的mod sequence属性。即使指定了.SILENT后缀,也必须发送未标记的获取响应,并且响应必须包括MODSEQ消息数据项。这是使用正确的mod sequence值更新客户端缓存所必需的。详见第3.1.4.2节。

However, if the mod-sequence of any metadata item of the message is greater than the specified UNCHANGEDSINCE value, then the requested operation MUST NOT be performed. In this case, the mod-sequence

但是,如果消息的任何元数据项的mod sequence大于指定的UNCHANGEDSINCE值,则不得执行请求的操作。在这种情况下,mod序列

attribute of the message is not updated, and the message number (or unique identifier in the case of the UID STORE command) is added to the list of messages that failed the UNCHANGEDSINCE test.

消息的属性不会更新,并且消息编号(或UID STORE命令中的唯一标识符)将添加到未通过UNCHANGEDSINCE测试的消息列表中。

When the server finishes performing the operation on all the messages in the message set, it checks for a non-empty list of messages that failed the UNCHANGEDSINCE test. If this list is non-empty, the server MUST return in the tagged response a MODIFIED response code. The MODIFIED response code includes the message set (for STORE) or set of UIDs (for UID STORE) of all messages that failed the UNCHANGEDSINCE test.

当服务器完成对消息集中所有消息的操作时,它将检查未通过UNCHANGEDSINCE测试的消息的非空列表。如果此列表非空,服务器必须在标记的响应中返回修改的响应代码。修改后的响应代码包括未通过UNCHANGEDSINCE测试的所有消息的消息集(用于存储)或UID集(用于UID存储)。

All messages pass the UNCHANGEDSINCE test.

所有消息都通过未更改的自测试。

   C: a103 UID STORE 6,4,8 (UNCHANGEDSINCE 12121230045)
       +FLAGS.SILENT (\Deleted)
   S: * 1 FETCH (UID 4 MODSEQ (12121231000))
   S: * 2 FETCH (UID 6 MODSEQ (12121230852))
   S: * 4 FETCH (UID 8 MODSEQ (12121230956))
   S: a103 OK Conditional Store completed
        
   C: a103 UID STORE 6,4,8 (UNCHANGEDSINCE 12121230045)
       +FLAGS.SILENT (\Deleted)
   S: * 1 FETCH (UID 4 MODSEQ (12121231000))
   S: * 2 FETCH (UID 6 MODSEQ (12121230852))
   S: * 4 FETCH (UID 8 MODSEQ (12121230956))
   S: a103 OK Conditional Store completed
        

Example 3

例3

   C: a104 STORE * (UNCHANGEDSINCE 12121230045) +FLAGS.SILENT
       (\Deleted $Processed)
   S: * 50 FETCH (MODSEQ (12111230047))
   S: a104 OK Store (conditional) completed
        
   C: a104 STORE * (UNCHANGEDSINCE 12121230045) +FLAGS.SILENT
       (\Deleted $Processed)
   S: * 50 FETCH (MODSEQ (12111230047))
   S: a104 OK Store (conditional) completed
        

Example 4

例4

   C: c101 STORE 50 (UNCHANGEDSINCE 12121230045) -FLAGS.SILENT
       (\Deleted)
   S: * OK [HIGHESTMODSEQ 12111230047]
   S: * 50 FETCH (MODSEQ (12111230048))
   S: c101 OK Store (conditional) completed
        
   C: c101 STORE 50 (UNCHANGEDSINCE 12121230045) -FLAGS.SILENT
       (\Deleted)
   S: * OK [HIGHESTMODSEQ 12111230047]
   S: * 50 FETCH (MODSEQ (12111230048))
   S: c101 OK Store (conditional) completed
        

The HIGHESTMODSEQ response code was sent by the server presumably because this was the first CONDSTORE enabling command.

HIGHESTMODSEQ响应代码由服务器发送,可能是因为这是第一个CONDSTORE启用命令。

Example 5

例5

The failure of the conditional STORE operation for any particular message or messages (7 in this example) does not stop the server from finding all messages that fail the UNCHANGEDSINCE test. All such messages are returned in the MODIFIED response code.

任何特定消息的条件存储操作失败(本例中为7)不会阻止服务器查找未通过UNCHANGEDSINCE测试的所有消息。所有此类消息都以修改后的响应代码返回。

   C: d105 STORE 7,5,9 (UNCHANGEDSINCE 320162338)
       +FLAGS.SILENT (\Deleted)
   S: * 5 FETCH (MODSEQ (320162350))
   S: d105 OK [MODIFIED 7,9] Conditional STORE failed
        
   C: d105 STORE 7,5,9 (UNCHANGEDSINCE 320162338)
       +FLAGS.SILENT (\Deleted)
   S: * 5 FETCH (MODSEQ (320162350))
   S: d105 OK [MODIFIED 7,9] Conditional STORE failed
        

Example 6

例6

Same as above, but the server follows the SHOULD recommendation in Section 6.4.6 of [RFC3501].

同上,但服务器应遵循[RFC3501]第6.4.6节中的建议。

   C: d105 STORE 7,5,9 (UNCHANGEDSINCE 320162338)
       +FLAGS.SILENT (\Deleted)
   S: * 7 FETCH (MODSEQ (320162342) FLAGS (\Seen \Deleted))
   S: * 5 FETCH (MODSEQ (320162350))
   S: * 9 FETCH (MODSEQ (320162349) FLAGS (\Answered))
   S: d105 OK [MODIFIED 7,9] Conditional STORE failed
        
   C: d105 STORE 7,5,9 (UNCHANGEDSINCE 320162338)
       +FLAGS.SILENT (\Deleted)
   S: * 7 FETCH (MODSEQ (320162342) FLAGS (\Seen \Deleted))
   S: * 5 FETCH (MODSEQ (320162350))
   S: * 9 FETCH (MODSEQ (320162349) FLAGS (\Answered))
   S: d105 OK [MODIFIED 7,9] Conditional STORE failed
        

Use of UNCHANGEDSINCE with a modification sequence of 0 always fails if the metadata item exists. A system flag MUST always be considered existent, whether it was set or not.

如果元数据项存在,则使用修改序列为0的UNCHANGEDSINCE始终失败。无论是否设置了系统标志,都必须始终将其视为存在。

Example 7

例7

   C: a102 STORE 12 (UNCHANGEDSINCE 0)
       +FLAGS.SILENT ($MDNSent)
   S: a102 OK [MODIFIED 12] Conditional STORE failed
        
   C: a102 STORE 12 (UNCHANGEDSINCE 0)
       +FLAGS.SILENT ($MDNSent)
   S: a102 OK [MODIFIED 12] Conditional STORE failed
        

The client has tested the presence of the $MDNSent user-defined keyword.

客户端已测试$MDNSent用户定义关键字的存在性。

Example 8

例8

Note: A client trying to make an atomic change to the state of a particular metadata item (or a set of metadata items) MUST be prepared to deal with the case when the server returns the MODIFIED response code if the state of the metadata item being watched hasn't changed (but the state of some other metadata item has). This is necessary because some servers don't store separate mod-sequences for different metadata items. However, a server implementation SHOULD avoid generating spurious MODIFIED responses for +FLAGS/-FLAGS STORE operations, even when the server stores a single mod-sequence per message. Section 3.1.12 describes how this can be achieved.

注意:试图对特定元数据项(或一组元数据项)的状态进行原子更改的客户机必须准备好处理这样的情况:如果正在监视的元数据项的状态没有更改(但某些其他元数据项的状态已更改),则服务器返回修改后的响应代码。这是必要的,因为有些服务器不为不同的元数据项存储单独的mod序列。但是,服务器实现应该避免为+FLAGS/-FLAGS存储操作生成虚假的修改响应,即使在服务器为每条消息存储单个mod序列时也是如此。第3.1.12节描述了如何实现这一点。

Unless the server has included an unsolicited FETCH to update the client's knowledge about messages that have failed the UNCHANGEDSINCE test, upon receipt of the MODIFIED response code, the client SHOULD try to figure out if the required metadata items have indeed changed

除非服务器包含一个未经请求的获取,以更新客户端对未通过UNCHANGEDSINCE测试的消息的了解,否则在收到修改的响应代码后,客户端应尝试确定所需的元数据项是否确实发生了更改

by issuing the FETCH or NOOP command. It is RECOMMENDED that the server avoids the need for the client to do that by sending an unsolicited FETCH response (see Examples 9 and 10).

通过发出FETCH或NOOP命令。建议服务器通过发送未经请求的获取响应(参见示例9和10)来避免客户机这样做。

If the required metadata items haven't changed, the client SHOULD retry the command with the new mod-sequence. The client needs to allow for a reasonable number of retries (at least 2).

如果所需的元数据项没有更改,客户端应使用新的mod序列重试该命令。客户端需要允许合理的重试次数(至少2次)。

In the example below, the server returns the MODIFIED response code without sending information describing why the STORE UNCHANGEDSINCE operation has failed.

在下面的示例中,服务器返回修改后的响应代码,而不发送描述STORE UNCHANGEDSINCE操作失败原因的信息。

   C: a106 STORE 100:150 (UNCHANGEDSINCE 212030000000)
       +FLAGS.SILENT ($Processed)
   S: * 100 FETCH (MODSEQ (303181230852))
   S: * 102 FETCH (MODSEQ (303181230852))
      ...
   S: * 150 FETCH (MODSEQ (303181230852))
   S: a106 OK [MODIFIED 101] Conditional STORE failed
        
   C: a106 STORE 100:150 (UNCHANGEDSINCE 212030000000)
       +FLAGS.SILENT ($Processed)
   S: * 100 FETCH (MODSEQ (303181230852))
   S: * 102 FETCH (MODSEQ (303181230852))
      ...
   S: * 150 FETCH (MODSEQ (303181230852))
   S: a106 OK [MODIFIED 101] Conditional STORE failed
        

The flag $Processed was set on the message 101...

已在消息101上设置标志$Processed。。。

   C: a107 NOOP
   S: * 101 FETCH (MODSEQ (303011130956) FLAGS ($Processed))
   S: a107 OK
        
   C: a107 NOOP
   S: * 101 FETCH (MODSEQ (303011130956) FLAGS ($Processed))
   S: a107 OK
        

Example 9

例9

Or, the flag hasn't changed, but another has (note that this server behavior is discouraged. Server implementers should also see Section 3.1.12)...

或者,该标志没有更改,但另一个标志已更改(请注意,不鼓励这种服务器行为。服务器实现者还应参阅第3.1.12节)。。。

   C: b107 NOOP
   S: * 101 FETCH (MODSEQ (303011130956) FLAGS (\Deleted \Answered))
   S: b107 OK
        
   C: b107 NOOP
   S: * 101 FETCH (MODSEQ (303011130956) FLAGS (\Deleted \Answered))
   S: b107 OK
        

...and the client retries the operation for the message 101 with the updated UNCHANGEDSINCE value.

…并且客户端使用更新的UNCHANGEDSINCE值重试消息101的操作。

   C: b108 STORE 101 (UNCHANGEDSINCE 303011130956)
       +FLAGS.SILENT ($Processed)
   S: * 101 FETCH (MODSEQ (303181230852))
   S: b108 OK Conditional Store completed
        
   C: b108 STORE 101 (UNCHANGEDSINCE 303011130956)
       +FLAGS.SILENT ($Processed)
   S: * 101 FETCH (MODSEQ (303181230852))
   S: b108 OK Conditional Store completed
        

Same as above, but the server avoids the need for the client to poll for changes.

同上,但服务器避免了客户端轮询更改的需要。

The flag $Processed was set on the message 101 by another client...

另一个客户端在消息101上设置了标志$Processed。。。

   C: a106 STORE 100:150 (UNCHANGEDSINCE 212030000000)
       +FLAGS.SILENT ($Processed)
   S: * 100 FETCH (MODSEQ (303181230852))
   S: * 101 FETCH (MODSEQ (303011130956) FLAGS ($Processed))
   S: * 102 FETCH (MODSEQ (303181230852))
   ...
   S: * 150 FETCH (MODSEQ (303181230852))
   S: a106 OK [MODIFIED 101] Conditional STORE failed
        
   C: a106 STORE 100:150 (UNCHANGEDSINCE 212030000000)
       +FLAGS.SILENT ($Processed)
   S: * 100 FETCH (MODSEQ (303181230852))
   S: * 101 FETCH (MODSEQ (303011130956) FLAGS ($Processed))
   S: * 102 FETCH (MODSEQ (303181230852))
   ...
   S: * 150 FETCH (MODSEQ (303181230852))
   S: a106 OK [MODIFIED 101] Conditional STORE failed
        

Example 10

例10

Or, the flag hasn't changed, but another has (note that this server behavior is discouraged. Server implementers should also see Section 3.1.12)...

或者,该标志没有更改,但另一个标志已更改(请注意,不鼓励这种服务器行为。服务器实现者还应参阅第3.1.12节)。。。

   C: a106 STORE 100:150 (UNCHANGEDSINCE 212030000000)
       +FLAGS.SILENT ($Processed)
   S: * 100 FETCH (MODSEQ (303181230852))
   S: * 101 FETCH (MODSEQ (303011130956) FLAGS (\Deleted \Answered))
   S: * 102 FETCH (MODSEQ (303181230852))
   ...
   S: * 150 FETCH (MODSEQ (303181230852))
   S: a106 OK [MODIFIED 101] Conditional STORE failed
        
   C: a106 STORE 100:150 (UNCHANGEDSINCE 212030000000)
       +FLAGS.SILENT ($Processed)
   S: * 100 FETCH (MODSEQ (303181230852))
   S: * 101 FETCH (MODSEQ (303011130956) FLAGS (\Deleted \Answered))
   S: * 102 FETCH (MODSEQ (303181230852))
   ...
   S: * 150 FETCH (MODSEQ (303181230852))
   S: a106 OK [MODIFIED 101] Conditional STORE failed
        

...and the client retries the operation for the message 101 with the updated UNCHANGEDSINCE value.

…并且客户端使用更新的UNCHANGEDSINCE值重试消息101的操作。

   C: b108 STORE 101 (UNCHANGEDSINCE 303011130956)
       +FLAGS.SILENT ($Processed)
   S: * 101 FETCH (MODSEQ (303181230852))
   S: b108 OK Conditional Store completed
        
   C: b108 STORE 101 (UNCHANGEDSINCE 303011130956)
       +FLAGS.SILENT ($Processed)
   S: * 101 FETCH (MODSEQ (303181230852))
   S: b108 OK Conditional Store completed
        

Or, the flag hasn't changed, but another has (nice server behavior. Server implementers should also see Section 3.1.12)...

或者,该标志没有改变,但另一个标志改变了(良好的服务器行为。服务器实现者还应参见第3.1.12节)。。。

   C: a106 STORE 100:150 (UNCHANGEDSINCE 212030000000)
       +FLAGS.SILENT ($Processed)
   S: * 100 FETCH (MODSEQ (303181230852))
   S: * 101 FETCH (MODSEQ (303011130956) FLAGS ($Processed \Deleted
       \Answered))
   S: * 102 FETCH (MODSEQ (303181230852))
   ...
   S: * 150 FETCH (MODSEQ (303181230852))
   S: a106 OK Conditional STORE completed
        
   C: a106 STORE 100:150 (UNCHANGEDSINCE 212030000000)
       +FLAGS.SILENT ($Processed)
   S: * 100 FETCH (MODSEQ (303181230852))
   S: * 101 FETCH (MODSEQ (303011130956) FLAGS ($Processed \Deleted
       \Answered))
   S: * 102 FETCH (MODSEQ (303181230852))
   ...
   S: * 150 FETCH (MODSEQ (303181230852))
   S: a106 OK Conditional STORE completed
        

The following example is based on the example from Section 4.2.3 of [RFC2180] and demonstrates that the MODIFIED response code MAY also be returned in the tagged NO response.

以下示例以[RFC2180]第4.2.3节中的示例为基础,并证明修改后的响应代码也可以在标记的无响应中返回。

The client tries to conditionally STORE flags on a mixture of expunged and non-expunged messages; one message fails the UNCHANGEDSINCE test.

客户端尝试在已删除和未删除的消息的混合上有条件地存储标志;一条消息未通过未更改的自测试。

   C: B001 STORE 1:7 (UNCHANGEDSINCE 320172338) +FLAGS (\SEEN)
   S: * 1 FETCH (MODSEQ (320172342) FLAGS (\SEEN))
   S: * 3 FETCH (MODSEQ (320172342) FLAGS (\SEEN))
   S: B001 NO [MODIFIED 2] Some of the messages no longer exist.
        
   C: B001 STORE 1:7 (UNCHANGEDSINCE 320172338) +FLAGS (\SEEN)
   S: * 1 FETCH (MODSEQ (320172342) FLAGS (\SEEN))
   S: * 3 FETCH (MODSEQ (320172342) FLAGS (\SEEN))
   S: B001 NO [MODIFIED 2] Some of the messages no longer exist.
        
   C: B002 NOOP
   S: * 4 EXPUNGE
   S: * 4 EXPUNGE
   S: * 4 EXPUNGE
   S: * 4 EXPUNGE
   S: * 2 FETCH (MODSEQ (320172340) FLAGS (\Deleted \Answered))
   S: B002 OK NOOP Completed.
        
   C: B002 NOOP
   S: * 4 EXPUNGE
   S: * 4 EXPUNGE
   S: * 4 EXPUNGE
   S: * 4 EXPUNGE
   S: * 2 FETCH (MODSEQ (320172340) FLAGS (\Deleted \Answered))
   S: B002 OK NOOP Completed.
        

By receiving FETCH responses for messages 1 and 3, and EXPUNGE responses that indicate that messages 4 through 7 have been expunged, the client retries the operation only for message 2. The updated UNCHANGEDSINCE value is used.

通过接收消息1和3的FETCH响应,以及指示消息4到7已被删除的EXPUNGE响应,客户端仅对消息2重试该操作。使用更新后的未更改的初始值。

   C: b003 STORE 2 (UNCHANGEDSINCE 320172340) +FLAGS (\Seen)
   S: * 2 FETCH (MODSEQ (320180050) FLAGS (\SEEN \Flagged))
   S: b003 OK Conditional Store completed
        
   C: b003 STORE 2 (UNCHANGEDSINCE 320172340) +FLAGS (\Seen)
   S: * 2 FETCH (MODSEQ (320180050) FLAGS (\SEEN \Flagged))
   S: b003 OK Conditional Store completed
        

Example 11

例11

Note: If a message is specified multiple times in the message set, and the server doesn't internally eliminate duplicates from the message set, it MUST NOT fail the conditional STORE operation for the second (or subsequent) occurrence of the message if the operation completed successfully for the first occurrence. For example, if the client specifies:

注意:如果在消息集中多次指定消息,并且服务器没有在内部消除消息集中的重复项,则如果第一次操作成功完成,则对于第二次(或后续)出现的消息,服务器不得使条件存储操作失败。例如,如果客户端指定:

e105 STORE 7,3:9 (UNCHANGEDSINCE 12121230045) +FLAGS.SILENT (\Deleted)

e105存储7,3:9(自12121230045起未更改)+FLAGS.SILENT(\已删除)

the server must not fail the operation for message 7 as part of processing "3:9" if it succeeded when message 7 was processed the first time.

如果在第一次处理消息7时成功,则作为处理“3:9”的一部分,服务器不得使消息7的操作失败。

As specified in Section 3.1, once the client specifies the UNCHANGEDSINCE modifier in a STORE command, the server starts including the MODSEQ FETCH response data items in all subsequent unsolicited FETCH responses.

如第3.1节所述,一旦客户机在STORE命令中指定了UNCHANGEDSINCE修饰符,服务器将开始在所有后续未经请求的FETCH响应中包含MODSEQ FETCH响应数据项。

This document also changes the behavior of the server when it has performed a STORE or UID STORE command and the UNCHANGEDSINCE modifier is not specified. If the operation is successful for a message, the server MUST update the mod-sequence attribute of the message. The server is REQUIRED to include the mod-sequence value whenever it decides to send the unsolicited FETCH response to all CONDSTORE-aware clients that have opened the mailbox containing the message.

当服务器执行STORE或UID STORE命令且未指定UNCHANGEDSINCE修饰符时,此文档还会更改服务器的行为。如果消息的操作成功,服务器必须更新消息的mod sequence属性。每当服务器决定将未经请求的获取响应发送给所有打开包含消息的邮箱的感知CONDSTORE的客户端时,服务器都需要包含mod sequence值。

Server implementers should also see Section 3.1.11 for additional quality of implementation issues related to the STORE command.

服务器实现者还应参阅第3.1.11节,了解与STORE命令相关的其他实现质量问题。

3.1.4. FETCH and UID FETCH Commands
3.1.4. FETCH和UID FETCH命令
3.1.4.1. CHANGEDSINCE FETCH Modifier
3.1.4.1. 更改自获取修改器

This document defines the following FETCH modifier (see Section 2.4 of [RFC4466]):

本文件定义了以下提取修饰符(见[RFC4466]第2.4节):

CHANGEDSINCE <mod-sequence>: The CHANGEDSINCE FETCH modifier allows the client to further subset the list of messages described by the sequence set. The information described by message data items is only returned for messages that have a mod-sequence bigger than <mod-sequence>.

CHANGEDSINCE<mod sequence>:CHANGEDSINCE FETCH修饰符允许客户端进一步子集序列集描述的消息列表。只有mod sequence大于<mod sequence>的消息才会返回消息数据项描述的信息。

When the CHANGEDSINCE FETCH modifier is specified, it implicitly adds the MODSEQ FETCH message data item (Section 3.1.4.2).

当指定CHANGEDSINCE FETCH修饰符时,它隐式添加MODSEQ FETCH消息数据项(第3.1.4.2节)。

   C: s100 UID FETCH 1:* (FLAGS) (CHANGEDSINCE 12345)
   S: * 1 FETCH (UID 4 MODSEQ (65402) FLAGS (\Seen))
   S: * 2 FETCH (UID 6 MODSEQ (75403) FLAGS (\Deleted))
   S: * 4 FETCH (UID 8 MODSEQ (29738) FLAGS ($NoJunk $AutoJunk
       $MDNSent))
   S: s100 OK FETCH completed
        
   C: s100 UID FETCH 1:* (FLAGS) (CHANGEDSINCE 12345)
   S: * 1 FETCH (UID 4 MODSEQ (65402) FLAGS (\Seen))
   S: * 2 FETCH (UID 6 MODSEQ (75403) FLAGS (\Deleted))
   S: * 4 FETCH (UID 8 MODSEQ (29738) FLAGS ($NoJunk $AutoJunk
       $MDNSent))
   S: s100 OK FETCH completed
        

Example 12

例12

3.1.4.2. MODSEQ Message Data Item in FETCH Command
3.1.4.2. FETCH命令中的MODSEQ消息数据项

CONDSTORE adds a MODSEQ message data item to the FETCH command. The MODSEQ message data item allows clients to retrieve mod-sequence values for a range of messages in the currently selected mailbox.

CONDSTORE将MODSEQ消息数据项添加到FETCH命令中。MODSEQ消息数据项允许客户端检索当前选定邮箱中一系列消息的mod sequence值。

As specified in Section 3.1, once the client has specified the MODSEQ message data item in a FETCH request, the server starts including the MODSEQ FETCH response data items in all subsequent unsolicited FETCH responses.

如第3.1节所述,一旦客户机在提取请求中指定了MODSEQ消息数据项,服务器将开始在所有后续未经请求的提取响应中包括MODSEQ提取响应数据项。

Syntax: MODSEQ

语法:MODSEQ

The MODSEQ message data item causes the server to return MODSEQ FETCH response data items.

MODSEQ消息数据项导致服务器返回MODSEQ FETCH响应数据项。

   Syntax:  MODSEQ ( <permsg-modsequence> )
        
   Syntax:  MODSEQ ( <permsg-modsequence> )
        

MODSEQ response data items contain per-message mod-sequences.

MODSEQ响应数据项包含每条消息的mod序列。

The MODSEQ response data item is returned if the client issued FETCH with the MODSEQ message data item. It also allows the server to notify the client about mod-sequence changes caused by conditional STOREs (Section 3.1.3) and/or changes caused by external sources.

如果客户端发出带有MODSEQ消息数据项的FETCH,则返回MODSEQ响应数据项。它还允许服务器通知客户端由条件存储(第3.1.3节)引起的mod序列更改和/或由外部源引起的更改。

   C: a FETCH 1:3 (MODSEQ)
   S: * 1 FETCH (MODSEQ (624140003))
   S: * 2 FETCH (MODSEQ (624140007))
   S: * 3 FETCH (MODSEQ (624140005))
   S: a OK Fetch complete
        
   C: a FETCH 1:3 (MODSEQ)
   S: * 1 FETCH (MODSEQ (624140003))
   S: * 2 FETCH (MODSEQ (624140007))
   S: * 3 FETCH (MODSEQ (624140005))
   S: a OK Fetch complete
        

In this example, the client requests per-message mod-sequences for a set of messages.

在本例中,客户机请求一组消息的每条消息mod序列。

Example 13

例13

Servers that only support the CONDSTORE extension (and not QRESYNC) SHOULD comply with requirements from Section 3.2.4.

仅支持CONDSTORE扩展(而非QRESYNC)的服务器应符合第3.2.4节的要求。

When a flag for a message is modified in a different session, the server sends an unsolicited FETCH response containing the mod-sequence for the message, as demonstrated in Example 14. Note that when the server also supports the QRESYNC extension (Section 3.2.3) and a CONDSTORE enabling command has been issued, all FETCH responses in Example 14 must also include UID FETCH items as prescribed by Section 3.2.4.

当在不同会话中修改消息的标志时,服务器发送一个包含消息mod序列的非请求获取响应,如示例14所示。请注意,当服务器还支持QRESYNC扩展(第3.2.3节)并且发出了CONDSTORE启用命令时,示例14中的所有获取响应还必须包括第3.2.4节规定的UID获取项。

(Session 1, authenticated as the user "alex".) The user adds a shared flag \Deleted:

(会话1,身份验证为用户“alex”。)用户添加共享标志\已删除:

       C: A142 SELECT INBOX
       ...
       S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
       S: * OK [PERMANENTFLAGS (\Answered \Deleted \Seen \*)] Limited
       ...
       C: A160 STORE 7 +FLAGS.SILENT (\Deleted)
       S: * 7 FETCH (MODSEQ (2121231000))
       S: A160 OK Store completed
        
       C: A142 SELECT INBOX
       ...
       S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
       S: * OK [PERMANENTFLAGS (\Answered \Deleted \Seen \*)] Limited
       ...
       C: A160 STORE 7 +FLAGS.SILENT (\Deleted)
       S: * 7 FETCH (MODSEQ (2121231000))
       S: A160 OK Store completed
        

(Session 2, also authenticated as the user "alex".) Any changes to flags are always reported to all sessions authenticated as the same user as in session 1.

(会话2,也作为用户“alex”进行了身份验证。)对标志的任何更改都将始终报告给作为会话1中相同用户进行身份验证的所有会话。

       C: C180 NOOP
       S: * 7 FETCH (FLAGS (\Deleted \Answered) MODSEQ (12121231000))
       S: C180 OK Noop completed
        
       C: C180 NOOP
       S: * 7 FETCH (FLAGS (\Deleted \Answered) MODSEQ (12121231000))
       S: C180 OK Noop completed
        

(Session 3, authenticated as the user "andrew".) As \Deleted is a shared flag, changes in session 1 are also reported in session 3:

(会话3,身份验证为用户“andrew”。)由于\Deleted是一个共享标志,会话1中的更改也会在会话3中报告:

       C: D210 NOOP
       S: * 7 FETCH (FLAGS (\Deleted \Answered) MODSEQ (12121231000))
       S: D210 OK Noop completed
        
       C: D210 NOOP
       S: * 7 FETCH (FLAGS (\Deleted \Answered) MODSEQ (12121231000))
       S: D210 OK Noop completed
        

The user modifies a private flag, \Seen, in session 1...

用户在会话1中修改私有标志,\n请参见。。。

       C: A240 STORE 7 +FLAGS.SILENT (\Seen)
       S: * 7 FETCH (MODSEQ (12121231777))
       S: A240 OK Store completed
        
       C: A240 STORE 7 +FLAGS.SILENT (\Seen)
       S: * 7 FETCH (MODSEQ (12121231777))
       S: A240 OK Store completed
        

...which is only reported in session 2...

…仅在第2课时报告。。。

       C: C270 NOOP
       S: * 7 FETCH (FLAGS (\Deleted \Answered \Seen) MODSEQ
           (12121231777))
       S: C270 OK Noop completed
        
       C: C270 NOOP
       S: * 7 FETCH (FLAGS (\Deleted \Answered \Seen) MODSEQ
           (12121231777))
       S: C270 OK Noop completed
        

...but not in session 3.

…但不是在第3课时。

       C: D300 NOOP
       S: D300 OK Noop completed
        
       C: D300 NOOP
       S: D300 OK Noop completed
        

And, finally, the user removes flags \Answered (shared) and \Seen (private) in session 1.

最后,用户删除会话1中的\respond(共享)和\Seen(私有)标志。

       C: A330 STORE 7 -FLAGS.SILENT (\Answered \Seen)
       S: * 7 FETCH (MODSEQ (12121245160))
       S: A330 OK Store completed
        
       C: A330 STORE 7 -FLAGS.SILENT (\Answered \Seen)
       S: * 7 FETCH (MODSEQ (12121245160))
       S: A330 OK Store completed
        

Both changes are reported in session 2...

这两个变化都将在第2课时中报告。。。

       C: C360 NOOP
       S: * 7 FETCH (FLAGS (\Deleted) MODSEQ (12121245160))
       S: C360 OK Noop completed
        
       C: C360 NOOP
       S: * 7 FETCH (FLAGS (\Deleted) MODSEQ (12121245160))
       S: C360 OK Noop completed
        

...and only changes to shared flags are reported in session 3.

…并且在会话3中仅报告对共享标志的更改。

       C: D390 NOOP
       S: * 7 FETCH (FLAGS (\Deleted) MODSEQ (12121245160))
       S: D390 OK Noop completed
        
       C: D390 NOOP
       S: * 7 FETCH (FLAGS (\Deleted) MODSEQ (12121245160))
       S: D390 OK Noop completed
        

Example 14

例14

Server implementers should also see Section 3.1.11 for additional quality of implementation issues related to the FETCH command.

服务器实现者还应参阅第3.1.11节,了解与FETCH命令相关的其他实现质量问题。

3.1.5. MODSEQ Search Criterion in SEARCH
3.1.5. 搜索中的MODSEQ搜索条件

The MODSEQ criterion for the SEARCH (or UID SEARCH) command allows a client to search for the metadata items that were modified since a specified moment.

SEARCH(或UID SEARCH)命令的MODSEQ条件允许客户端搜索自指定时刻以来修改的元数据项。

   Syntax: MODSEQ [<entry-name> <entry-type-req>] <mod-sequence-valzer>
        
   Syntax: MODSEQ [<entry-name> <entry-type-req>] <mod-sequence-valzer>
        

Messages that have modification values that are equal to or greater than <mod-sequence-valzer>. This allows a client, for example, to find out which messages contain metadata items that have changed since the last time it updated its disconnected cache. The client may also specify <entry-name> (name of the metadata item) and <entry-type-req> (type of metadata item) before <mod-sequence-valzer>. <entry-type-req> can be one of "shared", "priv" (private), or "all". The last means that the server MUST use the biggest value among "priv" and "shared" mod-sequences for the metadata item. If the server doesn't store separate mod-sequences for different metadata items, it MUST ignore <entry-name> and <entry-type-req>. Otherwise, the server should use them to narrow down the search.

修改值等于或大于<mod sequence valzer>的消息。例如,这允许客户端找出哪些消息包含自上次更新其断开连接的缓存以来已更改的元数据项。客户端还可以在<mod sequence valzer>之前指定<entry name>(元数据项的名称)和<entry type req>(元数据项的类型)<条目类型req>可以是“共享”、“私有”(私有)或“全部”中的一种。最后一种方法是,服务器必须为元数据项使用“priv”和“shared”mod序列中的最大值。如果服务器没有为不同的元数据项存储单独的mod序列,则必须忽略<entry name>和<entry type req>。否则,服务器应该使用它们来缩小搜索范围。

For a flag <flagname>, the corresponding <entry-name> has the form "/flags/<flagname>". Note that the leading "\" character that denotes a system flag has to be escaped as per Section 4.3 of [RFC3501], as <entry-name> uses the syntax for quoted strings (see the examples below).

对于标志<flagname>,对应的<entry name>的格式为“/flags/<flagname>”。请注意,表示系统标志的前导“\”字符必须根据[RFC3501]第4.3节进行转义,因为<entry name>使用带引号字符串的语法(参见下面的示例)。

If the client specifies a MODSEQ criterion in a SEARCH (or UID SEARCH) command and the server returns a non-empty SEARCH result, the server MUST also append (to the end of the untagged SEARCH response) the highest mod-sequence for all messages being returned. See also Section 3.1.6. Note that other IMAP extensions such as ESEARCH [RFC4731] can override this requirement (see Section 3.1.10 for more details.)

如果客户端在搜索(或UID搜索)命令中指定MODSEQ条件,并且服务器返回非空搜索结果,则服务器还必须为返回的所有消息追加(到未标记搜索响应的末尾)最高mod序列。另见第3.1.6节。请注意,其他IMAP扩展,如ESEARCH[RFC4731]可以覆盖此要求(有关更多详细信息,请参阅第3.1.10节)

   C: a SEARCH MODSEQ "/flags/\\draft" all 620162338
   S: * SEARCH 2 5 6 7 11 12 18 19 20 23 (MODSEQ 917162500)
   S: a OK Search complete
        
   C: a SEARCH MODSEQ "/flags/\\draft" all 620162338
   S: * SEARCH 2 5 6 7 11 12 18 19 20 23 (MODSEQ 917162500)
   S: a OK Search complete
        

In the above example, the message numbers of any messages having a mod-sequence equal to or greater than 620162338 for the "\Draft" flag are returned in the search results.

在上面的示例中,搜索结果中会返回mod sequence等于或大于620162338的“\Draft”标志消息的消息编号。

Example 15

例15

   C: t SEARCH OR NOT MODSEQ 720162338 LARGER 50000
   S: * SEARCH
   S: t OK Search complete, nothing found
        
   C: t SEARCH OR NOT MODSEQ 720162338 LARGER 50000
   S: * SEARCH
   S: t OK Search complete, nothing found
        

Example 16

例16

3.1.6. Modified SEARCH Untagged Response
3.1.6. 修改的搜索未标记响应

Data: zero or more numbers mod-sequence value (omitted if no match)

数据:零个或多个数字mod序列值(如果不匹配则省略)

This document extends the syntax of the untagged SEARCH response to include the highest mod-sequence for all messages being returned.

本文档扩展了未标记搜索响应的语法,以包含返回的所有消息的最高mod序列。

If a client specifies a MODSEQ criterion in a SEARCH (or UID SEARCH) command and the server returns a non-empty SEARCH result, the server MUST also append (to the end of the untagged SEARCH response) the highest mod-sequence for all messages being returned. See Section 3.1.5 for examples.

如果客户端在搜索(或UID搜索)命令中指定MODSEQ条件,并且服务器返回非空搜索结果,则服务器还必须为返回的所有消息追加(到未标记搜索响应的末尾)最高mod序列。示例见第3.1.5节。

3.1.7. HIGHESTMODSEQ Status Data Items
3.1.7. HIGHESTMODSEQ状态数据项

This document defines a new status data item:

本文档定义了一个新的状态数据项:

HIGHESTMODSEQ: The highest mod-sequence value of all messages in the mailbox. This is the same value that is returned by the server in the HIGHESTMODSEQ response code in an OK untagged response (see Section 3.1.2.1). If the server doesn't support the persistent storage of mod-sequences for the mailbox (see Section 3.1.2.2), the server MUST return 0 as the value of the HIGHESTMODSEQ status data item.

HIGHESTMODSEQ:邮箱中所有邮件的最高mod sequence值。这与服务器在OK Untaged响应中的HIGHESTMODSEQ响应代码中返回的值相同(参见第3.1.2.1节)。如果服务器不支持邮箱mod序列的持久存储(参见第3.1.2.2节),服务器必须返回0作为HIGHESTMODSEQ状态数据项的值。

   C: A042 STATUS blurdybloop (UIDNEXT MESSAGES HIGHESTMODSEQ)
   S: * STATUS blurdybloop (MESSAGES 231 UIDNEXT 44292
       HIGHESTMODSEQ 7011231777)
   S: A042 OK STATUS completed
        
   C: A042 STATUS blurdybloop (UIDNEXT MESSAGES HIGHESTMODSEQ)
   S: * STATUS blurdybloop (MESSAGES 231 UIDNEXT 44292
       HIGHESTMODSEQ 7011231777)
   S: A042 OK STATUS completed
        

Example 17

例17

3.1.8. CONDSTORE Parameter to SELECT and EXAMINE
3.1.8. 要选择和检查的CONDSTORE参数

The CONDSTORE extension defines a single optional select parameter, "CONDSTORE", which tells the server that it MUST include the MODSEQ FETCH response data items in all subsequent unsolicited FETCH responses.

CONDSTORE扩展定义了一个可选的选择参数“CONDSTORE”,它告诉服务器,它必须在所有后续未经请求的获取响应中包含MODSEQ获取响应数据项。

The CONDSTORE parameter to SELECT/EXAMINE helps avoid a race condition that might arise when one or more metadata items are modified in another session after the server has sent the HIGHESTMODSEQ response code and before the client was able to issue a CONDSTORE enabling command.

要选择/检查的CONDSTORE参数有助于避免在服务器发送HIGHESTMODSEQ响应代码之后、客户端能够发出CONDSTORE启用命令之前,在另一个会话中修改一个或多个元数据项时可能出现的争用情况。

   C: A142 SELECT INBOX (CONDSTORE)
   S: * 172 EXISTS
   S: * 1 RECENT
   S: * OK [UNSEEN 12] Message 12 is first unseen
   S: * OK [UIDVALIDITY 3857529045] UIDs valid
   S: * OK [UIDNEXT 4392] Predicted next UID
   S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
   S: * OK [PERMANENTFLAGS (\Deleted \Seen \*)] Limited
   S: * OK [HIGHESTMODSEQ 715194045007]
   S: A142 OK [READ-WRITE] SELECT completed, CONDSTORE is now enabled
        
   C: A142 SELECT INBOX (CONDSTORE)
   S: * 172 EXISTS
   S: * 1 RECENT
   S: * OK [UNSEEN 12] Message 12 is first unseen
   S: * OK [UIDVALIDITY 3857529045] UIDs valid
   S: * OK [UIDNEXT 4392] Predicted next UID
   S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
   S: * OK [PERMANENTFLAGS (\Deleted \Seen \*)] Limited
   S: * OK [HIGHESTMODSEQ 715194045007]
   S: A142 OK [READ-WRITE] SELECT completed, CONDSTORE is now enabled
        

Example 18

例18

3.1.9. Interaction with IMAP SORT and THREAD Extensions
3.1.9. 与IMAP排序和线程扩展的交互

The MODSEQ Search Criterion (see Section 3.1.5) causes modifications to SORT [RFC5256] responses similar to modifications to SEARCH responses defined in Section 3.1.6:

MODSEQ搜索标准(见第3.1.5节)导致对[RFC5256]响应进行排序的修改,类似于第3.1.6节中定义的对搜索响应的修改:

SORT Response Data: zero or more numbers mod-sequence value (omitted if no match)

排序响应数据:零个或多个数字mod序列值(如果不匹配则省略)

This document extends the syntax of the untagged SORT response to include the highest mod-sequence for all messages being returned.

本文档扩展了未标记排序响应的语法,以包含返回的所有消息的最高mod序列。

If a client specifies a MODSEQ criterion in a SORT (or UID SORT) command and the server returns a non-empty SORT result, the server MUST also append (to the end of the untagged SORT response) the highest mod-sequence for all messages being returned. Note that other IMAP extensions such as ESORT [RFC5267] can override this requirement (see Section 3.1.10 for more details.)

如果客户端在SORT(或UID SORT)命令中指定MODSEQ条件,并且服务器返回非空排序结果,则服务器还必须为所有返回的消息追加(到未标记排序响应的末尾)最高的mod序列。请注意,其他IMAP扩展,如ESORT[RFC5267]可以覆盖此要求(有关更多详细信息,请参阅第3.1.10节)

THREAD commands that include a MODSEQ Search Criterion return THREAD responses as specified in [RFC5256], i.e., THREAD responses are unchanged by the CONDSTORE extension.

包含MODSEQ搜索条件的线程命令返回[RFC5256]中指定的线程响应,即CONDSTORE扩展不改变线程响应。

3.1.10. Interaction with IMAP ESORT and ESEARCH Extensions
3.1.10. 与IMAP ESORT和ESEARCH扩展的交互

If a client specifies a MODSEQ criterion in an extended SEARCH (or extended UID SEARCH) [RFC4731] command and the server returns a non-empty SEARCH result, the server MUST return the ESEARCH response containing the MODSEQ result option as defined in Section 3.2 of [RFC4731].

如果客户端在扩展搜索(或扩展UID搜索)[RFC4731]命令中指定MODSEQ条件,并且服务器返回非空搜索结果,则服务器必须返回包含[RFC4731]第3.2节中定义的MODSEQ结果选项的ESEARCH响应。

   C: a SEARCH RETURN (ALL) MODSEQ 1234
   S: * ESEARCH (TAG "a") ALL 1:3,5 MODSEQ 1236
   S: a OK Extended SEARCH completed
        
   C: a SEARCH RETURN (ALL) MODSEQ 1234
   S: * ESEARCH (TAG "a") ALL 1:3,5 MODSEQ 1236
   S: a OK Extended SEARCH completed
        

Example 19

例19

If a client specifies a MODSEQ criterion in an extended SORT (or extended UID SORT) [RFC5267] command and the server returns a non-empty SORT result, the server MUST return the ESEARCH response containing the MODSEQ result option defined in Section 3.2 of [RFC4731].

如果客户端在扩展排序(或扩展UID排序)[RFC5267]命令中指定MODSEQ条件,并且服务器返回非空排序结果,则服务器必须返回包含[RFC4731]第3.2节中定义的MODSEQ结果选项的ESEARCH响应。

   C: a SORT RETURN (ALL) (DATE) UTF-8 MODSEQ 1234
   S: * ESEARCH (TAG "a") ALL 5,3,2,1 MODSEQ 1236
   S: a OK Extended SORT completed
        
   C: a SORT RETURN (ALL) (DATE) UTF-8 MODSEQ 1234
   S: * ESEARCH (TAG "a") ALL 5,3,2,1 MODSEQ 1236
   S: a OK Extended SORT completed
        

Example 20

例20

3.1.11. Additional Quality-of-Implementation Issues
3.1.11. 实施质量的其他问题

Server implementations should follow the following rule, which applies to any successfully completed STORE/UID STORE (with and without an UNCHANGEDSINCE modifier), as well as to a FETCH command that implicitly sets the \Seen flag:

服务器实现应遵循以下规则,该规则适用于任何成功完成的存储/UID存储(带或不带UNCHANGEDSINCE修饰符),以及隐式设置\Seen标志的FETCH命令:

Adding the flag when it is already present or removing it when it is not present SHOULD NOT change the mod-sequence.

当标志已经存在或不存在时添加或删除标志不应改变mod序列。

This will prevent spurious client synchronization requests.

这将防止虚假的客户端同步请求。

However, note that client implementers MUST NOT rely on this server behavior. A client can't distinguish between the case when a server has violated the SHOULD mentioned above and when one or more clients set and unset (or unset and set) the flag in another session.

但是,请注意,客户机实现者不能依赖此服务器行为。客户机无法区分服务器违反上述应该的情况和一个或多个客户机在另一个会话中设置并取消设置(或取消设置并设置)标志的情况。

3.1.12. CONDSTORE Server Implementation Considerations
3.1.12. CONDSTORE服务器实现注意事项

This section describes how a server implementation that doesn't store separate per-metadata mod-sequences for different metadata items can avoid sending the MODIFIED response to any of the following conditional STORE operations:

本节介绍不为不同元数据项存储单独的每元数据mod序列的服务器实现如何避免将修改后的响应发送到以下任何条件存储操作:

+FLAGS

+旗帜

-FLAGS

-旗帜

+FLAGS.SILENT

+沉默

-FLAGS.SILENT

-沉默

Note that the optimization described in this section can't be performed in case of a conditional STORE FLAGS (without "+" or "-") operation.

请注意,在条件存储标志(没有“+”或“-”)操作的情况下,无法执行本节中描述的优化。

Let's use the following example. The client has issued:

让我们使用下面的例子。客户已发布:

C: a106 STORE 100:150 (UNCHANGEDSINCE 212030000000) +FLAGS.SILENT ($Processed)

C:a106存储100:150(自212030000000起保持不变)+FLAGS.SILENT($Processed)

When the server receives the command and parses it successfully, it iterates through the message set and tries to execute the conditional STORE command for each message.

当服务器接收到命令并成功解析它时,它将迭代消息集,并尝试为每条消息执行条件存储命令。

Each server internally works as a client, i.e., it has to cache the current state of all IMAP flags as it is known to the client. In order to report flag changes to the client, the server compares the cached values with the values in its database for IMAP flags.

每个服务器在内部都作为客户端工作,即,它必须缓存客户端已知的所有IMAP标志的当前状态。为了向客户机报告标志更改,服务器将缓存的值与其数据库中的值进行比较,以查找IMAP标志。

Imagine that another client has changed the state of a flag \Deleted on the message 101 and that the change updated the mod-sequence for the message. The server knows that the mod-sequence for the mailbox has changed; however, it also knows that:

假设另一个客户端更改了消息101上的标记\已删除的状态,并且该更改更新了消息的mod序列。服务器知道邮箱的mod序列已更改;然而,它也知道:

a. the client is not interested in the \Deleted flag, as it hasn't included it in the +FLAGS.SILENT operation and

a. 客户端对\Deleted标志不感兴趣,因为它没有将其包括在+FLAGS.SILENT操作中,并且

b. the state of the flag $Processed hasn't changed (the server can determine this by comparing the cached flag state with the state of the flag in the database).

b. 标记$Processed的状态没有更改(服务器可以通过将缓存的标记状态与数据库中的标记状态进行比较来确定)。

Therefore, the server doesn't have to report MODIFIED to the client. Instead, the server may set the $Processed flag, update the mod-sequence for the message 101 once again, and send an untagged FETCH response with a new mod-sequence and flags:

因此,服务器不必向客户端报告修改。相反,服务器可以设置$Processed标志,再次更新消息101的mod序列,并使用新的mod序列和标志发送未标记的FETCH响应:

S: * 101 FETCH (MODSEQ (303011130956) FLAGS ($Processed \Deleted \Answered))

S:*101获取(MODSEQ(303011130956)标志($Processed\Deleted\responsed))

See also Section 3.1.11 for additional quality-of-implementation issues.

有关实施质量的其他问题,请参见第3.1.11节。

3.2. QRESYNC Extension
3.2. QRESYNC扩展

All protocol changes and requirements specified for the CONDSTORE extension are also a part of the QRESYNC extension.

为CONDSTORE扩展指定的所有协议更改和要求也是QRESYNC扩展的一部分。

The QRESYNC extension puts additional requirements on a server implementing the CONDSTORE extension. Each mailbox that supports persistent storage of mod-sequences, i.e., for which the server would send a HIGHESTMODSEQ untagged OK response code on a successful SELECT/EXAMINE, MUST increment the per-mailbox mod-sequence when one or more messages are expunged due to EXPUNGE, UID EXPUNGE, CLOSE, or MOVE [RFC6851]; the server MUST associate the incremented mod-sequence with the UIDs of the expunged messages. Additionally, if the server also supports the IMAP METADATA extension [RFC5464], it MUST increment the per-mailbox mod-sequence when SETMETADATA successfully changes an annotation on the corresponding mailbox.

QRESYNC扩展对实现CONDSTORE扩展的服务器提出了额外的要求。每个支持mod序列持久存储的邮箱,即服务器将在成功选择/检查时为其发送最高ModSeq Untaged OK响应代码的邮箱,在由于EXPUNGE、UID EXPUNGE、CLOSE或MOVE[RFC6851]而删除一个或多个邮件时,必须增加每个邮箱的mod序列;服务器必须将递增的mod序列与已删除消息的UID相关联。此外,如果服务器还支持IMAP元数据扩展[RFC5464],则当SETMETADATA成功更改相应邮箱上的批注时,它必须增加每个邮箱的mod序列。

A server implementing QRESYNC MUST send untagged events to a client in a way that the client doesn't lose any changes in case of connectivity loss. In particular, this means that if the server

实现QRESYNC的服务器必须向客户端发送未标记的事件,以便客户端在连接丢失时不会丢失任何更改。特别是,这意味着如果服务器

sends MODSEQ FETCH data items while EXPUNGE (or VANISHED) replies with lower mod-sequences being delayed, the server MUST send the HIGHESTMODSEQ response code with a lower value than the EXPUNGE's mod-sequence. See the example in Section 6.

发送MODSEQ FETCH数据项。当删除(或消失)响应延迟时,服务器必须发送最高MODSEQ响应代码,其值低于删除的mod序列。参见第6节中的示例。

3.2.1. Impact on CONDSTORE-only Clients
3.2.1. 仅对CONDSTORE客户端的影响

A client that supports CONDSTORE but not QRESYNC might resynchronize a mailbox and discover that its HIGHESTMODSEQ has increased from the value cached by the client. If the increase is only due to messages having been expunged since the client last synchronized, the client is likely to send a FETCH ... CHANGEDSINCE command that returns no data. Thus, a client that supports CONDSTORE but not QRESYNC might incur a penalty of an unneeded round trip when resynchronizing some mailboxes (those that have had messages expunged but no flag changes since the last synchronization).

支持CONDSTORE但不支持QRESYNC的客户端可能会重新同步邮箱,并发现其最高位modseq已从客户端缓存的值增加。如果增加的原因仅仅是自客户端上次同步后已删除消息,则客户端可能会发送一个FETCH。。。不返回任何数据的CHANGEDSINCE命令。因此,支持CONDSTORE但不支持QRESYNC的客户端在重新同步某些邮箱(自上次同步以来已删除邮件但未更改标志的邮箱)时可能会受到不必要的往返惩罚。

This extra round trip is only incurred by clients that support CONDSTORE but not QRESYNC and only when a mailbox has had messages expunged but no flag changes to non-expunged messages. Since CONDSTORE is a relatively new extension, it is strongly encouraged that clients that support it also support QRESYNC.

只有支持CONDSTORE但不支持QRESYNC的客户端以及邮箱已删除邮件但未对未删除邮件更改标志时,才会发生此额外往返。由于CONDSTORE是一个相对较新的扩展,因此强烈建议支持它的客户机也支持QRESYNC。

3.2.2. Advertising Support for QRESYNC
3.2.2. 对QRESYNC的广告支持

The quick resync IMAP extension is present if an IMAP4 server returns "QRESYNC" as one of the supported capabilities to the CAPABILITY command.

如果IMAP4服务器将“QRESYNC”作为支持的功能之一返回给CAPABILITY命令,则存在快速重新同步IMAP扩展。

For compatibility with clients that only support the CONDSTORE IMAP extension, servers SHOULD also advertise "CONDSTORE" in the CAPABILITY response.

为了与仅支持CONDSTORE IMAP扩展的客户端兼容,服务器还应在功能响应中公布“CONDSTORE”。

3.2.3. Use of ENABLE
3.2.3. 启用的使用

Servers supporting QRESYNC MUST implement and advertise support for the ENABLE [RFC5161] IMAP extension. Also, the presence of the "QRESYNC" capability implies support for the CONDSTORE IMAP extension even if the "CONDSTORE" capability isn't advertised. A server compliant with this specification is REQUIRED to support "ENABLE QRESYNC" and "ENABLE QRESYNC CONDSTORE" (which are "CONDSTORE enabling commands", see Section 3.1, and have identical results). Note that the order of parameters is not significant, but there is no requirement for a compliant server to support "ENABLE CONDSTORE" by itself. The "ENABLE QRESYNC"/"ENABLE QRESYNC CONDSTORE" command also tells the server that it MUST start sending VANISHED responses (see

支持QRESYNC的服务器必须实现并公布对ENABLE[RFC5161]IMAP扩展的支持。此外,“QRESYNC”功能的存在意味着支持CONDSTORE IMAP扩展,即使“CONDSTORE”功能没有公布。符合本规范的服务器需要支持“启用QRESYNC”和“启用QRESYNC CONDSTORE”(即“CONDSTORE启用命令”,请参见第3.1节,并具有相同的结果)。请注意,参数的顺序并不重要,但不要求兼容服务器本身支持“ENABLE CONDSTORE”。“ENABLE QRESYNC”/“ENABLE QRESYNC CONDSTORE”命令还告诉服务器必须开始发送消失的响应(请参阅

Section 3.2.10) instead of EXPUNGE responses for all mailboxes for which the server doesn't return the NOMODSEQ response code. This change remains in effect until the connection is closed.

第3.2.10节),而不是删除服务器未返回NOMODSEQ响应代码的所有邮箱的响应。此更改将保持有效,直到连接关闭。

A client making use of QRESYNC MUST issue "ENABLE QRESYNC" once it is authenticated. A server MUST respond with a tagged BAD response if the QRESYNC parameter to the SELECT/EXAMINE command or the VANISHED UID FETCH modifier is specified and the client hasn't issued "ENABLE QRESYNC", or the server has not positively responded (in the current connection) to that command with the untagged ENABLED response containing QRESYNC.

使用QRESYNC的客户端在经过身份验证后必须发出“ENABLE QRESYNC”。如果指定了SELECT/inspect命令的QRESYNC参数或已消失的UID FETCH修饰符,并且客户端没有发出“ENABLE QRESYNC”,或者服务器没有(在当前连接中)使用包含QRESYNC的未标记已启用响应对该命令做出肯定响应,则服务器必须使用已标记的错误响应进行响应。

3.2.4. Additional Requirements on QRESYNC Servers
3.2.4. 对QRESYNC服务器的附加要求

Once a CONDSTORE enabling command is issued by the client, the server MUST automatically include both UID and mod-sequence data in all subsequent untagged FETCH responses (until the connection is closed), whether they were caused by a regular STORE/UID STORE, a STORE/UID STORE with an UNCHANGEDSINCE modifier, a FETCH/UID FETCH that implicitly set the \Seen flag, or an external agent. Note that this rule doesn't affect untagged FETCH responses caused by a FETCH command that doesn't include UID and/or a MODSEQ FETCH data item (and doesn't implicitly set the \Seen flag) or UID FETCH without the MODSEQ FETCH data item.

客户端发出CONDSTORE启用命令后,服务器必须在所有后续未标记的获取响应中自动包含UID和mod序列数据(直到连接关闭),无论它们是由常规存储/UID存储、带有未更改的INCE修饰符的存储/UID存储引起的,隐式设置\Seen标志的FETCH/UID FETCH或外部代理。请注意,此规则不影响FETCH命令(不包括UID和/或MODSEQ FETCH数据项(且不隐式设置\Seen标志)或不包含MODSEQ FETCH数据项的UID FETCH)所导致的未标记的FETCH响应。

3.2.5. QRESYNC Parameter to SELECT/EXAMINE
3.2.5. 要选择/检查的QRESYNC参数

The Quick Resynchronization parameter to SELECT/EXAMINE commands has four arguments:

用于选择/检查命令的快速重新同步参数有四个参数:

o the last known UIDVALIDITY,

o 最后已知的UID有效性,

o the last known modification sequence,

o 最后一个已知的修改序列,

o the optional set of known UIDs, and

o 已知UID的可选集,以及

o an optional parenthesized list of known sequence ranges and their corresponding UIDs.

o 已知序列范围及其对应UID的可选括号列表。

A server MUST respond with a tagged BAD response if the Quick Resynchronization parameter to the SELECT/EXAMINE command is specified and the client hasn't issued "ENABLE QRESYNC" in the current connection, or the server has not positively responded to that command with the untagged ENABLED response containing QRESYNC.

如果指定了SELECT/EXAMINE命令的快速重新同步参数,并且客户端在当前连接中未发出“ENABLE QRESYNC”,或者服务器未使用包含QRESYNC的未标记的已启用响应对该命令做出肯定响应,则服务器必须以标记的错误响应进行响应。

Before opening the specified mailbox, the server verifies all arguments for syntactic validity. If any parameter is not syntactically valid, the server returns the tagged BAD response, and

在打开指定的邮箱之前,服务器将验证所有参数的语法有效性。如果任何参数在语法上无效,服务器将返回标记的错误响应,并且

the mailbox remains unselected. Once the check is done, the server opens the mailbox as if no SELECT/EXAMINE parameters are specified (this is subject to the processing of other parameters as defined in other extensions). In particular, this means that the server MUST send all untagged responses as specified in Sections 6.3.1 and 6.3.2 of [RFC3501].

邮箱保持未选中状态。检查完成后,服务器将打开邮箱,就像未指定选择/检查参数一样(这取决于对其他扩展中定义的其他参数的处理)。特别是,这意味着服务器必须按照[RFC3501]第6.3.1节和第6.3.2节的规定发送所有未标记的响应。

After that, the server checks the UIDVALIDITY value provided by the client. If the provided UIDVALIDITY doesn't match the UIDVALIDITY for the mailbox being opened, then the server MUST ignore the remaining parameters and behave as if no dynamic message data changed. The client can discover this situation by comparing the UIDVALIDITY value returned by the server. This behavior allows the client not to synchronize the mailbox or decide on the best synchronization strategy.

然后,服务器检查客户端提供的UIDVality值。如果提供的UIDVality与正在打开的邮箱的UIDVality不匹配,则服务器必须忽略其余参数,并表现为没有更改动态消息数据。客户端可以通过比较服务器返回的UIDVality值来发现这种情况。此行为允许客户端不同步邮箱或决定最佳同步策略。

Example: Attempting to resynchronize INBOX, but the provided UIDVALIDITY parameter doesn't match the current UIDVALIDITY value.

示例:正在尝试重新同步收件箱,但提供的UIDVALIDITY参数与当前UIDVALIDITY值不匹配。

            C: A02 SELECT INBOX (QRESYNC (67890007 20050715194045000
                41,43:211,214:541))
            S: * 464 EXISTS
            S: * 3 RECENT
            S: * OK [UIDVALIDITY 3857529045] UIDVALIDITY
            S: * OK [UIDNEXT 550] Predicted next UID
            S: * OK [HIGHESTMODSEQ 90060128194045007] Highest mailbox
            mod-sequence
            S: * OK [UNSEEN 12] Message 12 is first unseen
            S: * FLAGS (\Answered \Flagged \Draft \Deleted \Seen)
            S: * OK [PERMANENTFLAGS (\Answered \Flagged \Draft
            \Deleted \Seen \*)] Permanent flags
            S: A02 OK [READ-WRITE] Sorry, UIDVALIDITY mismatch
        
            C: A02 SELECT INBOX (QRESYNC (67890007 20050715194045000
                41,43:211,214:541))
            S: * 464 EXISTS
            S: * 3 RECENT
            S: * OK [UIDVALIDITY 3857529045] UIDVALIDITY
            S: * OK [UIDNEXT 550] Predicted next UID
            S: * OK [HIGHESTMODSEQ 90060128194045007] Highest mailbox
            mod-sequence
            S: * OK [UNSEEN 12] Message 12 is first unseen
            S: * FLAGS (\Answered \Flagged \Draft \Deleted \Seen)
            S: * OK [PERMANENTFLAGS (\Answered \Flagged \Draft
            \Deleted \Seen \*)] Permanent flags
            S: A02 OK [READ-WRITE] Sorry, UIDVALIDITY mismatch
        

Remaining parameters are described in the following subsections.

其余参数将在以下小节中介绍。

3.2.5.1. Modification Sequence and UID Parameters
3.2.5.1. 修改顺序和UID参数

A server that doesn't support the persistent storage of mod-sequences for the mailbox MUST send an OK untagged response including the NOMODSEQ response code with every successful SELECT or EXAMINE command (see Section 3.1.2.2). Such a server doesn't need to remember mod-sequences for expunged messages in the mailbox. It MUST ignore the remaining parameters and behave as if no dynamic message data changed.

不支持邮箱mod序列持久存储的服务器必须在每个成功的SELECT或EXAMINE命令中发送一个OK untagged响应,包括NOMODSEQ响应代码(见第3.1.2.2节)。这样的服务器不需要记住邮箱中已删除邮件的mod序列。它必须忽略其余参数,并表现为没有动态消息数据更改。

If the provided UIDVALIDITY matches that of the selected mailbox, the server then checks the last known modification sequence.

如果提供的UIDVality与所选邮箱的UIDVality匹配,则服务器将检查最后一次已知的修改序列。

The server sends the client any pending flag changes (using FETCH responses that MUST contain UIDs) and expunges those that have occurred in this mailbox since the provided modification sequence.

服务器向客户端发送任何挂起的标志更改(使用必须包含UID的获取响应),并删除自提供的修改序列以来在此邮箱中发生的更改。

If the list of known UIDs was also provided, the server should only report flag changes and expunges for the specified messages. If the client did not provide the list of UIDs, the server acts as if the client has specified "1:<maxuid>", where <maxuid> is the mailbox's UIDNEXT value minus 1. If the mailbox is empty and never had any messages in it, then lack of the list of UIDs is interpreted as an empty set of UIDs.

如果还提供了已知UID的列表,则服务器应仅报告指定消息的标志更改和删除。如果客户端未提供UID列表,则服务器的行为就像客户端指定了“1:<maxuid>”,其中<maxuid>是邮箱的UIDNEXT值减去1。如果邮箱是空的,并且其中从未包含任何邮件,则缺少UID列表将被解释为一组空的UID。

Thus, the client can process just these pending events and need not perform a full resynchronization. Without the message sequence number matching information, the result of this step is semantically equivalent to the client issuing: tag1 UID FETCH "known-uids" (FLAGS) (CHANGEDSINCE "mod-sequence-value" VANISHED)

因此,客户端可以只处理这些挂起的事件,而不需要执行完全的重新同步。如果没有消息序列号匹配信息,此步骤的结果在语义上等同于客户端发出:tag1 UID FETCH“known UID”(标志)(CHANGEDSINCE“mod sequence value”消失)

In particular, this means that all requirements specified in Section 3.2.6 apply.

特别是,这意味着第3.2.6节中规定的所有要求均适用。

Example:

例子:

      C: A03 SELECT INBOX (QRESYNC (67890007
          90060115194045000 41:211,214:541))
      S: * OK [CLOSED]
      S: * 100 EXISTS
      S: * 11 RECENT
      S: * OK [UIDVALIDITY 67890007] UIDVALIDITY
      S: * OK [UIDNEXT 600] Predicted next UID
      S: * OK [HIGHESTMODSEQ 90060115205545359] Highest
          mailbox mod-sequence
      S: * OK [UNSEEN 7] There are some unseen
          messages in the mailbox
      S: * FLAGS (\Answered \Flagged \Draft \Deleted \Seen)
      S: * OK [PERMANENTFLAGS (\Answered \Flagged \Draft
          \Deleted \Seen \*)] Permanent flags
      S: * VANISHED (EARLIER) 41,43:116,118,120:211,214:540
      S: * 49 FETCH (UID 117 FLAGS (\Seen \Answered) MODSEQ
          (90060115194045001))
      S: * 50 FETCH (UID 119 FLAGS (\Draft $MDNSent) MODSEQ
          (90060115194045308))
      S: * 51 FETCH (UID 541 FLAGS (\Seen $Forwarded) MODSEQ
          (90060115194045001))
      S: A03 OK [READ-WRITE] mailbox selected
        
      C: A03 SELECT INBOX (QRESYNC (67890007
          90060115194045000 41:211,214:541))
      S: * OK [CLOSED]
      S: * 100 EXISTS
      S: * 11 RECENT
      S: * OK [UIDVALIDITY 67890007] UIDVALIDITY
      S: * OK [UIDNEXT 600] Predicted next UID
      S: * OK [HIGHESTMODSEQ 90060115205545359] Highest
          mailbox mod-sequence
      S: * OK [UNSEEN 7] There are some unseen
          messages in the mailbox
      S: * FLAGS (\Answered \Flagged \Draft \Deleted \Seen)
      S: * OK [PERMANENTFLAGS (\Answered \Flagged \Draft
          \Deleted \Seen \*)] Permanent flags
      S: * VANISHED (EARLIER) 41,43:116,118,120:211,214:540
      S: * 49 FETCH (UID 117 FLAGS (\Seen \Answered) MODSEQ
          (90060115194045001))
      S: * 50 FETCH (UID 119 FLAGS (\Draft $MDNSent) MODSEQ
          (90060115194045308))
      S: * 51 FETCH (UID 541 FLAGS (\Seen $Forwarded) MODSEQ
          (90060115194045001))
      S: A03 OK [READ-WRITE] mailbox selected
        

In the above example, flag information for UID 42 is not returned, presumably because its flags haven't changed since the MODSEQ 90060115194045000.

在上面的示例中,UID 42的标志信息没有返回,可能是因为它的标志自MODSEQ 90060115194045000以来没有更改。

3.2.5.2. Message Sequence Match Data
3.2.5.2. 消息序列匹配数据

A client MAY provide a parenthesized list of a message sequence set and the corresponding UID sets. Both MUST be provided in ascending order. The server uses this data to restrict the range for which it provides expunged message information.

客户端可以提供消息序列集和相应UID集的括号列表。两者都必须按升序提供。服务器使用此数据限制其提供已删除邮件信息的范围。

Conceptually, the client provides a small sample of sequence numbers for which it knows the corresponding UIDs. The server then compares each sequence number and UID pair the client provides with the current state of the mailbox. If a pair matches, then the client knows of any expunges up to, and including, the message; thus, it will not include that range in the VANISHED response, even if the "mod-sequence-value" provided by the client is too old for the server to have data of when those messages were expunged.

从概念上讲,客户机提供了一个序列号的小样本,它知道相应的UID。然后,服务器将客户端提供的每个序列号和UID对与邮箱的当前状态进行比较。如果一对匹配,则客户机知道任何删除,包括消息;因此,即使客户端提供的“mod sequence value”太旧,服务器无法获得删除这些消息时的数据,它也不会在消失的响应中包含该范围。

Thus, if the Nth message number in the first set in the list is 4, and the Nth UID in the second set in the list is 8, and the mailbox's fourth message has UID 8, then no UIDs equal to or less than 8 are present in the VANISHED response. If the (N+1)th message number is 12, and the (N+1)th UID is 24, and the (N+1)th message in the mailbox has UID 25, then the lowest UID included in the VANISHED response would be 9.

因此,如果列表中第一组中的第n个邮件编号为4,而列表中第二组中的第n个UID为8,并且邮箱的第四条邮件的UID为8,则响应中不存在等于或小于8的UID。如果第(N+1)条消息编号为12,(N+1)条UID为24,邮箱中第(N+1)条消息的UID为25,则消失响应中包含的最低UID为9。

In the following two examples, the server is unable to remember expunges at all, and only UIDs with messages divisible by three are present in the mailbox. In the first example, the client does not use the fourth parameter; in the second, it provides it. This example is somewhat extreme, but it shows that judicious usage of the sequence match data can save a substantial amount of bandwidth.

在以下两个示例中,服务器根本记不起删除,邮箱中只存在消息可被3整除的UID。在第一个示例中,客户端不使用第四个参数;第二,它提供了它。这个例子有点极端,但它表明,明智地使用序列匹配数据可以节省大量带宽。

Example:

例子:

      C: A04 SELECT INBOX (QRESYNC (67890007
          90060115194045000 1:29997))
      S: * 10003 EXISTS
      S: * 4 RECENT
      S: * OK [UIDVALIDITY 67890007] UIDVALIDITY
      S: * OK [UIDNEXT 30013] Predicted next UID
      S: * OK [HIGHESTMODSEQ 90060115205545359] Highest mailbox
          mod-sequence
      S: * OK [UNSEEN 7] There are some unseen messages in the mailbox
      S: * FLAGS (\Answered \Flagged \Draft \Deleted \Seen)
        
      C: A04 SELECT INBOX (QRESYNC (67890007
          90060115194045000 1:29997))
      S: * 10003 EXISTS
      S: * 4 RECENT
      S: * OK [UIDVALIDITY 67890007] UIDVALIDITY
      S: * OK [UIDNEXT 30013] Predicted next UID
      S: * OK [HIGHESTMODSEQ 90060115205545359] Highest mailbox
          mod-sequence
      S: * OK [UNSEEN 7] There are some unseen messages in the mailbox
      S: * FLAGS (\Answered \Flagged \Draft \Deleted \Seen)
        
      S: * OK [PERMANENTFLAGS (\Answered \Flagged \Draft
          \Deleted \Seen \*)] Permanent flags
      S: * VANISHED (EARLIER) 1:2,4:5,7:8,10:11,13:14,[...],
          29668:29669,29671:29996
      S: * 1 FETCH (UID 3 FLAGS (\Seen \Answered $Important) MODSEQ
          (90060115194045001))
      S: ...
      S: * 9889 FETCH (UID 29667 FLAGS (\Seen \Answered) MODSEQ
          (90060115194045027))
      S: * 9890 FETCH (UID 29670 FLAGS (\Draft $MDNSent) MODSEQ
          (90060115194045028))
      S: ...
      S: * 9999 FETCH (UID 29997 FLAGS (\Seen $Forwarded) MODSEQ
          (90060115194045031))
      S: A04 OK [READ-WRITE] mailbox selected
        
      S: * OK [PERMANENTFLAGS (\Answered \Flagged \Draft
          \Deleted \Seen \*)] Permanent flags
      S: * VANISHED (EARLIER) 1:2,4:5,7:8,10:11,13:14,[...],
          29668:29669,29671:29996
      S: * 1 FETCH (UID 3 FLAGS (\Seen \Answered $Important) MODSEQ
          (90060115194045001))
      S: ...
      S: * 9889 FETCH (UID 29667 FLAGS (\Seen \Answered) MODSEQ
          (90060115194045027))
      S: * 9890 FETCH (UID 29670 FLAGS (\Draft $MDNSent) MODSEQ
          (90060115194045028))
      S: ...
      S: * 9999 FETCH (UID 29997 FLAGS (\Seen $Forwarded) MODSEQ
          (90060115194045031))
      S: A04 OK [READ-WRITE] mailbox selected
        

Example:

例子:

      C: B04 SELECT INBOX (QRESYNC (67890007
         90060115194045000 1:29997 (5000,7500,9000,9990:9999 15000,
         22500,27000,29970,29973,29976,29979,29982,29985,29988,29991,
         29994,29997)))
      S: * 10003 EXISTS
      S: * 4 RECENT
      S: * OK [UIDVALIDITY 67890007] UIDVALIDITY
      S: * OK [UIDNEXT 30013] Predicted next UID
      S: * OK [HIGHESTMODSEQ 90060115205545359] Highest mailbox mod-
         sequence
      S: * OK [UNSEEN 7] There are some unseen messages in the mailbox
      S: * FLAGS (\Answered \Flagged \Draft \Deleted \Seen)
      S: * OK [PERMANENTFLAGS (\Answered \Flagged \Draft
         \Deleted \Seen \*)] Permanent flags
      S: * 1 FETCH (UID 3 FLAGS (\Seen \Answered $Important) MODSEQ
         (90060115194045001))
      S: ...
      S: * 9889 FETCH (UID 29667 FLAGS (\Seen \Answered) MODSEQ
         (90060115194045027))
      S: * 9890 FETCH (UID 29670 FLAGS (\Draft $MDNSent) MODSEQ
         (90060115194045028))
      S: ...
      S: * 9999 FETCH (UID 29997 FLAGS (\Seen $Forwarded) MODSEQ
         (90060115194045031))
      S: B04 OK [READ-WRITE] mailbox selected
        
      C: B04 SELECT INBOX (QRESYNC (67890007
         90060115194045000 1:29997 (5000,7500,9000,9990:9999 15000,
         22500,27000,29970,29973,29976,29979,29982,29985,29988,29991,
         29994,29997)))
      S: * 10003 EXISTS
      S: * 4 RECENT
      S: * OK [UIDVALIDITY 67890007] UIDVALIDITY
      S: * OK [UIDNEXT 30013] Predicted next UID
      S: * OK [HIGHESTMODSEQ 90060115205545359] Highest mailbox mod-
         sequence
      S: * OK [UNSEEN 7] There are some unseen messages in the mailbox
      S: * FLAGS (\Answered \Flagged \Draft \Deleted \Seen)
      S: * OK [PERMANENTFLAGS (\Answered \Flagged \Draft
         \Deleted \Seen \*)] Permanent flags
      S: * 1 FETCH (UID 3 FLAGS (\Seen \Answered $Important) MODSEQ
         (90060115194045001))
      S: ...
      S: * 9889 FETCH (UID 29667 FLAGS (\Seen \Answered) MODSEQ
         (90060115194045027))
      S: * 9890 FETCH (UID 29670 FLAGS (\Draft $MDNSent) MODSEQ
         (90060115194045028))
      S: ...
      S: * 9999 FETCH (UID 29997 FLAGS (\Seen $Forwarded) MODSEQ
         (90060115194045031))
      S: B04 OK [READ-WRITE] mailbox selected
        
3.2.6. VANISHED UID FETCH Modifier
3.2.6. 提取修改器

[RFC4466] has extended the syntax of the FETCH and UID FETCH commands to include an optional FETCH modifier. This document defines a new UID FETCH modifier: VANISHED.

[RFC4466]扩展了FETCH和UID FETCH命令的语法,以包括可选的FETCH修饰符。此文档定义了一个新的UID获取修饰符:已消失。

Note that the VANISHED UID FETCH modifier is NOT allowed with a FETCH command. The server MUST return a tagged BAD response if this response is specified as a modifier to the FETCH command.

请注意,FETCH命令不允许使用FETCH修饰符。如果将此响应指定为FETCH命令的修饰符,则服务器必须返回带标记的错误响应。

A server MUST respond with a tagged BAD response if the VANISHED UID FETCH modifier is specified and the client hasn't issued "ENABLE QRESYNC" in the current connection.

如果指定了已消失的UID FETCH修饰符,并且客户端在当前连接中未发出“ENABLE QRESYNC”,则服务器必须以标记的错误响应进行响应。

The VANISHED UID FETCH modifier MUST only be specified together with the CHANGEDSINCE UID FETCH modifier. If the VANISHED UID FETCH modifier is used without the CHANGEDSINCE UID FETCH modifier, the server MUST respond with a tagged BAD response.

消失的UID提取修饰符只能与CHANGEDSINCE UID提取修饰符一起指定。如果使用消失的UID FETCH修饰符时未使用CHANGEDSINCE UID FETCH修饰符,则服务器必须以标记的错误响应进行响应。

The VANISHED UID FETCH modifier instructs the server to report those messages from the UID set parameter that have been expunged and whose associated mod-sequence is larger than the specified mod-sequence. That is, the client requests to be informed of messages from the specified set that were expunged since the specified mod-sequence. Note that the mod-sequence(s) associated with these messages was updated when the messages were expunged (as described above). The expunged messages are reported using the VANISHED (EARLIER) response as described in Section 3.2.10.1. Any VANISHED (EARLIER) responses MUST be returned before any FETCH responses, otherwise the client might get confused about how message numbers map to UIDs.

消失的UID FETCH修饰符指示服务器报告UID set参数中已删除且关联的mod序列大于指定mod序列的消息。也就是说,客户机请求通知指定集合中自指定mod序列以来已删除的消息。请注意,与这些消息关联的mod序列在删除消息时已更新(如上所述)。如第3.2.10.1节所述,使用消失(早期)响应报告已删除的消息。任何消失的(更早的)响应必须在任何获取响应之前返回,否则客户端可能会对消息编号如何映射到UID感到困惑。

Note: A server that receives a mod-sequence smaller than <minmodseq>, where <minmodseq> is the value of the smallest expunged mod-sequence it remembers minus one, MUST behave as if it was requested to report all expunged messages from the provided UID set parameter.

注意:如果服务器接收的mod sequence小于<minmodseq>,其中<minmodseq>是其记忆的最小已删除mod sequence的值减去1,则其行为必须与请求报告所提供UID set参数中所有已删除消息的行为相同。

Example 1: Without the VANISHED UID FETCH modifier, a CONDSTORE-aware client needs to issue separate commands to learn of flag changes and expunged messages since the last synchronization:

示例1:如果没有已消失的UID FETCH修饰符,感知CONDSTORE的客户端需要发出单独的命令,以了解自上次同步以来的标志更改和已删除消息:

   C: s100 UID FETCH 300:500 (FLAGS) (CHANGEDSINCE 12345)
   S: * 1 FETCH (UID 404 MODSEQ (65402) FLAGS (\Seen))
   S: * 2 FETCH (UID 406 MODSEQ (75403) FLAGS (\Deleted))
   S: * 4 FETCH (UID 408 MODSEQ (29738) FLAGS ($NoJunk
       $AutoJunk $MDNSent))
   S: s100 OK FETCH completed
   C: s101 UID SEARCH 300:500
   S: * SEARCH 404 406 407 408 410 412
   S: s101 OK search completed
        
   C: s100 UID FETCH 300:500 (FLAGS) (CHANGEDSINCE 12345)
   S: * 1 FETCH (UID 404 MODSEQ (65402) FLAGS (\Seen))
   S: * 2 FETCH (UID 406 MODSEQ (75403) FLAGS (\Deleted))
   S: * 4 FETCH (UID 408 MODSEQ (29738) FLAGS ($NoJunk
       $AutoJunk $MDNSent))
   S: s100 OK FETCH completed
   C: s101 UID SEARCH 300:500
   S: * SEARCH 404 406 407 408 410 412
   S: s101 OK search completed
        

Where 300 and 500 are the lowest and highest UIDs from the client's cache. The second SEARCH response tells the client that the messages with UIDs 407, 410, and 412 are still present, but their flags haven't changed since the specified modification sequence.

其中300和500是来自客户端缓存的最低和最高UID。第二个搜索响应告诉客户端,UID407、410和412的消息仍然存在,但它们的标志自指定的修改序列以来没有更改。

Using the VANISHED UID FETCH modifier, it is sufficient to issue only a single command:

使用已消失的UID FETCH修饰符,仅发出一个命令即可:

   C: s100 UID FETCH 300:500 (FLAGS) (CHANGEDSINCE 12345
       VANISHED)
   S: * VANISHED (EARLIER) 300:310,405,411
   S: * 1 FETCH (UID 404 MODSEQ (65402) FLAGS (\Seen))
   S: * 2 FETCH (UID 406 MODSEQ (75403) FLAGS (\Deleted))
   S: * 4 FETCH (UID 408 MODSEQ (29738) FLAGS ($NoJunk
       $AutoJunk $MDNSent))
   S: s100 OK FETCH completed
        
   C: s100 UID FETCH 300:500 (FLAGS) (CHANGEDSINCE 12345
       VANISHED)
   S: * VANISHED (EARLIER) 300:310,405,411
   S: * 1 FETCH (UID 404 MODSEQ (65402) FLAGS (\Seen))
   S: * 2 FETCH (UID 406 MODSEQ (75403) FLAGS (\Deleted))
   S: * 4 FETCH (UID 408 MODSEQ (29738) FLAGS ($NoJunk
       $AutoJunk $MDNSent))
   S: s100 OK FETCH completed
        
3.2.7. EXPUNGE Command
3.2.7. 删除命令

Arguments: none

论点:无

Responses: untagged responses: EXPUNGE or VANISHED

响应:未标记的响应:删除或消失

   Result: OK - expunge completed
           NO - expunge failure: can't expunge (e.g., permission denied)
           BAD - command unknown or arguments invalid
        
   Result: OK - expunge completed
           NO - expunge failure: can't expunge (e.g., permission denied)
           BAD - command unknown or arguments invalid
        

This section updates the definition of the EXPUNGE command described in Section 6.4.3 of [RFC3501].

本节更新了[RFC3501]第6.4.3节中描述的EXPUNGE命令的定义。

The EXPUNGE command permanently removes all messages that have the \Deleted flag set from the currently selected mailbox. Before returning an OK to the client, those messages that are removed are reported using a VANISHED response or EXPUNGE responses.

EXPUNGE命令将永久删除当前选定邮箱中设置了\Deleted标志的所有邮件。在向客户端返回OK之前,将使用消失响应或删除响应报告已删除的消息。

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 removed due to the execution of

如果服务器能够存储所选邮箱的修改序列,则如果至少有一封邮件由于执行修改而被永久删除,则必须增加每个邮箱的修改序列

the EXPUNGE command. For each permanently removed message, the server MUST remember the incremented mod-sequence and corresponding UID. If at least one message got expunged and QRESYNC was enabled, the server MUST send the updated per-mailbox modification sequence using the HIGHESTMODSEQ response code (see Section 3.1.2.1) in the tagged OK response.

删除命令。对于每个永久删除的消息,服务器必须记住递增的mod序列和相应的UID。如果至少有一封邮件被删除且QRESYNC已启用,则服务器必须使用标记的OK响应中的HIGHESTMODSEQ响应代码(参见第3.1.2.1节)发送更新的每个邮箱修改序列。

      Example:    C: A202 EXPUNGE
                  S: * 3 EXPUNGE
                  S: * 3 EXPUNGE
                  S: * 5 EXPUNGE
                  S: * 8 EXPUNGE
                  S: A202 OK [HIGHESTMODSEQ 20010715194045319] expunged
        
      Example:    C: A202 EXPUNGE
                  S: * 3 EXPUNGE
                  S: * 3 EXPUNGE
                  S: * 5 EXPUNGE
                  S: * 8 EXPUNGE
                  S: A202 OK [HIGHESTMODSEQ 20010715194045319] expunged
        

Note: In this example, the client hasn't enabled QRESYNC, so the server is still using untagged EXPUNGE responses. Note that the presence of the HIGHESTMODSEQ response code is optional in this case. If the selected mailbox returned NOMODSEQ, the HIGHESTMODSEQ response code will be absent. In this example, messages 3, 4, 7, and 11 had the \Deleted flag set. The first "* 3 EXPUNGE" reports message #3 as expunged. The second "* 3 EXPUNGE" reports message #4 as expunged (the message number was decremented due to the previous EXPUNGE response). See the description of the EXPUNGE response in [RFC3501] for further explanation.

注意:在本例中,客户端尚未启用QRESYNC,因此服务器仍在使用未标记的删除响应。请注意,在这种情况下,是否存在HIGHESTMODSEQ响应代码是可选的。如果所选邮箱返回NOMODSEQ,则最高位的MODSEQ响应代码将不存在。在此示例中,消息3、4、7和11设置了\Deleted标志。第一个“*3删除”将消息#3报告为已删除。第二个“*3 EXPUNGE”将消息#4报告为已删除(由于先前的EXPUNGE响应,消息编号已减少)。有关更多说明,请参见[RFC3501]中的删除响应说明。

Once the client enables QRESYNC, the server will always send VANISHED responses instead of EXPUNGE responses for mailboxes that support the storing of modification sequences, so the previous example might look like this:

一旦客户端启用QRESYNC,服务器将始终发送消失的响应,而不是删除支持存储修改序列的邮箱的响应,因此前面的示例可能如下所示:

      Example:    C: B202 EXPUNGE
                  S: * VANISHED 405,407,410,425
                  S: B202 OK [HIGHESTMODSEQ 20010715194045319] expunged
        
      Example:    C: B202 EXPUNGE
                  S: * VANISHED 405,407,410,425
                  S: B202 OK [HIGHESTMODSEQ 20010715194045319] expunged
        

Here, messages with message numbers 3, 4, 7, and 11 have respective UIDs 405, 407, 410, and 425.

这里,消息编号为3、4、7和11的消息具有各自的uid 405、407、410和425。

3.2.8. CLOSE Command
3.2.8. 关闭命令

Arguments: none

论点:无

Responses: no specific responses for this command

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

Result: OK - close completed, now in authenticated state BAD - command unknown or arguments invalid

结果:确定-关闭完成,现在处于身份验证状态错误-命令未知或参数无效

This section updates the definition of the CLOSE command described in Section 6.4.2 of [RFC3501].

本节更新了[RFC3501]第6.4.2节中描述的关闭命令的定义。

The CLOSE command permanently removes all messages that have the \Deleted flag set from the currently selected mailbox and returns to the authenticated state from the selected state. No untagged EXPUNGE (or VANISHED) responses are sent.

CLOSE命令将永久删除当前选定邮箱中设置了\Deleted标志的所有邮件,并从选定状态返回到已验证状态。不发送未标记的删除(或消失)响应。

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 removed due to the execution of the CLOSE command. For each permanently removed message, the server MUST remember the incremented mod-sequence and corresponding UID. The server MUST NOT send the updated per-mailbox modification sequence using the HIGHESTMODSEQ response code (see Section 3.1.2.1) in the tagged OK response, as this might cause loss of synchronization on the client.

如果服务器能够存储所选邮箱的修改序列,则如果由于执行CLOSE命令至少有一封邮件被永久删除,则必须增加每个邮箱的修改序列。对于每个永久删除的消息,服务器必须记住递增的mod序列和相应的UID。服务器不得在标记的OK响应中使用HIGHESTMODSEQ响应代码(参见第3.1.2.1节)发送更新的每个邮箱修改序列,因为这可能会导致客户端上的同步丢失。

Example: C: A202 CLOSE S: A202 OK done

示例:C:A202关闭S:A202确定完成

3.2.9. UID EXPUNGE Command
3.2.9. UID删除命令

Arguments: message set

参数:消息集

Responses: untagged responses: EXPUNGE or VANISHED

响应:未标记的响应:删除或消失

   Result: OK - expunge completed
           NO - expunge failure: can't expunge (e.g., permission denied)
           BAD - command unknown or arguments invalid
        
   Result: OK - expunge completed
           NO - expunge failure: can't expunge (e.g., permission denied)
           BAD - command unknown or arguments invalid
        

This section updates the definition of the UID EXPUNGE command described in Section 2.1 of [UIDPLUS], in the presence of QRESYNC. Servers that implement both [UIDPLUS] and QRESYNC extensions must implement UID EXPUNGE as described in this section.

本节在QRESYNC在场的情况下更新[UIDPLUS]第2.1节中描述的UID EXPUNGE命令的定义。同时实现[UIDPLUS]和QRESYNC扩展的服务器必须按照本节所述实现UID EXPUNGE。

The UID EXPUNGE command permanently removes from the currently selected mailbox all messages that have both the \Deleted flag set and a UID that is included in the specified message set. If a message either does not have the \Deleted flag set or has a UID that is not included in the specified message set, it is not affected.

UID EXPUNGE命令将从当前选定的邮箱中永久删除所有设置了\Deleted标志和指定邮件集中包含UID的邮件。如果消息未设置\Deleted标志,或者具有未包含在指定消息集中的UID,则该消息不受影响。

This command is particularly useful for disconnected mode clients. By using UID EXPUNGE instead of EXPUNGE when resynchronizing with the server, the client can avoid inadvertently removing any messages that have been marked as \Deleted by other clients between the time that the client was last connected and the time the client resynchronizes.

此命令对于断开连接模式的客户端特别有用。通过在与服务器重新同步时使用UID EXPUNGE而不是EXPUNGE,客户机可以避免无意中删除在上次连接客户机和客户机重新同步之间被其他客户机标记为\已删除的任何消息。

Before returning an OK to the client, those messages that are removed are reported using a VANISHED response or EXPUNGE responses.

在向客户端返回OK之前,将使用消失响应或删除响应报告已删除的消息。

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 removed due to the execution of the UID EXPUNGE command. For each permanently removed message, the server MUST remember the incremented mod-sequence and corresponding UID. If at least one message got expunged and QRESYNC was enabled, the server MUST send the updated per-mailbox modification sequence using the HIGHESTMODSEQ response code (see Section 3.1.2.1) in the tagged OK response.

如果服务器能够存储所选邮箱的修改序列,则如果由于执行UID EXPUNGE命令至少有一封邮件被永久删除,则必须增加每个邮箱的修改序列。对于每个永久删除的消息,服务器必须记住递增的mod序列和相应的UID。如果至少有一封邮件被删除且QRESYNC已启用,则服务器必须使用标记的OK响应中的HIGHESTMODSEQ响应代码(参见第3.1.2.1节)发送更新的每个邮箱修改序列。

   Example:    C: . UID EXPUNGE 3000:3002
               S: * 3 EXPUNGE
               S: * 3 EXPUNGE
               S: * 3 EXPUNGE
               S: . OK [HIGHESTMODSEQ 20010715194045319] Ok
        
   Example:    C: . UID EXPUNGE 3000:3002
               S: * 3 EXPUNGE
               S: * 3 EXPUNGE
               S: * 3 EXPUNGE
               S: . OK [HIGHESTMODSEQ 20010715194045319] Ok
        

Note: In this example, the client hasn't enabled QRESYNC, so the server is still using untagged EXPUNGE responses instead of VANISHED responses. Note that the presence of the HIGHESTMODSEQ response code is optional. If the selected mailbox returned NOMODSEQ, the HIGHESTMODSEQ response code will be absent. In this example, at least messages with message numbers 3, 4, and 5 (UIDs 3000 to 3002) had the \Deleted flag set. The first "* 3 EXPUNGE" reports message #3 as expunged. The second "* 3 EXPUNGE" reports message #4 as expunged (the message number was decremented due to the previous EXPUNGE response). See the description of the EXPUNGE response in [RFC3501] for further explanation.

注意:在本例中,客户端尚未启用QRESYNC,因此服务器仍然使用未标记的删除响应,而不是消失的响应。请注意,是否存在HIGHESTMODSEQ响应代码是可选的。如果所选邮箱返回NOMODSEQ,则最高位的MODSEQ响应代码将不存在。在此示例中,至少设置了消息编号为3、4和5(UIDs 3000到3002)的\Deleted标志。第一个“*3删除”将消息#3报告为已删除。第二个“*3 EXPUNGE”将消息#4报告为已删除(由于先前的EXPUNGE响应,消息编号已减少)。有关更多说明,请参见[RFC3501]中的删除响应说明。

3.2.10. VANISHED Response
3.2.10. 消失反应

The VANISHED response reports that the specified UIDs have been permanently removed from the mailbox. This response is similar to the EXPUNGE response [RFC3501]; however, it can return information about multiple messages, and it returns UIDs instead of message numbers. The first benefit saves bandwidth, while the second is more convenient for clients that only use UIDs to access the IMAP server.

消失的响应报告指定的UID已从邮箱中永久删除。此响应类似于删除响应[RFC3501];但是,它可以返回有关多条消息的信息,并返回UID而不是消息编号。第一个好处可以节省带宽,而第二个好处对于仅使用UID访问IMAP服务器的客户端来说更方便。

The VANISHED response has the same restrictions on when it can be sent as does the EXPUNGE response (see below). Once a client has issued "ENABLE QRESYNC" (and the server has positively responded to that command with the untagged ENABLED response containing QRESYNC), the server MUST use the VANISHED response without the EARLIER tag instead of the EXPUNGE response for all mailboxes that don't return NOMODSEQ when selected. The server continues using VANISHED in lieu of EXPUNGE for the duration of the connection. In particular, this affects the EXPUNGE [RFC3501] and UID EXPUNGE [UIDPLUS] commands, as well as messages expunged in other connections. Such a VANISHED response MUST NOT contain the EARLIER tag.

“消失”响应与“删除”响应在发送时间上具有相同的限制(见下文)。一旦客户端发出“ENABLE QRESYNC”(并且服务器已使用包含QRESYNC的未标记的已启用响应对该命令做出肯定响应),服务器必须使用不带早期标记的已消失响应,而不是对所有在选中时不返回NOMODSEQ的邮箱使用删除响应。在连接期间,服务器继续使用“消失”代替“删除”。特别是,这会影响EXPUNGE[RFC3501]和UID EXPUNGE[UIDPLUS]命令,以及在其他连接中删除的消息。这种消失的响应不能包含前面的标记。

The VANISHED response has two forms. The first form contains the EARLIER tag, which signifies that the response was caused by a UID FETCH (VANISHED) or a SELECT/EXAMINE (QRESYNC) command. The second form doesn't contain the EARLIER tag and is used for announcing message removals within an already selected mailbox.

消失的反应有两种形式。第一个表单包含前面的标记,表示响应是由UID FETCH(消失)或SELECT/inspect(QRESYNC)命令引起的。第二个表单不包含前面的标记,用于在已选择的邮箱中宣布邮件删除。

Because clients handle the two different forms of the VANISHED response differently, servers MUST NOT combine them. Messages are reported in VANISHED responses with or without the EARLIER tag, as appropriate to the cause, and, if necessary, two VANISHED responses are sent (one with EARLIER and one without).

因为客户端处理两种不同形式的消失响应的方式不同,所以服务器不能将它们组合在一起。根据原因,在带有或不带有早期标记的消失响应中报告消息,如有必要,发送两个消失响应(一个带有早期标记,一个没有)。

3.2.10.1. VANISHED (EARLIER) Response
3.2.10.1. 消失的(先前的)反应

Contents: an EARLIER tag

内容:早期标记

list of UIDs

UID列表

The VANISHED (EARLIER) response is caused by a UID FETCH (VANISHED) or a SELECT/EXAMINE (QRESYNC) command. This response is sent if the UID set parameter to the UID FETCH (VANISHED) command includes UIDs of messages that are no longer in the mailbox. When the client sees a VANISHED EARLIER response, it MUST NOT decrement message sequence numbers for each successive message in the mailbox.

消失(早期)响应是由UID FETCH(消失)或SELECT/EXAMINE(QRESYNC)命令引起的。如果UID FETCH(消失)命令的UID set参数包含邮箱中不再存在的邮件的UID,则会发送此响应。当客户端看到已消失的较早响应时,它不得减少邮箱中每个连续邮件的邮件序列号。

3.2.10.2. VANISHED Response without the (EARLIER) Tag
3.2.10.2. 不带(早期)标记的消失响应

Contents: list of UIDs

目录:UID列表

Once a client has issued "ENABLE QRESYNC" (and the server has positively responded to that command with the untagged ENABLED response containing QRESYNC), the server MUST use the VANISHED response without the EARLIER tag instead of the EXPUNGE response for all mailboxes that don't return NOMODSEQ when selected. The server continues using VANISHED in lieu of EXPUNGE for the duration of the connection. In particular, this affects the EXPUNGE [RFC3501] and UID EXPUNGE [UIDPLUS] commands, as well as messages expunged in other connections. Such a VANISHED response MUST NOT contain the EARLIER tag.

一旦客户端发出“ENABLE QRESYNC”(并且服务器已使用包含QRESYNC的未标记的已启用响应对该命令做出肯定响应),服务器必须使用不带早期标记的已消失响应,而不是对所有在选中时不返回NOMODSEQ的邮箱使用删除响应。在连接期间,服务器继续使用“消失”代替“删除”。特别是,这会影响EXPUNGE[RFC3501]和UID EXPUNGE[UIDPLUS]命令,以及在其他连接中删除的消息。这种消失的响应不能包含前面的标记。

Unlike VANISHED (EARLIER), this response also decrements the number of messages in the mailbox and adjusts the message sequence numbers for the messages remaining in the mailbox to account for the expunged messages. Because of this housekeeping, it is not necessary for the server to send an EXISTS response to report the new message count. See the example at the end of this section.

与已消失(早期)不同,此响应还减少邮箱中的邮件数,并调整邮箱中剩余邮件的邮件序列号,以说明已删除的邮件。由于这种内务管理,服务器不必发送EXISTS响应来报告新的消息计数。请参见本节末尾的示例。

A VANISHED response without the EARLIER tag MUST refer only to messages that are visible to the client in the current session at the time the VANISHED response is sent. That is, servers MUST NOT send UIDs for previously expunged messages or messages that were not announced to the client via EXISTS. This means that each UID listed in a VANISHED response results in the client decrementing the message count by one. This is required to prevent a possible race condition where new arrivals for which the UID is not yet known by the client are immediately expunged.

没有早期标记的消失响应必须仅引用在发送消失响应时客户端在当前会话中可见的消息。也就是说,服务器不得为以前删除的消息或未通过EXISTS向客户端宣布的消息发送UID。这意味着消失响应中列出的每个UID都会导致客户端将消息计数减少1。这是为了防止可能出现的争用情况,即客户端尚未知道UID的新到达立即被删除。

A VANISHED response MUST NOT be sent when no command is in progress, nor while responding to a FETCH, STORE, or SEARCH command. This rule is necessary to prevent a loss of synchronization of message sequence numbers between the client and server. A command is not "in progress" until the complete command has been received; in particular, a command is not "in progress" during the negotiation of command continuation.

当没有命令正在执行时,或者在响应FETCH、STORE或SEARCH命令时,不得发送消失的响应。此规则对于防止丢失客户端和服务器之间的消息序列号同步是必需的。在收到完整的命令之前,命令不会“进行中”;特别是,在命令延续的协商过程中,命令没有“进行中”。

Note: UID FETCH, UID STORE, and UID SEARCH are different commands from FETCH, STORE, and SEARCH. A VANISHED response MAY be sent during a UID command. However, the VANISHED response MUST NOT be sent during a UID SEARCH command that contains message numbers in the search criteria.

注意:UID FETCH、UID STORE和UID SEARCH是与FETCH、STORE和SEARCH不同的命令。UID命令期间可能会发送消失的响应。但是,在搜索条件中包含消息编号的UID搜索命令期间,不得发送消失的响应。

The update from the VANISHED response MUST be recorded by the client.

客户端必须记录来自已消失响应的更新。

Example: Let's assume that there is the following mapping between message numbers and UIDs in the currently selected mailbox (here "D" marks messages with the \Deleted flag set, and "x" represents UIDs, which are not relevant for the example):

示例:假设当前选定邮箱中的邮件编号和UID之间存在以下映射(此处“D”标记设置了\Deleted标志的邮件,“x”表示UID,这与示例无关):

Message numbers: 1 2 3 4 5 6 7 8 9 10 11 UIDs: x 504 505 507 508 x 510 x x x 625 \Deleted messages: D D D D

消息编号:1234567891011 UIDs:x504507508x510x625\已删除消息:D

In the presence of the extension defined in this document:

在本文件中定义的扩展出现时:

   C: A202 EXPUNGE
   S: * VANISHED 505,507,510,625
   S: A202 OK EXPUNGE completed
        
   C: A202 EXPUNGE
   S: * VANISHED 505,507,510,625
   S: A202 OK EXPUNGE completed
        

Without the QRESYNC extension, the same example might look like:

如果没有QRESYNC扩展,相同的示例可能如下所示:

   C: A202 EXPUNGE
   S: * 3 EXPUNGE
   S: * 3 EXPUNGE
   S: * 5 EXPUNGE
   S: * 8 EXPUNGE
   S: A202 OK EXPUNGE completed
        
   C: A202 EXPUNGE
   S: * 3 EXPUNGE
   S: * 3 EXPUNGE
   S: * 5 EXPUNGE
   S: * 8 EXPUNGE
   S: A202 OK EXPUNGE completed
        

(Continuing from the previous example.) If subsequently messages with UIDs 504 and 508 got marked as \Deleted:

(继续上一示例)如果随后带有UID 504和508的消息被标记为\已删除:

   C: A210 EXPUNGE
   S: * VANISHED 504,508
   S: A210 OK EXPUNGE completed
        
   C: A210 EXPUNGE
   S: * VANISHED 504,508
   S: A210 OK EXPUNGE completed
        

For Example, the last VANISHED response only contains UIDs of messages expunged since the previous VANISHED response.

例如,上次消失的响应仅包含自上次消失的响应以来已删除的消息的UID。

To illustrate the difference between VANISHED and VANISHED (EARLIER), suppose the mailbox contains UIDs 2 and 4. Any of the following responses would constitute a broken server implementation:

为了说明消失和消失(前面)之间的区别,假设邮箱包含UID2和UID4。以下任何响应都将构成中断的服务器实现:

   S: * VANISHED 1
   S: * VANISHED 3
   S: * VANISHED 5
        
   S: * VANISHED 1
   S: * VANISHED 3
   S: * VANISHED 5
        

However, any of these UIDs can easily be referenced by the VANISHED (EARLIER) response.

但是,这些UID中的任何一个都可以很容易地被消失的(早期)响应引用。

3.2.11. CLOSED Response Code
3.2.11. 闭合响应码

The CLOSED response code has no parameters. A server implementing the extension defined in this document MUST return the CLOSED response code when the currently selected mailbox is closed implicitly using the SELECT/EXAMINE command on another mailbox. The CLOSED response code serves as a boundary between responses for the previously opened mailbox (which was closed) and the newly selected mailbox; all responses before the CLOSED response code relate to the mailbox that was closed, and all subsequent responses relate to the newly opened mailbox.

关闭响应代码没有参数。当使用另一个邮箱上的SELECT/EXAMINE命令隐式关闭当前选定的邮箱时,实现此文档中定义的扩展的服务器必须返回关闭的响应代码。关闭的响应代码用作以前打开的邮箱(已关闭)和新选择的邮箱的响应之间的边界;关闭的响应代码之前的所有响应都与已关闭的邮箱相关,后续的所有响应都与新打开的邮箱相关。

A server that advertises "QRESYNC" or "CONDSTORE" in the capability string must return the CLOSED response code in this case, whether or not a CONDSTORE enabling command was issued.

在这种情况下,无论是否发出CONDSTORE启用命令,在功能字符串中播发“QRESYNC”或“CONDSTORE”的服务器都必须返回关闭的响应代码。

There is no need to return the CLOSED response code on completion of the CLOSE or the UNSELECT [UNSELECT] command (or similar), whose purpose is to close the currently selected mailbox without opening a new one.

关闭或取消选择[UNSELECT]命令(或类似命令)完成后,无需返回关闭的响应代码,其目的是关闭当前选定的邮箱而不打开新邮箱。

4. Long Command Lines (Update to RFC 2683)
4. 长命令行(更新为RFC 2683)

While [RFC3501] doesn't specify a specific line-length limit, several server implementations chose to implement the recommended line-length limit suggested in Section 3.2.1.5 of [RFC2683] in order to protect from Denial-of-Service attacks. When the line-length limit is exceeded, such servers return a BAD response (as required by [RFC3501] in case of a syntactic error) and may even close the connection. Clients that support CONDSTORE/QRESYNC extensions can trigger this limit by sending a long UID sequence (previously returned by the server) in an extended SELECT or FETCH command.

虽然[RFC3501]没有指定特定的线路长度限制,但一些服务器实现选择实施[RFC2683]第3.2.1.5节中建议的推荐线路长度限制,以防止拒绝服务攻击。当超过线路长度限制时,此类服务器返回错误响应(如[RFC3501]在出现语法错误时所要求的),甚至可能关闭连接。支持CONDSTORE/QRESYNC扩展的客户端可以通过在扩展的SELECT或FETCH命令中发送长UID序列(以前由服务器返回)来触发此限制。

This document updates recommended line-length limits specified in Section 3.2.1.5 of [RFC2683]. While the advice in the first paragraph of that section still applies (use compact message/UID set representations), the 1000-octet limit suggested in the second paragraph turns out to be quite problematic when the CONDSTORE and/or QRESYNC extension is used.

本文件更新了[RFC2683]第3.2.1.5节中规定的推荐线路长度限制。尽管该节第一段中的建议仍然适用(使用紧凑消息/UID集表示),但当使用CONDSTORE和/或QRESYNC扩展时,第二段中建议的1000个八位字节限制结果是非常有问题的。

The updated recommendation is as follows: a client should limit the length of the command lines it generates to approximately 8192 octets (including all quoted strings but not including literals). If the client is unable to group things into ranges so that the command line is within that length, it should split the request into multiple commands. The client should use literals instead of long quoted strings in order to keep the command length down.

更新后的建议如下:客户端应将其生成的命令行长度限制为大约8192个八位字节(包括所有带引号的字符串,但不包括文字)。如果客户机无法将内容分组到范围中,以便命令行在该长度内,则应将请求拆分为多个命令。客户机应该使用文字而不是长引号字符串,以降低命令长度。

5. QRESYNC Server Implementation Considerations
5. QRESYNC服务器实现注意事项

This section describes a minimalist implementation, a moderate implementation, and an example of a full implementation.

本节介绍了最低限度的实现、中等程度的实现以及完整实现的示例。

5.1. Server Implementations That Don't Store Extra State
5.1. 不存储额外状态的服务器实现

Strictly speaking, a server implementation that doesn't remember mod-sequences associated with expunged messages can be considered compliant with this specification. Such implementations return all expunged messages specified in the UID set of the UID FETCH (VANISHED) command every time, without paying attention to the specified CHANGEDSINCE mod-sequence. Such implementations are discouraged as they can end up returning VANISHED responses that are bigger than the result of a UID SEARCH command for the same UID set.

严格地说,不记得与已删除消息相关联的mod序列的服务器实现可以被视为符合此规范。这种实现每次都返回UID FETCH(消失)命令的UID集合中指定的所有已删除消息,而不注意指定的CHANGEDSINCE mod序列。不鼓励这样的实现,因为它们最终可能返回大于同一UID集的UID搜索命令结果的消失响应。

A client can substantially reduce the size of VANISHED responses by providing the server with message sequence match data (see Section 3.2.5.2). This is especially effective in the typical case where no messages have been expunged, or all expunges were toward the end of the mailbox.

客户机可以通过向服务器提供消息序列匹配数据(见第3.2.5.2节),大大减少消失响应的大小。这在没有删除任何邮件或所有删除都在邮箱末尾的典型情况下尤其有效。

5.2. Server Implementations Storing Minimal State
5.2. 存储最小状态的服务器实现

A server that stores the HIGHESTMODSEQ value at the time of the last EXPUNGE can omit the VANISHED response when a client provides a MODSEQ value that is equal to or higher than that HIGHESTMODSEQ value because there have been no messages expunged during the time period the client is concerned about.

当客户端提供的MODSEQ值等于或高于HIGHESTMODSEQ值时,存储上次删除时的HIGHESTMODSEQ值的服务器可以忽略消失的响应,因为在客户端关心的时间段内没有删除任何消息。

A client providing message sequence match data can reduce the scope as above. In the case where there have been no expunges, the server can ignore this data.

提供消息序列匹配数据的客户端可以减少上述范围。在没有删除的情况下,服务器可以忽略此数据。

5.3. Additional State Required on the Server
5.3. 服务器上需要的其他状态

When compared to the CONDSTORE extension, QRESYNC requires servers to store an additional state associated with expunged messages. Note that implementations are not required to store this state in persistent storage; however, use of persistent storage is advisable.

与CONDSTORE扩展相比,QRESYNC要求服务器存储与已删除消息关联的附加状态。注意,实现不需要将此状态存储在持久存储中;但是,建议使用持久性存储。

One possible way to correctly implement QRESYNC is to store a queue of <UID set, mod-sequence> pairs. <UID set> can be represented as a sequence of <min UID, max UID> pairs.

正确实现QRESYNC的一种可能方法是存储<uidset,mod sequence>对的队列<UID set>可以表示为<min UID,max UID>对的序列。

When messages are expunged, one or more entries are added to the queue tail.

删除消息时,一个或多个条目将添加到队列尾部。

When the server receives a request to return messages expunged since a given mod-sequence, it will search the queue from the tail (i.e., going from the highest expunged mod-sequence to the lowest) until it sees the first record with a mod-sequence less than or equal to the given mod-sequence or it reaches the head of the queue.

当服务器收到返回从给定mod序列删除的消息的请求时,它将从尾部搜索队列(即,从最高的已删除mod序列到最低的),直到它看到mod序列小于或等于给定mod序列的第一条记录或到达队列的头部。

Note that indefinitely storing information about expunged messages can cause storage and related problems for an implementation. In the worst case, this could result in almost 64 GB of storage for each IMAP mailbox. For example, consider an implementation that stores <min UID, max UID, mod-sequence> triples for each range of messages expunged at the same time. Each triple requires 16 octets: 4 octets for each of the two UIDs and 8 octets for the mod-sequence. Assume that there is a mailbox containing a single message with a UID of 2**32-1 (the maximum possible UID value), where messages had previously existed with UIDs starting at 1 and have been expunged one

请注意,无限期地存储有关已删除消息的信息可能会导致实现的存储和相关问题。在最坏的情况下,这可能会导致每个IMAP邮箱的存储空间接近64 GB。例如,考虑一个实现同时存储每个消息范围的<min uID、max uID、mod序列>三元组的方法。每个三元组需要16个八位组:两个UID各4个八位组,mod序列8个八位组。假设存在一个邮箱,其中包含一封UID为2**32-1(最大可能UID值)的邮件,该邮箱中的邮件以前存在,UID从1开始,现在已被删除一封

at a time. For this mailbox alone, storage is required for the triples <1, 1, modseq1>, <2, 2, modseq2>, ..., <2**32-2, 2**32-2, modseq4294967294>.

一次。仅此邮箱就需要存储三元组<1,1,modseq1>,<2,2,modseq2>,…,<2**32-2,2**32-2,modseq4294967294>。

Hence, implementations are encouraged to adopt strategies to protect against such storage problems, such as limiting the size of the queue used to store mod-sequences for expunged messages and "expiring" older records when this limit is reached. When the selected implementation-specific queue limit is reached, the oldest record(s) is deleted from the queue (note that such records are located at the queue head). For all such "expired" records, the server needs to store a single mod-sequence, which is the highest mod-sequence for all "expired" expunged messages.

因此,鼓励实现采用策略来防止此类存储问题,例如限制用于存储已删除消息的mod序列的队列大小,并在达到此限制时“终止”旧记录。当达到选定的特定于实现的队列限制时,将从队列中删除最旧的记录(请注意,这些记录位于队列头)。对于所有此类“过期”记录,服务器需要存储单个mod序列,这是所有“过期”已删除消息的最高mod序列。

If the client provides the message sequence match data, this can heavily reduce the data cost of sending a complete set of missing UIDs; thus, it reduces the problems for clients if a server is unable to persist much of this queue. If the queue contains data back to the requested mod-sequence, this data can be ignored.

如果客户机提供消息序列匹配数据,这可以大大降低发送一整套缺失UID的数据成本;因此,如果服务器无法持久保存此队列的大部分内容,则可以减少客户端的问题。如果队列包含返回请求的mod序列的数据,则可以忽略此数据。

Also, note that if the UIDVALIDITY of the mailbox changes or if the mailbox is deleted, then any state associated with expunged messages doesn't need to be preserved and SHOULD be deleted.

另外,请注意,如果邮箱的UIDVality发生更改或邮箱被删除,则与已删除邮件关联的任何状态都不需要保留,应该删除。

6. Updated Synchronization Sequence
6. 更新的同步序列

This section updates the description of optimized synchronization in Section 6.1 of [IMAP-DISC], in the presence of QRESYNC.

本节更新了[IMAP-DISC]第6.1节中关于QRESYNC存在时优化同步的描述。

An advanced disconnected mail client SHOULD use the QRESYNC extension when it is supported by the server and SHOULD use CONDSTORE if it is supported and QRESYNC is not. The client uses the value from the HIGHESTMODSEQ OK response code received on the mailbox opening to determine if it needs to resynchronize. Once the synchronization is complete, it MUST cache the received value (unless the mailbox UIDVALIDITY value has changed; see below). The client MUST update its copy of the HIGHESTMODSEQ value whenever the server sends a subsequent HIGHESTMODSEQ OK response code.

高级断开连接的邮件客户端应在服务器支持时使用QRESYNC扩展,如果支持而不支持QRESYNC,则应使用CONDSTORE。客户端使用邮箱打开时收到的HIGHESTMODSEQ OK响应代码中的值来确定是否需要重新同步。同步完成后,它必须缓存收到的值(除非邮箱UIDVality值已更改;请参见下文)。每当服务器发送后续HIGHESTMODSEQ OK响应代码时,客户端必须更新HIGHESTMODSEQ值的副本。

After completing a full synchronization, the client MUST also take note of any unsolicited MODSEQ FETCH data items and HIGHESTMODSEQ response codes received from the server. Whenever the client receives a tagged response to a command, it checks the received unsolicited responses to calculate the new HIGHESTMODSEQ value. If the HIGHESTMODSEQ response code is received, the client MUST use it even if it has seen higher mod-sequences. Otherwise, the client calculates the highest value among all MODSEQ FETCH data items

完成完全同步后,客户端还必须注意从服务器接收到的任何未经请求的MODSEQ获取数据项和最高级MODSEQ响应代码。每当客户端收到对命令的标记响应时,它都会检查收到的未经请求的响应,以计算新的HIGHESTMODSEQ值。如果接收到最高位ModSeq响应代码,客户机必须使用它,即使它看到了较高的mod序列。否则,客户端将计算所有MODSEQ FETCH数据项中的最高值

received since the last tagged response. If this value is bigger than the client's copy of the HIGHESTMODSEQ value, then the client MUST use this value as its new HIGHESTMODSEQ value.

自上次标记的响应后收到。如果此值大于客户端的HIGHESTMODSEQ值副本,则客户端必须使用此值作为其新的HIGHESTMODSEQ值。

Example:

例子:

   C: A150 STORE 1:2 (UNCHANGEDSINCE 96) +FLAGS.SILENT \Seen
   S: * 1 FETCH (UID 6 MODSEQ (103))
   S: * 2 FETCH (UID 7 MODSEQ (101))
   S: * OK [HIGHESTMODSEQ 99] VANISHED reply with MODSEQ 100 is delayed
   S: A150 OK [MODIFIED 3] done
        
   C: A150 STORE 1:2 (UNCHANGEDSINCE 96) +FLAGS.SILENT \Seen
   S: * 1 FETCH (UID 6 MODSEQ (103))
   S: * 2 FETCH (UID 7 MODSEQ (101))
   S: * OK [HIGHESTMODSEQ 99] VANISHED reply with MODSEQ 100 is delayed
   S: A150 OK [MODIFIED 3] done
        
   C: A151 STORE 3 +FLAGS.SILENT \Seen
   S: * 3 FETCH (UID 8 MODSEQ (104))
   S: A151 OK [HIGHESTMODSEQ 99] Still delaying VANISHED
        
   C: A151 STORE 3 +FLAGS.SILENT \Seen
   S: * 3 FETCH (UID 8 MODSEQ (104))
   S: A151 OK [HIGHESTMODSEQ 99] Still delaying VANISHED
        
   C: A152 NOOP
   S: * VANISHED 8
   S: A153 OK [HIGHESTMODSEQ 104] done
        
   C: A152 NOOP
   S: * VANISHED 8
   S: A153 OK [HIGHESTMODSEQ 104] done
        

Note: It is not safe to update the client's copy of the HIGHESTMODSEQ value with a MODSEQ FETCH data item value as soon as it is received because servers are not required to send MODSEQ FETCH data items in increasing mod-sequence order. Some commands may also delay EXPUNGE (or VANISHED) replies with smaller mod-sequences. These can lead to the client missing some changes in case of connectivity loss.

注意:在收到MODSEQ FETCH数据项值后,立即用MODSEQ FETCH数据项值更新客户机的HIGHESTMODSEQ值副本是不安全的,因为服务器不需要以递增的MODSEQ序列顺序发送MODSEQ FETCH数据项。某些命令还可能延迟使用较小的mod序列进行删除(或消失)回复。这些可能会导致客户端在连接丢失时丢失一些更改。

When opening the mailbox for synchronization, the client uses the QRESYNC parameter to the SELECT/EXAMINE command. The QRESYNC parameter is followed by the UIDVALIDITY and mailbox HIGHESTMODSEQ values, as known to the client. It can be optionally followed by the set of UIDs, for example, if the client is only interested in partial synchronization of the mailbox. The client may also transmit a list containing its knowledge of message numbers.

打开邮箱进行同步时,客户端将QRESYNC参数用于SELECT/inspect命令。QRESYNC参数后面是客户端已知的UIDVality和mailbox HIGHESTMODSEQ值。例如,如果客户机只对邮箱的部分同步感兴趣,则可以选择后跟UID集。客户机还可以发送包含其对消息号码的了解的列表。

If the SELECT/EXAMINE command is successful, the client compares UIDVALIDITY as described in step d-1 in Section 3 of the [IMAP-DISC]. If the cached UIDVALIDITY value matches the one returned by the server and the server also returns the HIGHESTMODSEQ response code, then the server reports expunged messages and returns flag changes for all messages specified by the client in the UID set parameter (or for all messages in the mailbox, if the client omitted the UID set parameter). At this point, the client is synchronized, except for maybe the new messages.

如果选择/检查命令成功,客户端将按照[IMAP-DISC]第3节中步骤d-1所述比较UID的有效性。如果缓存的UIDVality值与服务器返回的值匹配,并且服务器还返回HIGHESTMODSEQ响应代码,则服务器会报告已删除的邮件,并返回客户端在UID set参数中指定的所有邮件(或邮箱中的所有邮件,如果客户端忽略UID set参数)的标志更改。在这一点上,客户机是同步的,除了可能的新消息。

If upon a successful SELECT/EXAMINE (QRESYNC) command the client receives a NOMODSEQ OK untagged response (instead of the HIGHESTMODSEQ response code), it MUST remove the last known HIGHESTMODSEQ value from its cache and follow the more general instructions in Section 3 of the [IMAP-DISC].

如果成功执行选择/检查(QRESYNC)命令后,客户端收到NOMODSEQ OK untagged响应(而不是HIGHESTMODSEQ响应代码),则必须从其缓存中删除最后一个已知的HIGHESTMODSEQ值,并遵循[IMAP-DISC]第3节中更一般的说明。

At this point, the client is in sync with the server regarding old messages. This client can now fetch information about new messages (if requested by the user).

此时,客户端与服务器就旧消息进行同步。此客户端现在可以获取有关新消息的信息(如果用户请求)。

Step d ("Server-to-client synchronization") in Section 6.1 of [IMAP-DISC] in the presence of the QRESYNC & CONDSTORE extensions is amended as follows:

[IMAP-DISC]第6.1节中的步骤d(“服务器到客户端同步”)在QRESYNC&CONDSTORE extensions在场的情况下修改如下:

d) "Server-to-client synchronization" -- for each mailbox that requires synchronization, do the following:

d) “服务器到客户端同步”--对于每个需要同步的邮箱,请执行以下操作:

1a) Check the mailbox UIDVALIDITY (see Section 4.1 of [IMAP-DISC] for more details) after issuing the SELECT/EXAMINE (QRESYNC) command.

1a)发出选择/检查(QRESYNC)命令后,检查邮箱UID的有效性(更多详细信息,请参阅[IMAP-DISC]的第4.1节)。

If the UIDVALIDITY value returned by the server differs, the client MUST:

如果服务器返回的UIDVality值不同,则客户端必须:

* empty the local cache of that mailbox;

* 清空该邮箱的本地缓存;

* "forget" the cached HIGHESTMODSEQ value for the mailbox; and

* “忘记”邮箱的缓存HIGHESTMODSEQ值;和

* remove any pending "actions" that refer to UIDs in that mailbox. Note, this doesn't affect actions performed on client-generated fake UIDs (see Section 5 of the [IMAP-DISC]).

* 删除该邮箱中引用UID的任何挂起的“操作”。注意,这不会影响对客户端生成的伪UID执行的操作(请参阅[IMAP-DISC]第5节)。

1b) This step is no longer required.

1b)不再需要此步骤。

2) Fetch the current "descriptors".

2) 获取当前的“描述符”。

I) Discover new messages.

一) 发现新消息。

3) Fetch the bodies of any "interesting" messages that the client doesn't already have.

3) 获取客户端还没有的任何“有趣”消息的主体。

Example: The UIDVALIDITY value is the same, but the HIGHESTMODSEQ value has changed on the server while the client was offline:

示例:UIDVALIDITY值相同,但客户端脱机时服务器上的HIGHESTMODSEQ值已更改:

    C: A142 SELECT INBOX (QRESYNC (3857529045 20010715194032001 1:198))
    S: * 172 EXISTS
    S: * 1 RECENT
    S: * OK [UNSEEN 12] Message 12 is first unseen
    S: * OK [UIDVALIDITY 3857529045] UIDs valid
    S: * OK [UIDNEXT 201] Predicted next UID
    S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
    S: * OK [PERMANENTFLAGS (\Deleted \Seen \*)] Limited
    S: * OK [HIGHESTMODSEQ 20010715194045007] Highest
          mailbox mod-sequence
    S: * VANISHED (EARLIER) 1:5,7:8,10:15
    S: * 2 FETCH (UID 6 MODSEQ (20010715205008000)
        FLAGS (\Deleted))
    S: * 5 FETCH (UID 9 MODSEQ (20010715195517000)
        FLAGS ($NoJunk $AutoJunk $MDNSent))
       ...
    S: A142 OK [READ-WRITE] SELECT completed
        
    C: A142 SELECT INBOX (QRESYNC (3857529045 20010715194032001 1:198))
    S: * 172 EXISTS
    S: * 1 RECENT
    S: * OK [UNSEEN 12] Message 12 is first unseen
    S: * OK [UIDVALIDITY 3857529045] UIDs valid
    S: * OK [UIDNEXT 201] Predicted next UID
    S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
    S: * OK [PERMANENTFLAGS (\Deleted \Seen \*)] Limited
    S: * OK [HIGHESTMODSEQ 20010715194045007] Highest
          mailbox mod-sequence
    S: * VANISHED (EARLIER) 1:5,7:8,10:15
    S: * 2 FETCH (UID 6 MODSEQ (20010715205008000)
        FLAGS (\Deleted))
    S: * 5 FETCH (UID 9 MODSEQ (20010715195517000)
        FLAGS ($NoJunk $AutoJunk $MDNSent))
       ...
    S: A142 OK [READ-WRITE] SELECT completed
        
7. Formal Syntax
7. 形式语法

The following syntax specification uses the Augmented Backus-Naur Form (ABNF) notation as specified in [RFC5234].

以下语法规范使用[RFC5234]中指定的增广巴科斯诺尔形式(ABNF)表示法。

Non-terminals referenced but not defined below are as defined by [RFC5234], [RFC3501], or [RFC4466].

以下引用但未定义的非端子由[RFC5234]、[RFC3501]或[RFC4466]定义。

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          =/ "CONDSTORE" / "QRESYNC"
        
   capability          =/ "CONDSTORE" / "QRESYNC"
        

status-att =/ "HIGHESTMODSEQ" ;; Extends non-terminal defined in [RFC3501].

状态att=/“最高级ModSeq”;;扩展[RFC3501]中定义的非端子。

   status-att-val      =/ "HIGHESTMODSEQ" SP mod-sequence-valzer
                          ;; Extends non-terminal defined in [RFC4466].
                          ;; Value 0 denotes that the mailbox doesn't
                          ;; support persistent mod-sequences
                          ;; as described in Section 3.1.2.2.
        
   status-att-val      =/ "HIGHESTMODSEQ" SP mod-sequence-valzer
                          ;; Extends non-terminal defined in [RFC4466].
                          ;; Value 0 denotes that the mailbox doesn't
                          ;; support persistent mod-sequences
                          ;; as described in Section 3.1.2.2.
        

store-modifier =/ "UNCHANGEDSINCE" SP mod-sequence-valzer ;; Only a single "UNCHANGEDSINCE" may be ;; specified in a STORE operation.

存储修饰符=/“未更改自”SP mod sequence valzer;;只有一个“不变的原因”可以是;;在存储操作中指定。

fetch-modifier =/ chgsince-fetch-mod ;; Conforms to the generic "fetch-modifier" ;; syntax defined in [RFC4466].

fetch修饰符=/chgsince fetch mod;;符合通用的“提取修饰符”;;[RFC4466]中定义的语法。

chgsince-fetch-mod = "CHANGEDSINCE" SP mod-sequence-value ;; CHANGEDSINCE FETCH modifier conforms to ;; the fetch-modifier syntax.

chgsince fetch mod=“CHANGEDSINCE”SP mod sequence value;;CHANGEDSINCE FETCH修饰符符合;;获取修饰符语法。

fetch-att =/ fetch-mod-sequence ;; Modifies original IMAP4 fetch-att.

fetch att=/fetch mod sequence;;修改原始IMAP4 fetch-att。

   fetch-mod-sequence  = "MODSEQ"
        
   fetch-mod-sequence  = "MODSEQ"
        

fetch-mod-resp = "MODSEQ" SP "(" permsg-modsequence ")"

fetch mod resp=“MODSEQ”SP”(“permsg modsequence”)

msg-att-dynamic =/ fetch-mod-resp

msg att dynamic=/fetch mod resp

   search-key          =/ search-modsequence
                          ;; Modifies original IMAP4 search-key.
                          ;;
                          ;; This change applies to all commands
                          ;; referencing this non-terminal -- in
                          ;; particular, SEARCH, SORT, and THREAD.
        
   search-key          =/ search-modsequence
                          ;; Modifies original IMAP4 search-key.
                          ;;
                          ;; This change applies to all commands
                          ;; referencing this non-terminal -- in
                          ;; particular, SEARCH, SORT, and THREAD.
        

search-modsequence = "MODSEQ" [search-modseq-ext] SP mod-sequence-valzer

search modsequence=“MODSEQ”[search MODSEQ ext]SP mod sequence valzer

   search-modseq-ext   = SP entry-name SP entry-type-req
        
   search-modseq-ext   = SP entry-name SP entry-type-req
        

resp-text-code =/ "HIGHESTMODSEQ" SP mod-sequence-value / "NOMODSEQ" / "MODIFIED" SP sequence-set

响应文本代码=/“HIGHESTMODSEQ”SP模块序列值/“NOMODSEQ”/“MODIFIED”SP序列集

   entry-name          = entry-flag-name
        
   entry-name          = entry-flag-name
        
   entry-flag-name     = DQUOTE "/flags/" attr-flag DQUOTE
                          ;; Each system or user-defined flag <flag>
                          ;; is mapped to "/flags/<flag>".
                          ;;
                          ;; <entry-flag-name> follows the escape rules
                          ;; used by "quoted" string as described in
                          ;; Section 4.3 of [RFC3501]; e.g., for the
                          ;; flag \Seen, the corresponding <entry-name>
                          ;; is "/flags/\\seen", and for the flag
                          ;; $MDNSent, the corresponding <entry-name>
                          ;; is "/flags/$mdnsent".
        
   entry-flag-name     = DQUOTE "/flags/" attr-flag DQUOTE
                          ;; Each system or user-defined flag <flag>
                          ;; is mapped to "/flags/<flag>".
                          ;;
                          ;; <entry-flag-name> follows the escape rules
                          ;; used by "quoted" string as described in
                          ;; Section 4.3 of [RFC3501]; e.g., for the
                          ;; flag \Seen, the corresponding <entry-name>
                          ;; is "/flags/\\seen", and for the flag
                          ;; $MDNSent, the corresponding <entry-name>
                          ;; is "/flags/$mdnsent".
        
   entry-type-resp     = "priv" / "shared"
                          ;; Metadata item type.
        
   entry-type-resp     = "priv" / "shared"
                          ;; Metadata item type.
        
   entry-type-req      = entry-type-resp / "all"
                          ;; Perform SEARCH operation on a private
                          ;; metadata item, shared metadata item,
                          ;; or both.
        
   entry-type-req      = entry-type-resp / "all"
                          ;; Perform SEARCH operation on a private
                          ;; metadata item, shared metadata item,
                          ;; or both.
        

permsg-modsequence = mod-sequence-value ;; Per-message mod-sequence.

permsg modsequence=mod sequence值;;按消息模式顺序。

   mod-sequence-value  = 1*DIGIT
                          ;; Positive unsigned 63-bit integer
                          ;; (mod-sequence)
                          ;; (1 <= n <= 9,223,372,036,854,775,807).
        
   mod-sequence-value  = 1*DIGIT
                          ;; Positive unsigned 63-bit integer
                          ;; (mod-sequence)
                          ;; (1 <= n <= 9,223,372,036,854,775,807).
        

mod-sequence-valzer = "0" / mod-sequence-value

mod sequence valzer=“0”/mod sequence值

search-sort-mod-seq = "(" "MODSEQ" SP mod-sequence-value ")"

搜索排序mod seq=“(“MODSEQ”SP mod sequence value”)”

select-param =/ condstore-param ;; Conforms to the generic "select-param" ;; non-terminal syntax defined in [RFC4466].

选择param=/condstore param;;符合通用的“选择参数”;;[RFC4466]中定义的非终端语法。

   condstore-param     = "CONDSTORE"
        
   condstore-param     = "CONDSTORE"
        

mailbox-data =/ "SEARCH" [1*(SP nz-number) SP search-sort-mod-seq]

邮箱数据=/“搜索”[1*(SP nz编号)SP搜索排序模式顺序]

sort-data = "SORT" [1*(SP nz-number) SP search-sort-mod-seq] ; Updates the SORT response from RFC 5256.

排序数据=“排序”[1*(SP nz编号)SP搜索排序模式顺序];从RFC 5256更新排序响应。

   attr-flag           = "\\Answered" / "\\Flagged" / "\\Deleted" /
                         "\\Seen" / "\\Draft" / attr-flag-keyword /
                         attr-flag-extension
                          ;; Does not include "\\Recent".
        
   attr-flag           = "\\Answered" / "\\Flagged" / "\\Deleted" /
                         "\\Seen" / "\\Draft" / attr-flag-keyword /
                         attr-flag-extension
                          ;; Does not include "\\Recent".
        
   attr-flag-extension = "\\" atom
                          ;; Future expansion.  Client implementations
                          ;; MUST accept flag-extension flags.  Server
                          ;; implementations MUST NOT generate
                          ;; flag-extension flags, except as defined by
                          ;; future standards or Standards Track
                          ;; revisions of [RFC3501].
        
   attr-flag-extension = "\\" atom
                          ;; Future expansion.  Client implementations
                          ;; MUST accept flag-extension flags.  Server
                          ;; implementations MUST NOT generate
                          ;; flag-extension flags, except as defined by
                          ;; future standards or Standards Track
                          ;; revisions of [RFC3501].
        
   attr-flag-keyword   = atom
        
   attr-flag-keyword   = atom
        

select-param =/ "QRESYNC" SP "(" uidvalidity SP mod-sequence-value [SP known-uids] [SP seq-match-data] ")" ;; Conforms to the generic select-param ;; syntax defined in [RFC4466].

选择param=/“QRESYNC”SP”(“uidvalidity SP mod sequence value[SP known uids][SP seq match data]”);;符合通用选择参数;;[RFC4466]中定义的语法。

seq-match-data = "(" known-sequence-set SP known-uid-set ")"

seq match data=“(“已知序列集SP已知uid集”)”

   uidvalidity         =  nz-number
        
   uidvalidity         =  nz-number
        

known-uids = sequence-set ;; Sequence of UIDs; "*" is not allowed.

已知UID=序列集;;UID序列;不允许使用“*”。

   known-sequence-set  =  sequence-set
                       ;; Set of message numbers corresponding to
                       ;; the UIDs in known-uid-set, in ascending order.
                       ;; * is not allowed.
        
   known-sequence-set  =  sequence-set
                       ;; Set of message numbers corresponding to
                       ;; the UIDs in known-uid-set, in ascending order.
                       ;; * is not allowed.
        
   known-uid-set       =  sequence-set
                       ;; Set of UIDs corresponding to the messages in
                       ;; known-sequence-set, in ascending order.
                       ;; * is not allowed.
        
   known-uid-set       =  sequence-set
                       ;; Set of UIDs corresponding to the messages in
                       ;; known-sequence-set, in ascending order.
                       ;; * is not allowed.
        

message-data =/ expunged-resp

消息数据=/expunged resp

expunged-resp = "VANISHED" [SP "(EARLIER)"] SP known-uids

expunged resp=“消失”[SP(早期)]SP已知UID

   rexpunges-fetch-mod =  "VANISHED"
                       ;; VANISHED UID FETCH modifier conforms
                       ;; to the fetch-modifier syntax
                       ;; defined in [RFC4466].  It is only
                       ;; allowed in the UID FETCH command.
        
   rexpunges-fetch-mod =  "VANISHED"
                       ;; VANISHED UID FETCH modifier conforms
                       ;; to the fetch-modifier syntax
                       ;; defined in [RFC4466].  It is only
                       ;; allowed in the UID FETCH command.
        

resp-text-code =/ "CLOSED"

resp文本代码=/“已关闭”

8. Security Considerations
8. 安全考虑

As always, it is important to thoroughly test clients and servers implementing QRESYNC, as it changes how the server reports expunged messages to the client.

和往常一样,彻底测试实现QRESYNC的客户机和服务器非常重要,因为它改变了服务器向客户机报告已删除消息的方式。

It is believed that the CONDSTORE or the QRESYNC extensions don't raise any new security concerns that are not already discussed in [RFC3501]. However, the availability of CONDSTORE may make it possible for IMAP4 to be used in critical applications it could not be used for previously, making correct IMAP server implementation and operation even more important.

据信,CONDSTORE或QRESYNC扩展不会引起[RFC3501]中尚未讨论的任何新的安全问题。然而,CONDSTORE的可用性可能使IMAP4能够用于以前无法用于的关键应用程序,从而使正确的IMAP服务器实现和操作更加重要。

9. IANA Considerations
9. IANA考虑

IMAP4 capabilities are registered by publishing a Standards Track or IESG-approved Experimental RFC. The registry is currently located at:

IMAP4功能通过发布标准跟踪或IESG批准的实验RFC进行注册。注册处目前位于:

      http://www.iana.org/assignments/imap-capabilities
        
      http://www.iana.org/assignments/imap-capabilities
        

This document defines the CONDSTORE and QRESYNC IMAP capabilities. IANA has updated references for both extensions to point to this document.

本文档定义了CONDSTORE和QRESYNC IMAP功能。IANA更新了这两个扩展的参考文献,以指向本文档。

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

[RFC2683] Leiba, B., "IMAP4 Implementation Recommendations", RFC 2683, September 1999.

[RFC2683]Leiba,B.,“IMAP4实施建议”,RFC 2683,1999年9月。

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

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

[RFC4466] Melnikov, A. and C. Daboo, "Collected Extensions to IMAP4 ABNF", RFC 4466, April 2006.

[RFC4466]Melnikov,A.和C.Daboo,“IMAP4 ABNF的收集扩展”,RFC4466,2006年4月。

[RFC5161] Gulbrandsen, A. and A. Melnikov, "The IMAP ENABLE Extension", RFC 5161, March 2008.

[RFC5161]Gulbrandsen,A.和A.Melnikov,“IMAP启用扩展”,RFC 51612008年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月。

[RFC5256] Crispin, M. and K. Murchison, "Internet Message Access Protocol - SORT and THREAD Extensions", RFC 5256, June 2008.

[RFC5256]Crispin,M.和K.Murchison,“互联网消息访问协议-排序和线程扩展”,RFC 5256,2008年6月。

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

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

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

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

10.2. Informative References
10.2. 资料性引用

[IMAP-DISC] Melnikov, A., Ed., "Synchronization Operations For Disconnected Imap4 Clients", RFC 4549, June 2006.

[IMAP-DISC]Melnikov,A.,编辑,“断开连接的Imap4客户端的同步操作”,RFC 4549,2006年6月。

[NTP] Mills, D., Martin, J., Burbank, J., and W. Kasch, "Network Time Protocol Version 4: Protocol and Algorithms Specification", RFC 5905, June 2010.

[NTP]Mills,D.,Martin,J.,Burbank,J.,和W.Kasch,“网络时间协议版本4:协议和算法规范”,RFC 59052010年6月。

[RFC2180] Gahrns, M., "IMAP4 Multi-Accessed Mailbox Practice", RFC 2180, July 1997.

[RFC2180]Gahrns,M.,“IMAP4多址邮箱实践”,RFC21801997年7月。

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

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

[RFC4731] Melnikov, A. and D. Cridland, "IMAP4 Extension to SEARCH Command for Controlling What Kind of Information Is Returned", RFC 4731, November 2006.

[RFC4731]Melnikov,A.和D.Cridland,“用于控制返回何种信息的搜索命令的IMAP4扩展”,RFC 47312006年11月。

[RFC5257] Daboo, C. and R. Gellens, "Internet Message Access Protocol - ANNOTATE Extension", RFC 5257, June 2008.

[RFC5257]Daboo,C.和R.Gellens,“互联网消息访问协议-注释扩展”,RFC 5257,2008年6月。

[RFC5267] Cridland, D. and C. King, "Contexts for IMAP4", RFC 5267, July 2008.

[RFC5267]Cridland,D.和C.King,“IMAP4的上下文”,RFC 5267,2008年7月。

[RFC6851] Gulbrandsen, A. and N. Freed, "Internet Message Access Protocol (IMAP) - MOVE Extension", RFC 6851, January 2013.

[RFC6851]Gulbrandsen,A.和N.Freed,“互联网消息访问协议(IMAP)-移动扩展”,RFC 68512013年1月。

[UNSELECT] Melnikov, A., "Internet Message Access Protocol (IMAP) UNSELECT command", RFC 3691, February 2004.

[UNSELECT]Melnikov,A.,“互联网消息访问协议(IMAP)UNSELECT命令”,RFC 3691,2004年2月。

Appendix A. Changes since RFC 4551
附录A.自RFC 4551以来的变化

Changed mod-sequences to be unsigned 63-bit values (instead of unsigned 64-bit values).

将mod序列更改为无符号63位值(而不是无符号64位值)。

Fixed the following errata, as posted on <http://www.rfc-editor.org>:

修复了发布在上的以下勘误表<http://www.rfc-editor.org>:

o Errata ID 3401 ("several typos in UNCHANGEDSINCE spelling") o Errata ID 3506 ("invalid ABNF for the MODIFIED response code") o Errata ID 3509 ("correction to an example")

o 勘误表ID 3401(“几个拼写不改变的拼写错误”)o勘误表ID 3506(“修改后的响应代码的ABNF无效”)o勘误表ID 3509(“示例更正”)

Clarified that the returning of HIGHESTMODSEQ/NOMODSEQ response codes is only required once a CONDSTORE enabling command is issued.

澄清仅在发出CONDSTORE启用命令后才需要返回HIGHESTMODSEQ/NOMODSEQ响应代码。

Clarified that if multiple mod-sequences (for different metadata items) are associated with a message, then all of them affecting a particular STORE UNCHANGEDSINCE must be checked.

阐明如果多个mod序列(针对不同的元数据项)与消息关联,则必须检查所有影响特定存储的mod序列UNCHANGEDSINCE。

Updated references.

更新参考资料。

Made editorial corrections.

进行编辑更正。

Appendix B. Changes since RFC 5162
附录B.自RFC 5162以来的变化

Changed mod-sequences to be unsigned 63-bit values (instead of unsigned 64-bit values).

将mod序列更改为无符号63位值(而不是无符号64位值)。

Addressed the following errata, as posted on <http://www.rfc-editor.org>:

根据发布在上的以下勘误表进行了说明<http://www.rfc-editor.org>:

o Errata ID 1365 ("clarified that QRESYNC is only enabled when ENABLED QRESYNC is returned") o Errata ID 1807 ("unsolicited FETCH responses must include UID fetch response item") o Errata ID 1808 ("HIGHESTMODSEQ response code must not be returned for CLOSE") o Errata ID 1809 ("clarify how updated mailbox mod-sequence is calculated") o Errata ID 1810 ("server must send untagged events to client in a way that client doesn't lose any changes in case of connectivity loss") o Errata ID 3322 ("VANISHED responses must not reference non-existing UIDs")

o 勘误表ID 1365(“澄清仅当返回已启用的QRESYNC时才启用QRESYNC”)o勘误表ID 1807(“未经请求的提取响应必须包括UID提取响应项”)o勘误表ID 1808(“关闭时不得返回最高级的ModSeq响应代码”)o勘误表ID 1809(“澄清如何计算更新的邮箱mod序列”)o勘误表ID 1810(“服务器必须向客户端发送未标记的事件,以便客户端在连接丢失时不会丢失任何更改”)o勘误表ID 3322(“消失的响应不得引用不存在的UID”)

Clarified that ENABLE QRESYNC CONDSTORE and ENABLE CONDSTORE QRESYNC are equivalent.

阐明了ENABLE QRESYNC CONDSTORE和ENABLE CONDSTORE QRESYNC是等效的。

Changed the requirement to return VANISHED from SHOULD to MUST as per the mailing list discussion. The only exception is for mailboxes that return the NOMODSEQ response code when they are selected.

根据邮件列表讨论,将要求从“应该”返回到“必须”。唯一的例外是在选择时返回NOMODSEQ响应代码的邮箱。

Specified that IMAP SETMETADATA changes update per-mailbox HIGHESTMODSEQ.

指定IMAP SETMETADATA更改更新每个邮箱HIGHESTMODSEQ。

Clarified that per-message annotations are also considered "metadata".

阐明了每条消息的注释也被视为“元数据”。

Fixed some examples to report data that match requirements specified in the document.

修复了一些示例,以报告符合文档中指定要求的数据。

Clarified some text and made some requirements normative. Also, corrected a couple of SHOULDs to be MUSTs.

澄清了一些文本,并制定了一些规范性要求。此外,纠正了一些必须遵守的要求。

Updated references.

更新参考资料。

Made editorial corrections.

进行编辑更正。

Appendix C. Acknowledgements
附录C.确认书

Thank you to Steve Hole for co-editing RFC 4551.

感谢Steve Hole共同编辑RFC 4551。

In this revision of the document, the authors also acknowledge the feedback provided by Timo Sirainen, Jan Kundrat, Pete Maclean, Barry Leiba, Eliot Lear, Chris Newman, Claudio Allocchio, Michael Slusarz, Bron Gondwana, Arnt Gulbrandsen, David Black, Hoa V. DINH, and Nick Hudson.

在本次文件修订中,作者还确认了Timo Sirainen、Jan Kundrat、Pete Maclean、Barry Leiba、Eliot Lear、Chris Newman、Claudio Allocchio、Michael Slusarz、Bron Gondwana、Arnt Gulbrandsen、David Black、Hoa V.DINH和Nick Hudson提供的反馈。

Mark Crispin contributed to RFCs 4551 and 5162 that this document is replacing, and much of his contribution remains in this merged document.

Mark Crispin为RFC 4551和5162做出了贡献,本文件将取代这些贡献,他的大部分贡献仍保留在本合并文件中。

See also the list of people who contributed to RFC 4551, which this document obsoletes.

另请参见为RFC 4551捐款的人员名单,本文件已淘汰该名单。

Authors' Addresses

作者地址

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

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

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

Dave Cridland Surevine Ltd PO Box 1136 Guildford, Surrey GU1 9ND UK

Dave Cridland Surevine有限公司英国萨里郡吉尔福德1136号邮政信箱

   EMail: dave.cridland@surevine.com
        
   EMail: dave.cridland@surevine.com