Skip to main content

INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev2
draft-ietf-extra-imap4rev2-12

The information below is for an old version of the document.
Document Type
This is an older version of an Internet-Draft that was ultimately published as RFC 9051.
Authors Alexey Melnikov , Barry Leiba
Last updated 2020-02-12 (Latest revision 2019-12-03)
Replaces draft-melnikov-imap4rev2
RFC stream Internet Engineering Task Force (IETF)
Formats
Reviews
Additional resources Mailing list discussion
Stream WG state In WG Last Call
Associated WG milestone
Nov 2020
Submit "IMAP4rev2" to IESG as a Proposed Standard
Document shepherd Bron Gondwana
IESG IESG state Became RFC 9051 (Proposed Standard)
Consensus boilerplate Yes
Telechat date (None)
Responsible AD (None)
Send notices to Bron Gondwana <brong@fastmailteam.com>
draft-ietf-extra-imap4rev2-12
quot; command.

   Servers advertising both IMAP4rev1 and IMAP4rev2 SHOULD NOT generate
   UTF-8 quoted strings unless the client has issued "ENABLE IMAP4rev2".
   Consider implementation of mechanisms described or referenced in
   [IMAP-UTF-8] to achieve this goal.

   Servers advertising both IMAP4rev1 and IMAP4rev2, and clients
   intending to be compatible with IMAP4rev1 servers MUST be compatible
   with the international mailbox naming convention described in the
   following subsection.

Melnikov & Leiba         Expires August 15, 2020              [Page 147]
Internet-Draft                  IMAP4rev2                  February 2020

A.1.  Mailbox International Naming Convention for compatibility with
      IMAP4rev1

   Support for the Mailbox International Naming Convention described in
   this section is not required for IMAP4rev2-only clients and servers.

   By convention, international mailbox names in IMAP4rev1 are specified
   using a modified version of the UTF-7 encoding described in [UTF-7].
   Modified UTF-7 may also be usable in servers that implement an
   earlier version of this protocol.

   In modified UTF-7, printable US-ASCII characters, except for "&",
   represent themselves; that is, characters with octet values 0x20-0x25
   and 0x27-0x7e.  The character "&" (0x26) is represented by the two-
   octet sequence "&-".

   All other characters (octet values 0x00-0x1f and 0x7f-0xff) are
   represented in modified BASE64, with a further modification from
   [UTF-7] that "," is used instead of "/".  Modified BASE64 MUST NOT be
   used to represent any printing US-ASCII character which can represent
   itself.  Only characters inside the modified BASE64 alphabet are
   permitted in modified BASE64 text.

   "&" is used to shift to modified BASE64 and "-" to shift back to US-
   ASCII.  There is no implicit shift from BASE64 to US-ASCII, and null
   shifts ("-&" while in BASE64; note that "&-" while in US-ASCII means
   "&") are not permitted.  However, all names start in US-ASCII, and
   MUST end in US-ASCII; that is, a name that ends with a non-ASCII
   ISO-10646 character MUST end with a "-").

   The purpose of these modifications is to correct the following
   problems with UTF-7:

   1.  UTF-7 uses the "+" character for shifting; this conflicts with
       the common use of "+" in mailbox names, in particular USENET
       newsgroup names.

   2.  UTF-7's encoding is BASE64 which uses the "/" character; this
       conflicts with the use of "/" as a popular hierarchy delimiter.

   3.  UTF-7 prohibits the unencoded usage of "\"; this conflicts with
       the use of "\" as a popular hierarchy delimiter.

   4.  UTF-7 prohibits the unencoded usage of "~"; this conflicts with
       the use of "~" in some servers as a home directory indicator.

