<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.6.17 (Ruby 3.0.2) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-ietf-extra-jmapaccess-00" category="std" consensus="true" submissionType="IETF" xml:lang="en" version="3">
  <!-- xml2rfc v2v3 conversion 3.15.3 -->
  <front>
    <title abbrev="IMAP JMAPACCESS">The JMAPACCESS Extension for IMAP</title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-extra-jmapaccess-00"/>
    <author initials="A." surname="Gulbrandsen" fullname="Arnt Gulbrandsen">
      <organization>ICANN</organization>
      <address>
        <postal>
          <street>6 Rond Point Schumann, Bd. 1</street>
          <city>Brussels</city>
          <code>1040</code>
          <country>BE</country>
        </postal>
        <email>arnt@gulbrandsen.priv.no</email>
      </address>
    </author>
    <date year="2023" month="January" day="03"/>
    <area>Applications</area>
    <workgroup>EXTRA</workgroup>
    <keyword>IMAP</keyword>
    <keyword>JMAP</keyword>
    <abstract>
      <t>This document defines an IMAP extension to let clients know that the
messages in this IMAP server are also available via JMAP, and how. It is
intended for clients that want to migrate gradually to JMAP.</t>
    </abstract>
  </front>
  <middle>
    <section anchor="introduction">
      <name>Introduction</name>
      <t>A few IMAP client maintainers have asked for ways to use features that
are available in JMAP without having to drop their expensively tested
IMAP code.</t>
      <t>This document provides a server with a way to declare that the
messages in its mailstore are also available via JMAP. For simplicity,
only a complete equivalence is supported (the same set of messages are
available via both IMAP and JMAP).</t>
    </section>
    <section anchor="requirements-language">
      <name>Requirements Language</name>
      <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>
    </section>
    <section anchor="details">
      <name>Details</name>
      <t>By advertising the JMAPACCESS capability, the server asserts that if a
message has a particular object ID when accessed via either IMAP or
JMAP (see <xref target="RFC9051"/> and <xref target="RFC8620"/> respectively), then the same
message is accessible via the other protocol, and it has the same ID.</t>
      <t>The server <bcp14>MUST</bcp14> also advertise the OBJECTID extension, defined by
<xref target="RFC8474"/>. The JMAP session resource that allows access to the same
messages is called "the JMAP server" below.</t>
      <t>This specification does not affect message lifetime: If a client
accesses a message via IMAP and half a second later via JMAP, then the
message may have been deleted.</t>
      <t>The client requests the URL of the JMAP server by issuing ENABLE
JMAPACCESS while in authenticated or selected state.</t>
      <t>When the server issues ENABLED JMAPACCESS, the server considers the
way the client authenticated. If the same authentication would work
with the JMAP server, then the server <bcp14>MUST</bcp14> also send an untagged OK
response with a JMAPACCESS response code containing a link to the JMAP
server.</t>
      <t>If the authentication would not succeed with the JMAP server, then the
server <bcp14>SHOULD</bcp14> send an untagged OK response with human-readable text to
help client developers understand why this authentication would not
work with the JMAP server. In this case, the human-readable text <bcp14>MUST
NOT</bcp14> contain any personal data, or other data that cannot be forwarded
to the client developers.</t>
      <t>Servers are encouraged to report the same message flags and other data
via both protocols, as far as possible.</t>
      <t>Note that all JMAP servers support internationalized email addresses
