⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rfc3501.txt

📁 广泛使用的邮件服务器!同时
💻 TXT
📖 第 1 页 / 共 5 页
字号:
Network Working Group                                         M. CrispinRequest for Comments: 3501                      University of WashingtonObsoletes: 2060                                               March 2003Category: Standards Track            INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1Status of this Memo   This document specifies an Internet standards track protocol for the   Internet community, and requests discussion and suggestions for   improvements.  Please refer to the current edition of the "Internet   Official Protocol Standards" (STD 1) for the standardization state   and status of this protocol.  Distribution of this memo is unlimited.Copyright Notice   Copyright (C) The Internet Society (2003).  All Rights Reserved.Abstract   The Internet Message Access Protocol, Version 4rev1 (IMAP4rev1)   allows a client to access and manipulate electronic mail messages on   a server.  IMAP4rev1 permits manipulation of mailboxes (remote   message folders) in a way that is functionally equivalent to local   folders.  IMAP4rev1 also provides the capability for an offline   client to resynchronize with the server.   IMAP4rev1 includes operations for creating, deleting, and renaming   mailboxes, checking for new messages, permanently removing messages,   setting and clearing flags, RFC 2822 and RFC 2045 parsing, searching,   and selective fetching of message attributes, texts, and portions   thereof.  Messages in IMAP4rev1 are accessed by the use of numbers.   These numbers are either message sequence numbers or unique   identifiers.   IMAP4rev1 supports a single server.  A mechanism for accessing   configuration information to support multiple IMAP4rev1 servers is   discussed in RFC 2244.   IMAP4rev1 does not specify a means of posting mail; this function is   handled by a mail transfer protocol such as RFC 2821.Crispin                     Standards Track                     [Page 1]RFC 3501                         IMAPv4                       March 2003Table of Contents   IMAP4rev1 Protocol Specification ................................  4   1.      How to Read This Document ...............................  4   1.1.    Organization of This Document ...........................  4   1.2.    Conventions Used in This Document .......................  4   1.3.    Special Notes to Implementors ...........................  5   2.      Protocol Overview .......................................  6   2.1.    Link Level ..............................................  6   2.2.    Commands and Responses ..................................  6   2.2.1.  Client Protocol Sender and Server Protocol Receiver .....  6   2.2.2.  Server Protocol Sender and Client Protocol Receiver .....  7   2.3.    Message Attributes ......................................  8   2.3.1.  Message Numbers .........................................  8   2.3.1.1.        Unique Identifier (UID) Message Attribute .......  8   2.3.1.2.        Message Sequence Number Message Attribute ....... 10   2.3.2.  Flags Message Attribute ................................. 11   2.3.3.  Internal Date Message Attribute ......................... 12   2.3.4.  [RFC-2822] Size Message Attribute ....................... 12   2.3.5.  Envelope Structure Message Attribute .................... 12   2.3.6.  Body Structure Message Attribute ........................ 12   2.4.    Message Texts ........................................... 13   3.      State and Flow Diagram .................................. 13   3.1.    Not Authenticated State ................................. 13   3.2.    Authenticated State ..................................... 13   3.3.    Selected State .......................................... 13   3.4.    Logout State ............................................ 14   4.      Data Formats ............................................ 16   4.1.    Atom .................................................... 16   4.2.    Number .................................................. 16   4.3.    String .................................................. 16   4.3.1.  8-bit and Binary Strings ................................ 17   4.4.    Parenthesized List ...................................... 17   4.5.    NIL ..................................................... 17   5.      Operational Considerations .............................. 18   5.1.    Mailbox Naming .......................................... 18   5.1.1.  Mailbox Hierarchy Naming ................................ 19   5.1.2.  Mailbox Namespace Naming Convention ..................... 19   5.1.3.  Mailbox International Naming Convention ................. 19   5.2.    Mailbox Size and Message Status Updates ................. 21   5.3.    Response when no Command in Progress .................... 21   5.4.    Autologout Timer ........................................ 22   5.5.    Multiple Commands in Progress ........................... 22   6.      Client Commands ........................................  23   6.1.    Client Commands - Any State ............................  24   6.1.1.  CAPABILITY Command .....................................  24   6.1.2.  NOOP Command ...........................................  25   6.1.3.  LOGOUT Command .........................................  26Crispin                     Standards Track                     [Page 2]RFC 3501                         IMAPv4                       March 2003   6.2.    Client Commands - Not Authenticated State ..............  26   6.2.1.  STARTTLS Command .......................................  27   6.2.2.  AUTHENTICATE Command ...................................  28   6.2.3.  LOGIN Command ..........................................  30   6.3.    Client Commands - Authenticated State ..................  31   6.3.1.  SELECT Command .........................................  32   6.3.2.  EXAMINE Command ........................................  34   6.3.3.  CREATE Command .........................................  34   6.3.4.  DELETE Command .........................................  35   6.3.5.  RENAME Command .........................................  37   6.3.6.  SUBSCRIBE Command ......................................  39   6.3.7.  UNSUBSCRIBE Command ....................................  39   6.3.8.  LIST Command ...........................................  40   6.3.9.  LSUB Command ...........................................  43   6.3.10. STATUS Command .........................................  44   6.3.11. APPEND Command .........................................  46   6.4.    Client Commands - Selected State .......................  47   6.4.1.  CHECK Command ..........................................  47   6.4.2.  CLOSE Command ..........................................  48   6.4.3.  EXPUNGE Command ........................................  49   6.4.4.  SEARCH Command .........................................  49   6.4.5.  FETCH Command ..........................................  54   6.4.6.  STORE Command ..........................................  58   6.4.7.  COPY Command ...........................................  59   6.4.8.  UID Command ............................................  60   6.5.    Client Commands - Experimental/Expansion ...............  62   6.5.1.  X<atom> Command ........................................  62   7.      Server Responses .......................................  62   7.1.    Server Responses - Status Responses ....................  63   7.1.1.  OK Response ............................................  65   7.1.2.  NO Response ............................................  66   7.1.3.  BAD Response ...........................................  66   7.1.4.  PREAUTH Response .......................................  67   7.1.5.  BYE Response ...........................................  67   7.2.    Server Responses - Server and Mailbox Status ...........  68   7.2.1.  CAPABILITY Response ....................................  68   7.2.2.  LIST Response ..........................................  69   7.2.3.  LSUB Response ..........................................  70   7.2.4   STATUS Response ........................................  70   7.2.5.  SEARCH Response ........................................  71   7.2.6.  FLAGS Response .........................................  71   7.3.    Server Responses - Mailbox Size ........................  71   7.3.1.  EXISTS Response ........................................  71   7.3.2.  RECENT Response ........................................  72   7.4.    Server Responses - Message Status ......................  72   7.4.1.  EXPUNGE Response .......................................  72   7.4.2.  FETCH Response .........................................  73   7.5.    Server Responses - Command Continuation Request ........  79Crispin                     Standards Track                     [Page 3]RFC 3501                         IMAPv4                       March 2003   8.      Sample IMAP4rev1 connection ............................  80   9.      Formal Syntax ..........................................  81   10.     Author's Note ..........................................  92   11.     Security Considerations ................................  92   11.1.   STARTTLS Security Considerations .......................  92   11.2.   Other Security Considerations ..........................  93   12.     IANA Considerations ....................................  94   Appendices .....................................................  95   A.      References .............................................  95   B.      Changes from RFC 2060 ..................................  97   C.      Key Word Index ......................................... 103   Author's Address ............................................... 107   Full Copyright Statement ....................................... 108IMAP4rev1 Protocol Specification1.      How to Read This Document1.1.    Organization of This Document   This document is written from the point of view of the implementor of   an IMAP4rev1 client or server.  Beyond the protocol overview in   section 2, it is not optimized for someone trying to understand the   operation of the protocol.  The material in sections 3 through 5   provides the general context and definitions with which IMAP4rev1   operates.   Sections 6, 7, and 9 describe the IMAP commands, responses, and   syntax, respectively.  The relationships among these are such that it   is almost impossible to understand any of them separately.  In   particular, do not attempt to deduce command syntax from the command   section alone; instead refer to the Formal Syntax section.1.2.    Conventions Used in This Document   "Conventions" are basic principles or procedures.  Document   conventions are noted in this section.   In examples, "C:" and "S:" indicate lines sent by the client and   server respectively.   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",   "SHOULD", "SHOULD NOT", "MAY", and "OPTIONAL" in this document are to   be interpreted as described in [KEYWORDS].   The word "can" (not "may") is used to refer to a possible   circumstance or situation, as opposed to an optional facility of the   protocol.Crispin                     Standards Track                     [Page 4]RFC 3501                         IMAPv4                       March 2003   "User" is used to refer to a human user, whereas "client" refers to   the software being run by the user.   "Connection" refers to the entire sequence of client/server   interaction from the initial establishment of the network connection   until its termination.   "Session" refers to the sequence of client/server interaction from   the time that a mailbox is selected (SELECT or EXAMINE command) until   the time that selection ends (SELECT or EXAMINE of another mailbox,   CLOSE command, or connection termination).   Characters are 7-bit US-ASCII unless otherwise specified.  Other   character sets are indicated using a "CHARSET", as described in   [MIME-IMT] and defined in [CHARSET].  CHARSETs have important   additional semantics in addition to defining character set; refer to   these documents for more detail.   There are several protocol conventions in IMAP.  These refer to   aspects of the specification which are not strictly part of the IMAP   protocol, but reflect generally-accepted practice.  Implementations   need to be aware of these conventions, and avoid conflicts whether or   not they implement the convention.  For example, "&" may not be used   as a hierarchy delimiter since it conflicts with the Mailbox   International Naming Convention, and other uses of "&" in mailbox   names are impacted as well.1.3.    Special Notes to Implementors   Implementors of the IMAP protocol are strongly encouraged to read the   IMAP implementation recommendations document [IMAP-IMPLEMENTATION] in   conjunction with this document, to help understand the intricacies of   this protocol and how best to build an interoperable product.   IMAP4rev1 is designed to be upwards compatible from the [IMAP2] and   unpublished IMAP2bis protocols.  IMAP4rev1 is largely compatible with   the IMAP4 protocol described in RFC 1730; the exception being in   certain facilities added in RFC 1730 that proved problematic and were   subsequently removed.  In the course of the evolution of IMAP4rev1,   some aspects in the earlier protocols have become obsolete.  Obsolete   commands, responses, and data formats which an IMAP4rev1   implementation can encounter when used with an earlier implementation   are described in [IMAP-OBSOLETE].   Other compatibility issues with IMAP2bis, the most common variant of   the earlier protocol, are discussed in [IMAP-COMPAT].  A full   discussion of compatibility issues with rare (and presumed extinct)Crispin                     Standards Track                     [Page 5]RFC 3501                         IMAPv4                       March 2003   variants of [IMAP2] is in [IMAP-HISTORICAL]; this document is   primarily of historical interest.   IMAP was originally developed for the older [RFC-822] standard, and   as a consequence several fetch items in IMAP incorporate "RFC822" in   their name.  With the exception of RFC822.SIZE, there are more modern   replacements; for example, the modern version of RFC822.HEADER is   BODY.PEEK[HEADER].  In all cases, "RFC822" should be interpreted as a   reference to the updated [RFC-2822] standard.2.      Protocol Overview2.1.    Link Level   The IMAP4rev1 protocol assumes a reliable data stream such as that   provided by TCP.  When TCP is used, an IMAP4rev1 server listens on   port 143.2.2.    Commands and Responses   An IMAP4rev1 connection consists of the establishment of a   client/server network connection, an initial greeting from the   server, and client/server interactions.  These client/server   interactions consist of a client command, server data, and a server   completion result response.   All interactions transmitted by client and server are in the form of   lines, that is, strings that end with a CRLF.  The protocol receiver   of an IMAP4rev1 client or server is either reading a line, or is   reading a sequence of octets with a known count followed by a line.2.2.1.  Client Protocol Sender and Server Protocol Receiver

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -