Internet Engineering Task Force (IETF)                          S. Bosch
Request for Comments: 8438                                    Dovecot Oy
Category: Standards Track                                    August 2018
ISSN: 2070-1721
        
Internet Engineering Task Force (IETF)                          S. Bosch
Request for Comments: 8438                                    Dovecot Oy
Category: Standards Track                                    August 2018
ISSN: 2070-1721
        

IMAP Extension for STATUS=SIZE

状态=大小的IMAP扩展

Abstract

摘要

This document adds a new capability called "STATUS=SIZE" to the Internet Message Access Protocol (IMAP). It allows retrieving the total storage size of a mailbox with a single STATUS command rather than retrieving and summing the sizes of all individual messages in that mailbox.

本文档在Internet消息访问协议(IMAP)中添加了一个名为“STATUS=SIZE”的新功能。它允许使用单个STATUS命令检索邮箱的总存储大小,而不是检索该邮箱中所有单个邮件的大小并求和。

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 7841.

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

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

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

Copyright Notice

版权公告

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

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

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://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文件的法律规定的约束(https://trustee.ietf.org/license-info)自本文件出版之日起生效。请仔细阅读这些文件,因为它们描述了您对本文件的权利和限制。从本文件中提取的代码组件必须包括信托法律条款第4.e节中所述的简化BSD许可证文本,并提供简化BSD许可证中所述的无担保。

Table of Contents

目录

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
   2.  Conventions Used in This Document . . . . . . . . . . . . . .   3
   3.  STATUS Command and Response Extensions  . . . . . . . . . . .   3
   4.  Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . .   5
   5.  Security Considerations . . . . . . . . . . . . . . . . . . .   5
   6.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   5
   7.  Normative References  . . . . . . . . . . . . . . . . . . . .   5
   Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . . .   6
   Author's Address  . . . . . . . . . . . . . . . . . . . . . . . .   6
        
   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
   2.  Conventions Used in This Document . . . . . . . . . . . . . .   3
   3.  STATUS Command and Response Extensions  . . . . . . . . . . .   3
   4.  Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . .   5
   5.  Security Considerations . . . . . . . . . . . . . . . . . . .   5
   6.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   5
   7.  Normative References  . . . . . . . . . . . . . . . . . . . .   5
   Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . . .   6
   Author's Address  . . . . . . . . . . . . . . . . . . . . . . . .   6
        
1. Introduction
1. 介绍

This document extends the Internet Message Access Protocol (IMAP) [IMAP4rev1] with a new capability called "STATUS=SIZE". To determine the total storage size of a mailbox, an IMAP client currently needs to retrieve all message sizes individually using the FETCH command with the RFC822.SIZE data item. The STATUS=SIZE capability provides a more efficient means of achieving this. It extends the STATUS command with a new "SIZE" data item, which indicates the total size of all messages in the target mailbox. This way, this information can be queried with just one STATUS command. When the LIST-STATUS IMAP capability [LIST-STATUS] is also available, the SIZE data item can be queried for many mailboxes at once using just one LIST command.

本文档使用名为“STATUS=SIZE”的新功能扩展了Internet消息访问协议(IMAP)[IMAP4rev1]。要确定邮箱的总存储大小,IMAP客户端当前需要使用带有RFC822.size数据项的FETCH命令分别检索所有邮件大小。STATUS=SIZE功能提供了一种更有效的方法来实现这一点。它使用新的“SIZE”数据项扩展STATUS命令,该数据项指示目标邮箱中所有邮件的总大小。这样,只需一个STATUS命令即可查询此信息。当LIST-STATUS IMAP功能[LIST-STATUS]也可用时,可以使用一个LIST命令一次查询多个邮箱的大小数据项。

This capability is particularly useful for IMAP clients that do not cache the state of the message store, such as most webmail clients. Without the "STATUS=SIZE" capability, such clients need to fetch all message sizes from the server when the size of an individual mailbox needs to be determined. For example, a user may request detailed quota usage information for each mailbox to find out which specific mailboxes consume most of the available storage resources. Using this information, the user can get an overview of which mailboxes need to be cleaned up to reduce quota usage. The QUOTA capability [QUOTA] is no help in that scenario, since the provided QUOTAROOT command can only yield the STORAGE resource usage of a whole quota root, not each individual mailbox within that root.