(see <xref target="RFC6530"/>).  If this IMAP server does not, or the IMAP client
does not issue ENABLE UTF8=ACCEPT (see <xref target="RFC6855"/>), then there is a
possibility that the client receives accurate address fields via JMAP
and downgraded fields via IMAP (see (see <xref target="RFC6857"/> and <xref target="RFC6858"/>
for examples).</t>
      <t>Open issue: What about MAILBOXID?</t>
    </section>
    <section anchor="the-jmapaccess-response-code">
      <name>The JMAPACCESS Response Code</name>
      <t>The JMAPACCESS response code is followed by a single link to a JMAP
session resource. The server/mailstore at that location is referenced
as "the JMAP server" in this document.</t>
      <t>The formal syntax in <xref target="RFC9051"/> is extended thus:</t>
      <t>resp-code-jmap = "JMAPACCESS" SP string</t>
      <t>resp-text-code =/ resp-code-jmap</t>
      <t>Open issue: This means that the link cannot contain a "]" character.
This seems like a nonissue in practice but difficult as a matter of
protocol hygiene.</t>
    </section>
    <section anchor="IANA">
      <name>IANA Considerations</name>
      <t>The IANA is requested to add the JMAPACCESS response code to the IMAP
Response Codes registry.</t>
    </section>
    <section anchor="Security">
      <name>Security Considerations</name>
      <t>This extension reveals to clients why they cannot auhenticate to the
JMAP server. One normally does not want to reveal anything about why a
client cannot authenticate, for fear of giving useful information to
an intruder.</t>
      <t>However, in this case the client has already authenticated via
IMAP. By doing so the client already gained access to all of the same
mail. The authors believe that the debugging value of the OK response
far outweighs its security concerns.</t>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <reference anchor="RFC8474" target="https://www.rfc-editor.org/info/rfc8474">
          <front>
            <title>IMAP Extension for Object Identifiers</title>
            <author fullname="B. Gondwana" initials="B." role="editor" surname="Gondwana">
              <organization/>
            </author>
            <date month="September" year="2018"/>
            <abstract>
              <t>This document updates RFC 3501 (IMAP4rev1) with persistent identifiers on mailboxes and messages to allow clients to more efficiently reuse cached data when resources have changed location on the server.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8474"/>
          <seriesInfo name="DOI" value="10.17487/RFC8474"/>
        </reference>
        <reference anchor="RFC9051" target="https://www.rfc-editor.org/info/rfc9051">
          <front>
            <title>Internet Message Access Protocol (IMAP) - Version 4rev2</title>
            <author fullname="A. Melnikov" initials="A." role="editor" surname="Melnikov">
              <organization/>
            </author>
            <author fullname="B. Leiba" initials="B." role="editor" surname="Leiba">
              <organization/>
            </author>
            <date month="August" year="2021"/>
            <abstract>
              <t>The Internet Message Access Protocol Version 4rev2 (IMAP4rev2) allows a client to access and manipulate electronic mail messages on a server.  IMAP4rev2 permits manipulation of mailboxes (remote message folders) in a way that is functionally equivalent to local folders.  IMAP4rev2 also provides the capability for an offline client to resynchronize with the server. </t>
              <t>IMAP4rev2 includes operations for creating, deleting, and renaming mailboxes; checking for new messages; removing messages permanently; setting and clearing flags; parsing per RFCs 5322, 2045, and 2231; searching; and selective fetching of message attributes, texts, and portions thereof.  Messages in IMAP4rev2 are accessed by the use of numbers. These numbers are either message sequence numbers or unique identifiers. </t>
              <t>IMAP4rev2 does not specify a means of posting mail; this function is handled by a mail submission protocol such as the one specified in RFC 6409.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9051"/>
          <seriesInfo name="DOI" value="10.17487/RFC9051"/>
        </reference>
        <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author fullname="S. Bradner" initials="S." surname="Bradner">
              <organization/>
            </author>
            <date month="March" year="1997"/>
            <abstract>
              <t>In many standards track documents several words are used to signify the requirements in the specification.  These words are often capitalized. This document defines these words as they should be interpreted in IETF documents.  This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>
        <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author fullname="B. Leiba" initials="B." surname="Leiba">
              <organization/>
            </author>
            <date month="May" year="2017"/>
            <abstract>
              <t>RFC 2119 specifies common key words that may be used in protocol  specifications.  This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the  defined special meanings.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
        </reference>
      </references>
      <references>
        <name>Informative References</name>
        <reference anchor="RFC6530" target="https://www.rfc-editor.org/info/rfc6530">
          <front>
            <title>Overview and Framework for Internationalized Email</title>
            <author fullname="J. Klensin" initials="J." surname="Klensin">
              <organization/>
            </author>
            <author fullname="Y. Ko" initials="Y." surname="Ko">
              <organization/>
            </author>
            <date month="February" year="2012"/>
            <abstract>
              <t>Full use of electronic mail throughout the world requires that (subject to other constraints) people be able to use close variations on their own names (written correctly in their own languages and scripts) as mailbox names in email addresses.  This document introduces a series of specifications that define mechanisms and protocol extensions needed to fully support internationalized email addresses.  These changes include an SMTP extension and extension of email header syntax to accommodate UTF-8 data.  The document set also includes discussion of key assumptions and issues in deploying fully internationalized email.  This document is a replacement for RFC 4952; it reflects additional issues identified since that document was published.  [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="6530"/>
          <seriesInfo name="DOI" value="10.17487/RFC6530"/>
        </reference>
        <reference anchor="RFC6855" target="https://www.rfc-editor.org/info/rfc6855">
          <front>
            <title>IMAP Support for UTF-8</title>
            <author fullname="P. Resnick" initials="P." role="editor" surname="Resnick">
              <organization/>
            </author>
            <author fullname="C. Newman" initials="C." role="editor" surname="Newman">
              <organization/>
            </author>
            <author fullname="S. Shen" initials="S." role="editor" surname="Shen">
              <organization/>
            </author>
            <date month="March" year="2013"/>
            <abstract>
              <t>This specification extends the Internet Message Access Protocol (IMAP) to support UTF-8 encoded international characters in user names, mail addresses, and message headers. This specification replaces RFC 5738.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="6855"/>
          <seriesInfo name="DOI" value="10.17487/RFC6855"/>
        </reference>
        <reference anchor="RFC6857" target="https://www.rfc-editor.org/info/rfc6857">
          <front>
            <title>Post-Delivery Message Downgrading for Internationalized Email Messages</title>
            <author fullname="K. Fujiwara" initials="K." surname="Fujiwara">
              <organization/>
            </author>
            <date month="March" year="2013"/>
            <abstract>
              <t>The Email Address Internationalization (SMTPUTF8) extension to SMTP allows Unicode characters encoded in UTF-8 and outside the ASCII repertoire in mail header fields.  Upgraded POP and IMAP servers support internationalized messages.  If a POP or IMAP client does not support Email Address Internationalization, a POP or IMAP server cannot deliver internationalized messages to the client and cannot remove the message.  To avoid that situation, this document describes a mechanism for converting internationalized messages into the traditional message format.  As part of the conversion process, message elements that require internationalized treatment are recoded or removed, and receivers are able to recognize that they received messages containing such elements, even if they cannot process the internationalized elements.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="6857"/>
          <seriesInfo name="DOI" value="10.17487/RFC6857"/>
        </reference>
        <reference anchor="RFC6858" target="https://www.rfc-editor.org/info/rfc6858">
          <front>
            <title>Simplified POP and IMAP Downgrading for Internationalized Email</title>
            <author fullname="A. Gulbrandsen" initials="A." surname="Gulbrandsen">
              <organization/>
            </author>
            <date month="March" year="2013"/>
            <abstract>
              <t>This document specifies a method for IMAP and POP servers to serve internationalized messages to conventional clients.  The specification is simple, easy to implement, and provides only rudimentary results.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="6858"/>
          <seriesInfo name="DOI" value="10.17487/RFC6858"/>
        </reference>
        <reference anchor="RFC8620" target="https://www.rfc-editor.org/info/rfc8620">
          <front>
            <title>The JSON Meta Application Protocol (JMAP)</title>
            <author fullname="N. Jenkins" initials="N." surname="Jenkins">
              <organization/>
            </author>
            <author fullname="C. Newman" initials="C." surname="Newman">
              <organization/>
            </author>
            <date month="July" year="2019"/>
            <abstract>
              <t>This document specifies a protocol for clients to efficiently query, fetch, and modify JSON-based data objects, with support for push notification of changes and fast resynchronisation and for out-of- band binary data upload/download.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8620"/>
          <seriesInfo name="DOI" value="10.17487/RFC8620"/>
        </reference>
      </references>
    </references>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA31Y23IbuRF9x1d0uC/rlMiVvLIts+IklETHd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