Melnikov & Leiba         Expires August 15, 2020              [Page 148]
Internet-Draft                  IMAP4rev2                  February 2020

   5.  UTF-7 permits multiple alternate forms to represent the same
       string; in particular, printable US-ASCII characters can be
       represented in encoded form.

   Although modified UTF-7 is a convention, it establishes certain
   requirements on server handling of any mailbox name with an embedded
   "&" character.  In particular, server implementations MUST preserve
   the exact form of the modified BASE64 portion of a modified UTF-7
   name and treat that text as case-sensitive, even if names are
   otherwise case-insensitive or case-folded.

   Server implementations SHOULD verify that any mailbox name with an
   embedded "&" character, used as an argument to CREATE, is: in the
   correctly modified UTF-7 syntax, has no superfluous shifts, and has
   no encoding in modified BASE64 of any printing US-ASCII character
   which can represent itself.  However, client implementations MUST NOT
   depend upon the server doing this, and SHOULD NOT attempt to create a
   mailbox name with an embedded "&" character unless it complies with
   the modified UTF-7 syntax.

   Server implementations which export a mail store that does not follow
   the modified UTF-7 convention MUST convert to modified UTF-7 any
   mailbox name that contains either non-ASCII characters or the "&"
   character.

      For example, here is a mailbox name which mixes English, Chinese,
      and Japanese text: ~peter/mail/&U,BTFw-/&ZeVnLIqe-

      For example, the string "&Jjo!" is not a valid mailbox name
      because it does not contain a shift to US-ASCII before the "!".
      The correct form is "&Jjo-!".  The string "&U,BTFw-&ZeVnLIqe-" is
      not permitted because it contains a superfluous shift.  The
      correct form is "&U,BTF2XlZyyKng-".

Appendix B.  Backward compatibility with BINARY extension

   IMAP4rev2 is incorporates subset of functionality provided by the
   BINARY extension [RFC3516], in particular it includes additional
   FETCH items (BINARY, BINARY.PEEK and BINARY.SIZE), but not extensions
   to the APPEND command.  IMAP4rev2 implementations that supports full
   RFC 3516 functionality need to also advertise the BINARY token in the
   CAPABILITY response.

Appendix C.  Changes from RFC 3501 / IMAP4rev1

   The following is the plan for remaining changes.  The plan might
   change over time.

Melnikov & Leiba         Expires August 15, 2020              [Page 149]
Internet-Draft                  IMAP4rev2                  February 2020

   1.   Fold in the following extensions/RFC: RFC 5530 (IMAP Response
        Codes, done), UIDPLUS (done), ENABLE (done), ESEARCH (done),
        SPECIAL-USE (list of new mailbox attributes is done), LITERAL-
        (done), NAMESPACE (done), SASL-IR (done), IDLE (done), MOVE
        (done).

   2.   Add CLOSED response code (from CONDSTORE) - done

   3.   Add support for $MDNSent and $Forwarded IMAP keywords - done.
        Add more examples showing their use?  Also add other keywords
        like $Phishing, $Junk, $NonJunk?

   4.   Require all unsolicited FETCH updates to include UID - done.

   5.   Update recommendations on TLS ciphers to match UTA WG work (as
        per RFC 8314, RFC 7525 and RFC 7817) - done.

   6.   Possibly fold in the following extensions/RFC: Base LIST-
        EXTENDED syntax plus deprecate LSUB (replace it with LIST
        \Subscribed) minus the requirement to support multiple list
        patterns - done, STATUS-in-LIST - done, SEARCHRES, BINARY (only
        the FETCH changes on leaf body part and make APPEND related ones
        optional.  See the mailing list discussion) - done.

   7.   Add STATUS SIZE (total mailbox size) - done.  Add STATUS DELETED
        (number of messages with \Deleted flag set) - done.

   8.   Drop UTF-7, all mailboxes are always in UTF-8 - done.

   9.   Revise IANA registration of IMAP extensions and give advice on
        use of "X-" convention.

   10.  Allow word-based searching (as per Chris Newman)?  Need to
        discuss header field search, where exact/substring match is
        still required for interoperability.

   The following changes since RFC 3501 were done so far:

   1.   Folded in IMAP UNSELECT (RFC 3691), UIDPLUS (RFC 4315), ESEARCH
        (RFC 4731), ENABLE (RFC 5161), IDLE (RFC 2177), SASL-IR (RFC
        4959), LIST-STATUS (RFC 5819) and MOVE (RFC 6851) extensions.
        Also folded RFC 5530 and FETCH side of the BINARY extension (RFC
        3516).

   2.   Clarified that server should decode parameter value
        continuations as described in [RFC2231].  This requirement was
        hidden in RFC 2231 itself.