此功能对于不缓存消息存储状态的IMAP客户端(如大多数webmail客户端)特别有用。如果没有“STATUS=SIZE”功能,当需要确定单个邮箱的大小时,此类客户端需要从服务器获取所有邮件大小。例如,用户可能会请求每个邮箱的详细配额使用信息,以查明哪些特定邮箱消耗了大部分可用存储资源。使用此信息,用户可以获得需要清理哪些邮箱以减少配额使用的概览。配额功能[QUOTA]在该场景中没有帮助,因为提供的QUOTAROOT命令只能产生整个配额根的存储资源使用情况,而不是该根中的每个邮箱。

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

In examples, "C:" indicates lines sent by a client that is connected to a server. "S:" indicates lines sent by the server to the client.

在示例中,“C:”表示连接到服务器的客户端发送的线路。“S:”表示服务器发送到客户端的行。

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [KEYWORDS] [KEYWORDS2] when, and only when, they appear in all capitals, as shown here.

本文件中的关键词“必须”、“不得”、“必需”、“应”、“不应”、“建议”、“不建议”、“可”和“可选”在所有大写字母出现时(且仅在所有大写字母出现时)应按照BCP 14[关键词][关键词2]中所述进行解释,如下所示。

3. STATUS Command and Response Extensions
3. 状态命令和响应扩展

This extension defines one new status data item for the STATUS command and response:

此扩展为status命令和响应定义了一个新的状态数据项:

SIZE The total size of the mailbox in octets. This is not strictly required to be an exact value, but it MUST be equal to or greater than the sum of the values of the RFC822.SIZE FETCH message data item [IMAP4rev1] of all messages in the mailbox. When the QUOTA capability [QUOTA] is also supported, this value SHOULD be equal to the storage usage value used to enforce the STORAGE resource limit for this mailbox. This way, the client can directly infer the quota usage.

SIZE邮箱的总大小(以八位字节为单位)。严格来说,这不是一个精确的值,但必须等于或大于邮箱中所有邮件的RFC822.SIZE FETCH邮件数据项[IMAP4rev1]的值之和。如果还支持配额功能[QUOTA],则此值应等于用于强制此邮箱的存储资源限制的存储使用率值。这样,客户端可以直接推断配额使用情况。

Since the total storage size of a mailbox can easily exceed 4 GB, clients MUST be capable of receiving 63-bit SIZE data item values. The message size is chosen to be at most 63 bits wide rather than 64 bits to make implementations on various platforms (such as Java) easier.

由于邮箱的总存储大小很容易超过4 GB,因此客户端必须能够接收63位大小的数据项值。消息大小被选择为最多63位宽,而不是64位宽,以便于在各种平台(如Java)上实现。

Example:

例子:

   C: A01 STATUS frop (MESSAGES SIZE UIDNEXT)
   S: * STATUS frop (MESSAGES 8 SIZE 44421 UIDNEXT 242344)
   S: A01 OK STATUS completed
        
   C: A01 STATUS frop (MESSAGES SIZE UIDNEXT)
   S: * STATUS frop (MESSAGES 8 SIZE 44421 UIDNEXT 242344)
   S: A01 OK STATUS completed
        

The same information can be obtained by using the following commands, albeit less efficiently:

使用以下命令可以获得相同的信息,但效率较低:

   C: A02 SELECT "frop"
   S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
   S: * 8 EXISTS
   S: * 1 RECENT
   S: * OK [UNSEEN 7] First unseen.
   S: * OK [UIDVALIDITY 1364851417] UIDs valid
   S: * OK [UIDNEXT 242344] Predicted next UID
   S: * OK [HIGHESTMODSEQ 3914] Highest
   S: A02 OK [READ-WRITE] Select completed.
   C: A03 FETCH 1:* (RFC822.SIZE)
   S: * 1 FETCH (RFC822.SIZE 3224)
   S: * 2 FETCH (RFC822.SIZE 1222)
   S: * 3 FETCH (RFC822.SIZE 444)
   S: * 4 FETCH (RFC822.SIZE 4516)
   S: * 5 FETCH (RFC822.SIZE 544)
   S: * 6 FETCH (RFC822.SIZE 922)
   S: * 7 FETCH (RFC822.SIZE 31126)
   S: * 8 FETCH (RFC822.SIZE 2423)
   S: A03 OK Fetch completed.
        
   C: A02 SELECT "frop"
   S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
   S: * 8 EXISTS
   S: * 1 RECENT
   S: * OK [UNSEEN 7] First unseen.
   S: * OK [UIDVALIDITY 1364851417] UIDs valid
   S: * OK [UIDNEXT 242344] Predicted next UID
   S: * OK [HIGHESTMODSEQ 3914] Highest
   S: A02 OK [READ-WRITE] Select completed.
   C: A03 FETCH 1:* (RFC822.SIZE)
   S: * 1 FETCH (RFC822.SIZE 3224)
   S: * 2 FETCH (RFC822.SIZE 1222)
   S: * 3 FETCH (RFC822.SIZE 444)
   S: * 4 FETCH (RFC822.SIZE 4516)
   S: * 5 FETCH (RFC822.SIZE 544)
   S: * 6 FETCH (RFC822.SIZE 922)
   S: * 7 FETCH (RFC822.SIZE 31126)
   S: * 8 FETCH (RFC822.SIZE 2423)
   S: A03 OK Fetch completed.
        

When the LIST-STATUS IMAP capability [LIST-STATUS] is also available, the STATUS command can be combined with the LIST command to further improve efficiency. This way, the sizes of many mailboxes can be queried with just one LIST command.

当LIST-STATUS IMAP功能[LIST-STATUS]也可用时,STATUS命令可以与LIST命令结合使用,以进一步提高效率。这样,只需一个LIST命令就可以查询多个邮箱的大小。

Example:

例子:

   C: A04 LIST "" % RETURN (STATUS (MESSAGES SIZE))
   S: * LIST () "." "INBOX"
   S: * STATUS "INBOX" (MESSAGES 17 SIZE 16234)
   S: * LIST () "." "frop"
   S: * STATUS "frop" (MESSAGES 8 SIZE 44421)
   S: A04 OK List completed.
        
   C: A04 LIST "" % RETURN (STATUS (MESSAGES SIZE))
   S: * LIST () "." "INBOX"
   S: * STATUS "INBOX" (MESSAGES 17 SIZE 16234)
   S: * LIST () "." "frop"
   S: * STATUS "frop" (MESSAGES 8 SIZE 44421)
   S: A04 OK List completed.
        
4. Formal Syntax
4. 形式语法

The following syntax specification augments the grammar specified in [IMAP4rev1] and [IMAP4-ABNF]. It uses the Augmented Backus-Naur Form (ABNF) notation as specified in [ABNF]. Elements not defined here are taken from [IMAP4rev1] and [IMAP4-ABNF].

以下语法规范扩充了[IMAP4rev1]和[IMAP4-ABNF]中指定的语法。它使用[ABNF]中指定的增广巴科斯诺尔形式(ABNF)表示法。此处未定义的元素取自[IMAP4rev1]和[IMAP4-ABNF]。

   capability     =/ "STATUS=SIZE"
        
   capability     =/ "STATUS=SIZE"
        

status-att =/ "SIZE"

状态att=/“大小”

status-att-val =/ "SIZE" SP number64

状态att val=/“大小”SP编号64

   number64       = 1*DIGIT
                    ; Unsigned 63-bit integer
                    ; (0 <= n <= 9,223,372,036,854,775,807)
        
   number64       = 1*DIGIT
                    ; Unsigned 63-bit integer
                    ; (0 <= n <= 9,223,372,036,854,775,807)
        
5. Security Considerations
5. 安全考虑