Melnikov & Leiba         Expires August 15, 2020              [Page 150]
Internet-Draft                  IMAP4rev2                  February 2020

   3.   SEARCH command now requires to return ESEARCH response (SEARCH
        response is now deprecated).

   4.   Added CLOSED response code from RFC 7162.  SELECT/EXAMINE when a
        mailbox is already selected now require for the CLOSED response
        code to be returned.

   5.   Updated to use modern TLS-related recommendations as per RFC
        8314, RFC 7817, RFC 7525.

   6.   For future extensibility extended ABNF for tagged-ext-simple to
        allow for bare number64.

   7.   Added SHOULD level requirement on IMAP servers to support
        $MDNSent and $Forwarded keywords.

   8.   Added STATUS SIZE and STATUS DELETED.

   9.   Mailbox names and message headers now allow for UTF-8.  Support
        for Modified UTF-7 in mailbox names is not required, unless
        compatibility with IMAP4rev1 is desired.

   10.  UNSEEN response code on SELECT/EXAMINE is now deprecated.

   11.  RECENT response on SELECT/EXAMINE, \Recent flag, RECENT STATUS,
        SEARCH NEW items are now deprecated.

   12.  Clarified that the server doesn't need to send a new
        PERMANENTFLAGS response code when a new keyword was successfully
        added and the server advertised \* earlier for the same mailbox.

   13.  Removed the CHECK command.  Clients should use NOOP instead.

   14.  RFC822, RFC822.HEADER and RFC822.TEXT FETCH data items were
        deprecated.  Clients should use the corresponding BODY[]
        variants instead.

   15.  Replaced DIGEST-MD5 SASL mechanism with SCRAM-SHA-256.  DIGEST-
        MD5 was deprecated.

   16.  LSUB command was deprecated.  Clients should use LIST
        (SUBSCRIBED) instead.

   17.  resp-text ABNF non terminal was updated to allow for empty text.

   18.  IDLE command can now return updates not related to the currently
        selected mailbox state.

Melnikov & Leiba         Expires August 15, 2020              [Page 151]
Internet-Draft                  IMAP4rev2                  February 2020

Appendix D.  Acknowledgement

   Earlier versions of this document were edited by Mark Crispin.
   Sadly, he is no longer available to help with this work.  Editors of
   this revisions are hoping that Mark would have approved.

   Chris Newman has contributed text on I18N and use of UTF-8 in
   messages and mailbox names.

   Thank you to Tony Hansen for helping with the index generation.
   Thank you to Timo Sirainen, Bron Gondwana and Arnt Gulbrandsen for
   extensive feedback.

   This document incorporate text from RFC 4315 (by Mark Crispin), RFC
   4466 (by Cyrus Daboo), RFC 4731 (by Dave Cridland), RFC 5161 (by Arnt
   Gulbrandsen), RFC 5530 (by Arnt Gulbrandsen), RFC 5819 (by Timo
   Sirainen), RFC 6154 (by Jamie Nicolson) so work done by authors/
   editors of these documents is appreciated.  Note that editors of this
   document were redacted from the above list.

Index

   $
      $Forwarded (predefined flag)  12
      $MDNSent (predefined flag)  12

   +
      +FLAGS <flag list>  90
      +FLAGS.SILENT <flag list>  90

   -
      -FLAGS <flag list>  90
      -FLAGS.SILENT <flag list>  90

   A
      ALERT (response code)  97
      ALL (fetch item)  86
      ALL (search key)  76
      ALL (search result option)  74
      ALREADYEXISTS (response code)  97
      ANSWERED (search key)  76
      APPEND (command)  66
      APPENDUID (response code)  97
      AUTHENTICATE (command)  28
      AUTHENTICATIONFAILED (response code)  98
      AUTHORIZATIONFAILED (response code)  98

   B