There are no known additional security issues with this extension beyond those described for the base protocol [IMAP4rev1] and the LIST-STATUS extension [LIST-STATUS].

除了基本协议[IMAP4rev1]和列表状态扩展[LIST-STATUS]所述的安全问题外,此扩展没有其他已知的安全问题。

6. IANA Considerations
6. IANA考虑

IANA has added "STATUS=SIZE" to the "IMAP Capabilities" registry located at <http://www.iana.org/assignments/imap-capabilities>.

IANA已将“STATUS=SIZE”添加到位于的“IMAP功能”注册表中<http://www.iana.org/assignments/imap-capabilities>.

7. Normative References
7. 规范性引用文件

[ABNF] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", STD 68, RFC 5234, DOI 10.17487/RFC5234, January 2008, <https://www.rfc-editor.org/info/rfc5234>.

[ABNF]Crocker,D.,Ed.和P.Overell,“语法规范的扩充BNF:ABNF”,STD 68,RFC 5234,DOI 10.17487/RFC5234,2008年1月<https://www.rfc-editor.org/info/rfc5234>.

[IMAP4-ABNF] Melnikov, A. and C. Daboo, "Collected Extensions to IMAP4 ABNF", RFC 4466, DOI 10.17487/RFC4466, April 2006, <https://www.rfc-editor.org/info/rfc4466>.

[IMAP4-ABNF]Melnikov,A.和C.Daboo,“IMAP4 ABNF的收集扩展”,RFC 4466,DOI 10.17487/RFC4466,2006年4月<https://www.rfc-editor.org/info/rfc4466>.

[IMAP4rev1] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1", RFC 3501, DOI 10.17487/RFC3501, March 2003, <https://www.rfc-editor.org/info/rfc3501>.

[IMAP4rev1]Crispin,M.,“互联网消息访问协议-版本4rev1”,RFC 3501,DOI 10.17487/RFC3501,2003年3月<https://www.rfc-editor.org/info/rfc3501>.

[KEYWORDS] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, <https://www.rfc-editor.org/info/rfc2119>.

[关键词]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,DOI 10.17487/RFC2119,1997年3月<https://www.rfc-editor.org/info/rfc2119>.

[KEYWORDS2] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, <https://www.rfc-editor.org/info/rfc8174>.

[KEYWORDS2]Leiba,B.,“RFC 2119关键词中大写与小写的歧义”,BCP 14,RFC 8174,DOI 10.17487/RFC8174,2017年5月<https://www.rfc-editor.org/info/rfc8174>.

[LIST-STATUS] Melnikov, A. and T. Sirainen, "IMAP4 Extension for Returning STATUS Information in Extended LIST", RFC 5819, DOI 10.17487/RFC5819, March 2010, <https://www.rfc-editor.org/info/rfc5819>.

[列表状态]Melnikov,A.和T.Sirainen,“用于在扩展列表中返回状态信息的IMAP4扩展”,RFC 5819,DOI 10.17487/RFC5819,2010年3月<https://www.rfc-editor.org/info/rfc5819>.

[QUOTA] Myers, J., "IMAP4 QUOTA extension", RFC 2087, DOI 10.17487/RFC2087, January 1997, <https://www.rfc-editor.org/info/rfc2087>.

[配额]迈尔斯,J.,“IMAP4配额扩展”,RFC 2087,DOI 10.17487/RFC2087,1997年1月<https://www.rfc-editor.org/info/rfc2087>.

Acknowledgements

致谢

Thanks to Bron Gondwana, Alexey Melnikov, Stan Kalisch, and Michael Slusarz for reviews and suggestions.

感谢Bron Gondwana、Alexey Melnikov、Stan Kalisch和Michael Slusarz的评论和建议。

Author's Address

作者地址

Stephan Bosch Dovecot Oy Lars Sonckin Kaari 12 Espoo 02600 Finland

Stephan Bosch Dovecot Oy Lars Sonckin Kaari 12 Espoo 02600芬兰

   Email: stephan.bosch@dovecot.fi
        
   Email: stephan.bosch@dovecot.fi