Melnikov & Leiba         Expires August 15, 2020              [Page 152]
Internet-Draft                  IMAP4rev2                  February 2020

      BAD (response)  106
      BADCHARSET (response code)  99
      BCC <string> (search key)  76
      BEFORE <date> (search key)  76
      BINARY.PEEK[<section-binary>]<<partial>> (fetch item)  86
      BINARY.SIZE[<section-binary>] (fetch item)  86
      BINARY.SIZE[<section-binary>] (fetch result)  116
      BINARY[<section-binary>]<<number>> (fetch result)  115
      BINARY[<section-binary>]<<partial>> (fetch item)  86
      BODY (fetch item)  87
      BODY (fetch result)  116
      BODY <string> (search key)  76
      BODY.PEEK[<section>]<<partial>> (fetch item)  89
      BODYSTRUCTURE (fetch item)  89
      BODYSTRUCTURE (fetch result)  117
      BODY[<section>]<<origin octet>> (fetch result)  116
      BODY[<section>]<<partial>> (fetch item)  87
      BYE (response)  106
      Body Structure (message attribute)  13

   C
      CANNOT (response code)  99
      CAPABILITY (command)  24
      CAPABILITY (response code)  99
      CAPABILITY (response)  107
      CC <string> (search key)  76
      CLIENTBUG (response code)  99
      CLOSE (command)  71
      CLOSED (response code)  99
      CONTACTADMIN (response code)  100
      COPY (command)  90
      COPYUID (response code)  100
      CORRUPTION (response code)  100
      COUNT (search result option)  74
      CREATE (command)  37

   D
      DELETE (command)  38
      DELETED (search key)  76
      DELETED (status item)  66
      DRAFT (search key)  76

   E
      ENABLE (command)  32
      ENVELOPE (fetch item)  89
      ENVELOPE (fetch result)  119
      ESEARCH (response)  113
      EXAMINE (command)  36

Melnikov & Leiba         Expires August 15, 2020              [Page 153]
Internet-Draft                  IMAP4rev2                  February 2020

      EXPIRED (response code)  101
      EXPUNGE (command)  72
      EXPUNGE (response)  114
      EXPUNGEISSUED (response code)  101
      Envelope Structure (message attribute)  13

   F
      FAST (fetch item)  86
      FETCH (command)  85
      FETCH (response)  115
      FLAGGED (search key)  76
      FLAGS (fetch item)  89
      FLAGS (fetch result)  120
      FLAGS (response)  113
      FLAGS <flag list> (store command data item)  90
      FLAGS.SILENT <flag list> (store command data item)  90
      FROM <string> (search key)  76
      FULL (fetch item)  86
      Flags (message attribute)  11

   H
      HEADER (part specifier)  87
      HEADER <field-name> <string> (search key)  76
      HEADER.FIELDS (part specifier)  87
      HEADER.FIELDS.NOT (part specifier)  87

   I
      IDLE (command)  69
      INTERNALDATE (fetch item)  89
      INTERNALDATE (fetch result)  120
      INUSE (response code)  101
      Internal Date (message attribute)  12

   K
      KEYWORD <flag> (search key)  77
      Keyword (type of flag)  12

   L
      LARGER <n> (search key)  77
      LIMIT (response code)  101
      LIST (command)  42
      LIST (response)  108
      LOGOUT (command)  26

   M
      MAX (search result option)  74
      MAY (specification requirement term)  5
      MESSAGES (status item)  66

Melnikov & Leiba         Expires August 15, 2020              [Page 154]
Internet-Draft                  IMAP4rev2                  February 2020

      MIME (part specifier)  88
      MIN (search result option)  74
      MOVE (command)  91
      MUST (specification requirement term)  5
      MUST NOT (specification requirement term)  5
      Message Sequence Number (message attribute)  11

   N
      NAMESPACE (command)  60
      NAMESPACE (response)  112
      NO (response)  105
      NONEXISTENT (response code)  102
      NOOP (command)  25
      NOPERM (response code)  102
      NOT <search-key> (search key)  77
      NOT RECOMMENDED (specification requirement term)  5

   O
      OK (response)  105
      ON <date> (search key)  77
      OPTIONAL (specification requirement term)  5
      OR <search-key1> <search-key2> (search key)  77
      OVERQUOTA (response code)  102

   P
      PARSE (response code)  102
      PERMANENTFLAGS (response code)  102
      PREAUTH (response)  106
      PRIVACYREQUIRED (response code)  103
      Permanent Flag (class of flag)  12
      Predefined keywords  12

   R
      READ-ONLY (response code)  103
      READ-WRITE (response code)  103
      RECOMMENDED (specification requirement term)  5
      RENAME (command)  39
      REQUIRED (specification requirement term)  5
      RFC822.SIZE (fetch item)  89
      RFC822.SIZE (fetch result)  121

   S
      SAVE (search result option)  74
      SEARCH (command)  73
      SEEN (search key)  77
      SELECT (command)  34
      SENTBEFORE <date> (search key)  77
      SENTON <date> (search key)  77

Melnikov & Leiba         Expires August 15, 2020              [Page 155]
Internet-Draft                  IMAP4rev2                  February 2020

      SENTSINCE <date> (search key)  77
      SERVERBUG (response code)  103
      SHOULD (specification requirement term)  5
      SHOULD NOT (specification requirement term)  5
      SINCE <date> (search key)  77
      SIZE (status item)  66
      SMALLER <n> (search key)  77
      STARTTLS (command)  27
      STATUS (command)  65
      STATUS (response)  112
      STORE (command)  89
      SUBJECT <string> (search key)  77
      SUBSCRIBE (command)  41
      Session Flag (class of flag)  12
      System Flag (type of flag)  11

   T
      TEXT (part specifier)  87
      TEXT <string> (search key)  77
      TO <string> (search key)  77
      TRYCREATE (response code)  103

   U
      UID (command)  93
      UID (fetch item)  89
      UID (fetch result)  121
      UID <sequence set> (search key)  78
      UIDNEXT (response code)  104
      UIDNEXT (status item)  66
      UIDNOTSTICKY (response code)  104
      UIDVALIDITY (response code)  104
      UIDVALIDITY (status item)  66
      UNANSWERED (search key)  78
      UNAVAILABLE (response code)  104
      UNDELETED (search key)  78
      UNDRAFT (search key)  78
      UNFLAGGED (search key)  78
      UNKEYWORD <flag> (search key)  78
      UNKNOWN-CTE (response code)  104
      UNSEEN (search key)  78
      UNSEEN (status item)  66
      UNSELECT (command)  72
      UNSUBSCRIBE (command)  42
      Unique Identifier (UID) (message attribute)  9

   X
      X<atom> (command)  95

Melnikov & Leiba         Expires August 15, 2020              [Page 156]
Internet-Draft                  IMAP4rev2                  February 2020

   [
      [RFC-5322] Size (message attribute)  13

   \
      \All (mailbox name attribute)  110
      \Answered (system flag)  11
      \Archive (mailbox name attribute)  110
      \Deleted (system flag)  11
      \Draft (system flag)  12
      \Drafts (mailbox name attribute)  110
      \Flagged (mailbox name attribute)  111
      \Flagged (system flag)  11
      \HasChildren (mailbox name attribute)  109
      \HasNoChildren (mailbox name attribute)  109
      \Junk (mailbox name attribute)  111
      \Marked (mailbox name attribute)  110
      \Noinferiors (mailbox name attribute)  109
      \NonExistent (mailbox name attribute)  109
      \Noselect (mailbox name attribute)  109
      \Recent (system flag)  12
      \Remote (mailbox name attribute)  110
      \Seen (system flag)  11
      \Sent (mailbox name attribute)  111
      \Subscribed (mailbox name attribute)  110
      \Trash (mailbox name attribute)  111
      \Unmarked (mailbox name attribute)  110

Authors' Addresses

   Alexey Melnikov (editor)
   Isode Ltd
   14 Castle Mews
   Hampton, Middlesex  TW12 2NP
   UK

   Email: Alexey.Melnikov@isode.com

   Barry Leiba (editor)
   Huawei Technologies

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

Melnikov & Leiba         Expires August 15, 2020              [Page 157]