<?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" ?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-eggert-mailmaint-uaautoconf-01" category="info" submissionType="IETF" xml:lang="en" version="3">
    <!-- xml2rfc v2v3 conversion 3.28.0 -->
    <front>
        <title abbrev="Auto-Config of Email Server Settings">Automatic Configuration of Email, Calendar, and Contact Server Settings</title>
        <seriesInfo name="Internet-Draft" value="draft-eggert-mailmaint-uaautoconf-01"/>
        <author fullname="Daniel Eggert" initials="D." surname="Eggert">
            <organization>Apple Inc</organization>
            <address>
                <postal>
                    <street>One Apple Park Way</street>
                    <city>Cupertino</city>
                    <code>CA 95014</code>
                    <country>USA</country>
                </postal>
                <email>deggert@apple.com</email>
                <uri>https://www.apple.com</uri>
            </address>
        </author>
        <author fullname="Matt Diephouse" initials="M." surname="Diephouse">
            <organization>Apple Inc</organization>
            <address>
                <postal>
                    <street>One Apple Park Way</street>
                    <city>Cupertino</city>
                    <code>CA 95014</code>
                    <country>USA</country>
                </postal>
                <email>diephouse@apple.com</email>
                <uri>https://www.apple.com</uri>
            </address>
        </author>
        <date year="2025" month="9" day="1"/>
        <area>ART</area>
        <workgroup>mailmaint</workgroup>
        <keyword>configuration</keyword>
        <keyword>autoconfig</keyword>
        <keyword>autodiscover</keyword>
        <keyword>mail</keyword>
        <keyword>email</keyword>
        <keyword>calendar</keyword>
        <keyword>contacts</keyword>
        <keyword>IMAP</keyword>
        <keyword>CalDAV</keyword>
        <keyword>CardDAV</keyword>
        <keyword>SMTP</keyword>
        <keyword>JMAP</keyword>
        <keyword>OAuth2</keyword>
        <abstract>
            <t>This document specifies an automatic configuration mechanism for email, calendar, and contact user agent applications. Service providers publish standardized configuration information that user agent applications retrieve and use to simplify server setup procedures.</t>
        </abstract>
    </front>
    <middle>
        <section anchor="introduction">
            <name>Introduction</name>
            <t>Manual configuration of email, calendar, and contact user agent applications requires users to correctly specify numerous technical parameters including server hostnames, port numbers, and authentication protocols. This manual process frequently results in configuration errors and setup failures, even among technically skilled users.</t>
            <t>This document defines a mechanism that significantly simplifies this configuration process. Service providers can publish standardized configuration data that user agents can automatically retrieve and use. In most cases, users need only provide their email address and account password to complete the setup.</t>
            <t>For service providers that support the OAuth Profile for Open Public Clients <xref target="I-D.ietf-mailmaint-oauth-public"/>, this mechanism also enables automatic OAuth configuration. The user agent automatically determines all necessary details to set up OAuth authentication for the associated account.</t>
        </section>
        <section>
          <name>Document Conventions</name>
          <t>In protocol examples, this document uses a prefix of "C: " to denote lines sent by the user agent to the server, and "S: " for lines sent by the server to the user agent.  Lines prefixed with "// " are comments explaining the previous protocol line.  These prefixes and comments are not part of the protocol.  Lines without any of these prefixes are continuations of the previous line, and no line break is present in the protocol unless specifically mentioned.</t>
          <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="flow-overview">
            <name>Overview</name>
            <t>The automatic configuration process begins when a user wants to set up their user agent application. The user agent requests the user's email address and then uses the domain portion of that address to retrieve configuration data for the account.</t>
            <t>Configuration retrieval uses the Well-Known URIs mechanism defined in <xref target="RFC8615"/>. The specific suffix for this configuration is <tt>user-agent-configuration</tt>. <xref target="flow-configuration-source"/> provides detailed information about how to retrieve this configuration.</t>
            <t>The configuration is provided as a JSON document (detailed in <xref target="json-configuration"/>) that informs the user agent about:</t>
            <ul>
                <li>Human-readable information about the service provider</li>
                <li>Supported protocols for this domain</li>
                <li>Server endpoints for each protocol</li>
                <li>OAuth Profile for Open Public Clients support availability</li>
            </ul>
            <t>The user agent uses this configuration to determine whether the provider supports protocols that the user agent can also use, helping decide whether to continue with the setup process. For example, an email user agent might check for support of JMAP, IMAP, POP3, and SMTP protocols.</t>
            <t>Next, the user agent typically connects to the relevant services to verify which authentication methods they support and whether the user agent can use those methods. For instance, if the user agent needs both IMAP and SMTP, it will connect to both servers to check their capabilities and confirm compatibility with the user agent's supported authentication mechanisms.</t>
            <t>Based on the available options, the user agent then proceeds with one of two approaches:</t>
            <ol>
                <li>Continue configuration using OAuth Profile for Open Public Clients, or</li>
                <li>Request the user's password for traditional authentication</li>
            </ol>
            <t>Finally, the user agent uses the obtained credentials (OAuth tokens or password) to connect to the servers specified in the configuration document and validates that the credentials work correctly with the desired protocols.</t>
        </section>
        <section anchor="json-configuration">
            <name>JSON Configuration</name>
            <t>The configuration document describes which services are available and their corresponding endpoints for a specific domain.</t>
            <t>The configuration file <bcp14>MUST</bcp14> conform to the JSON schema specification provided in <xref target="configuration-schema"/>.</t>
            <t>The configuration uses the media type <tt>application/json</tt>. The HTTP server <bcp14>MUST</bcp14> set the corresponding <tt>Content-Type</tt> header as specified in <xref target="RFC9110"/>.</t>
            <section anchor="json-configuration-example">
                <name>Example</name>
                <t>The following example demonstrates a typical JSON configuration:</t>
<sourcecode type="json" name="example-configuration.json"><![CDATA[
{
    "protocols": {
        "jmap": {
            "url": "https://jmap.example.com/session"
        },
        "imap": {
            "host": "imap.example.com"
        },
        "pop3": {
            "host": "pop3.example.com"
        },
        "smtp": {
            "host": "smtp.example.com"
        },
        "caldav": {
            "url": "https://sync.example.com/calendar/"
        },
        "carddav": {
            "url": "https://sync.example.com/contacts/"
        }
    },
    "authentication": {
        "oauth-public": {
            "issuer": "auth.example.com"
        },
        "password": true
    },
    "info": {
        "provider": {
            "name": "Example Provider Name",
            "shortName": "Example",
            "logo": [
                {
                    "url": "https://www.example.net/logo.svg",
                    "content-type": "image/svg+xml"
                }
            ]
        },
        "help": {
            "documentation": "https://help.example.net/howto/set-up-your-mail-app.html",
            "developer": "https://developer.example.net/client-apps/",
            "contact": ["mailto:it@team.example.net"]
        }
    }
}
]]></sourcecode>
            </section>
            <section anchor="json-config-protocols">
                <name>Protocols</name>
                <t>The <tt>protocols</tt> object specifies all protocols that the domain supports and identifies the server endpoint for each protocol.</t>
                <t>For the following HTTP-based protocols:</t>
                <ul>
                    <li>JMAP defined in <xref target="RFC8620"/>,</li>
                    <li>CalDAV defined in <xref target="RFC4791"/>, and</li>
                    <li>CardDAV defined in <xref target="RFC6352"/></li>
                    <li>WebDAV defined in <xref target="RFC4918"/></li>
                </ul>
                <t>each protocol entry <bcp14>MUST</bcp14> include a <tt>url</tt> value containing a URL with the <tt>https</tt> scheme. This URL <bcp14>MUST</bcp14> specify an endpoint that serves the corresponding protocol. The server <bcp14>MUST</bcp14> use the default port 443 for HTTPS, and the URL <bcp14>MUST NOT</bcp14> include an explicit port number.</t>
                <t>Hostnames in URLs <bcp14>MUST</bcp14> support Internationalized Domain Names (IDNs) as defined in <xref target="RFC5890"/> and <xref target="RFC5891"/>. Service providers <bcp14>MAY</bcp14> use either Unicode labels (u-labels) or ASCII Compatible Encoding labels (a-labels) in their configuration. User agents <bcp14>MUST</bcp14> support both forms and handle the conversion between them as specified in <xref target="RFC5891"/>.</t>
                <t>Example:</t>
                <sourcecode><![CDATA[
"jmap": {
    "url": "https://jmap.example.com/session"
}
                ]]></sourcecode>
                <t>For the following text-based protocols:</t>
                <ul>
                    <li>IMAP defined in <xref target="RFC9051"/>,</li>
                    <li>SMTP defined in <xref target="RFC5321"/>, and</li>
                    <li>POP3 defined in <xref target="RFC1939"/></li>
                    <li>ManageSieve defined in <xref target="RFC5804"/></li>
                </ul>
                <t>each protocol entry <bcp14>MUST</bcp14> include a <tt>host</tt> value specifying the hostname of the server that provides the corresponding protocol. The server <bcp14>MUST</bcp14> use the default port number for that protocol, with connections secured using TLS. <xref target="probing-text-auth-mechanism" /> goes into details about TLS and which ports to use.</t>
                <t>Hostnames <bcp14>MUST</bcp14> support Internationalized Domain Names (IDNs) as defined in <xref target="RFC5890"/> and <xref target="RFC5891"/>. Service providers <bcp14>MAY</bcp14> use either Unicode labels (u-labels) or ASCII Compatible Encoding labels (a-labels) in their configuration. User agents <bcp14>MUST</bcp14> support both forms and handle the conversion between them as specified in <xref target="RFC5891"/>.</t>
                <t>Example:</t>
                <sourcecode><![CDATA[
"imap": {
    "host": "imap.mail.example.com"
}
                ]]></sourcecode>
            </section>
            <section anchor="json-config-authentication">
                <name>Authentication</name>
                <t>The <tt>authentication</tt> object specifies which authentication mechanisms the provider supports.</t>
                <t>The nested <tt>password</tt> value indicates whether the provider supports username and password authentication.</t>
                <t>The nested <tt>oauth-public</tt> object contains a single <tt>issuer</tt> value that specifies the authorization server issuer identifier. User agents can use this identifier for authentication via <xref target="I-D.ietf-mailmaint-oauth-public" />. The presence of the <tt>oauth-public</tt> object indicates that the provider supports OAuth.</t>
            </section>
            <section anchor="json-config-info">
                <name>Informational</name>
                <t>The <tt>info</tt> object contains information that user agents can present to users. The only required field is <tt>info/provider/name</tt>, which <bcp14>SHOULD</bcp14> clearly identify the provider to the user. The optional <tt>info/provider/shortName</tt> provides a shorter version of <tt>name</tt>.</t>
                <t>The <tt>info/provider/logo</tt> array can contain one or more entries pointing to the provider's logo images. User agents can use these to display the provider's logo to users.</t>
                <t>The <tt>info/help/documentation</tt> field provides a URL that can be presented to users for additional information about the provider. The <tt>info/help/developer</tt> field contains a URL with information specifically for user agent developers. The <tt>info/help/contact</tt> array lists URLs that users can use to contact the provider, such as <tt>mailto</tt> URLs.</t>
                <t>A minimal <tt>info</tt> example:</t>
                <sourcecode><![CDATA[
"info": {
    "provider": {
        "name": "Example Provider Name"
    }
}
                ]]></sourcecode>

                <section anchor="provider">
                    <name>Provider Information</name>
                    <t><tt>provider</tt> object can have <tt>name</tt>, <tt>shortName</tt>, and <tt>logo</tt> properties.</t>
                    <t>The <tt>name</tt> and <tt>shortName</tt> values are intended for display to the user.</t>
                    <t>The <tt>name</tt> property specifies the provider's display name, such as
                        the name used in the provider's marketing materials. It <bcp14>SHOULD</bcp14> be no
                        longer than 30 characters, but <bcp14>MUST</bcp14> be no longer than 60 characters.</t>
                    <t>The <tt>shortName</tt> property is optional. It specifies a brief version of the provider's name, as
                        commonly recognized by users. It <bcp14>SHOULD</bcp14> be no longer than 12
                        characters, and it <bcp14>MUST NOT</bcp14> be longer than 20 characters.</t>
                    <t>Both <tt>name</tt> and <tt>shortName</tt> <bcp14>MUST NOT</bcp14> include any Control-characters and <bcp14>SHOULD NOT</bcp14> include any excessive white space.</t>
                    <t>The <tt>logo</tt> property contains an array of provider logo variants.
                        User agents select the variant that best matches their UI requirements and technical constraints.</t>
                    <t>Each object in the array contains the following properties:</t>
                    <ul>
                        <li><tt>url</tt> - Location where the logo can be retrieved. User agents <bcp14>MAY</bcp14> download
                            the logo file during configuration and store it locally.</li>
                        <li><tt>content-type</tt> - Media type of the logo image. This follows <xref target="RFC2045"/> media type format, specifying the main type and subtype without parameters. The main media type <bcp14>MUST</bcp14> be <tt>image</tt>.</li>
                        <li><tt>width</tt> - Image width in pixels. Optional. Omitted for SVG files.</li>
                        <li><tt>height</tt> - Image height in pixels. Optional. Omitted for SVG files.</li>
                    </ul>
                    <t>The logos <bcp14>SHOULD</bcp14> at least include one of each</t>
                    <ul>
                        <li><tt>image/svg+xml</tt></li>
                        <li><tt>image/png</tt> with size 128 by 128</li>
                        <li><tt>image/png</tt> with size 512 by 512</li>
                    </ul>
                    <t>If the server provides images in the SVG format, these images <bcp14>MUST</bcp14> use the SVG Tiny PS Profile specified in <xref target="I-D.svg-tiny-ps-abrotman" />.</t>
                </section>
                <section anchor="help">
                    <name>Help</name>
                    <t>These fields are intended to allow a service provider to provide additional information about configuring user agents.</t>
                    <t>The <tt>documentation</tt> property should link to a document intended for users. It can provide additional information to users about how to configure their user agent. A user agent <bcp14>MAY</bcp14> choose to display a link to this URL. User agent <bcp14>SHOULD NOT</bcp14> display links with a URL scheme other than <tt>https</tt>.</t>
                    <t>The <tt>developer</tt> property should link to a document intended for user agent developers. The document this URL links to can provide additional information to the developer.</t>
                    <t>The <tt>contact</tt> property should provide a way for user agent developers to contact the service providers. It is <em>not</em> intended as a way for users to contact the service provider. User agents <bcp14>MUST NOT</bcp14> display this link in their user interface. This URL would typically be a <tt>mailto</tt> URL or a URL linking to a contact form for developers to use.</t>
                </section>
            </section>
        </section>
        <section anchor="flow">
            <name>Flow</name>
            <t><xref target="flow-overview"/> provides a high-level overview of the automatic configuration process. This section details the individual steps involved in this process.</t>
            <section anchor="flow-user-enters-email-address">
                <name>Email Address</name>
                <t>During the initial configuration process, the user agent requests the user's email address. User agents <bcp14>SHOULD</bcp14> accept any valid <tt>mailbox</tt> format as specified in <xref target="RFC5322" sectionFormat="of" section="3.4"/>.</t>
            </section>
            <section anchor="flow-configuration-source">
                <name>Configuration Source</name>
                <t>After the user provides their email address, the client extracts the <tt>domain</tt> part of the user’s email address according to <xref target="RFC5322" sectionFormat="of" section="3.4.1"/>. For example</t>
                <table>
                    <name>Domain from email address</name>
                    <thead>
                        <tr>
                            <th align="left">Text Entered by User</th>
                            <th align="left">domain</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td align="left">jdoe@foo.example.com</td>
                            <td align="left">foo.example.com</td>
                        </tr>
                        <tr>
                            <td align="left">"J Doe" &lt;jdoe@foo.example.com&gt;</td>
                            <td align="left">foo.example.com</td>
                        </tr>
                        <tr>
                            <td align="left">&lt;jdoe@foo.example.com&gt;</td>
                            <td align="left">foo.example.com</td>
                        </tr>
                    </tbody>
                </table>
                <section anchor="well-known-uri">
                    <name>Well-Known Uniform Resource Identifier</name>
                    <t>The user agent retrieves configuration data over HTTP using the format described in <xref target="json-configuration"/>.</t>
                    <t>Configuration retrieval uses <xref target="RFC8615"/> Well-Known URIs. The user agent constructs the URI using the <em>domain</em> from the user's email address and the <em>configuration name</em> <tt>user-agent-configuration</tt>. The detailed URI construction process is specified in <xref target="RFC8615"/>.</t>
                    <t>The domain name <bcp14>MUST</bcp14> support Internationalized Domain Names (IDNs) as defined in <xref target="RFC5890"/> and <xref target="RFC5891"/>. User agents <bcp14>MUST</bcp14> handle both Unicode labels (u-labels) and ASCII Compatible Encoding labels (a-labels) when processing domain names from email addresses, and convert them appropriately for URI construction as specified in <xref target="RFC5891"/>.</t>
                    <t>The URI follows this template:</t>
                    <sourcecode><![CDATA[https://{domain}/.well-known/user-agent-configuration]]></sourcecode>
                    <t>If the user’s email address’ domain is <tt>foo.example.com</tt>, the user agent constructs the following URI:</t>
                    <sourcecode><![CDATA[https://foo.example.com/.well-known/user-agent-configuration]]></sourcecode>
                    <t>This URI always uses the <tt>https</tt> scheme. User agents <bcp14>MUST</bcp14> retrieve the configuration file only via <tt>https</tt> (HTTP over TLS).</t>
                    <t>The user agent <bcp14>MUST</bcp14> validate that the connection is secured by TLS. See <xref target="tls-validation" /> for details about TLS with respect to retrieving the configuration.</t>
                    <t>The media type of the configuration is <tt>application/json</tt>, and the HTTP server <bcp14>MUST</bcp14> set a corresponding <tt>Content-Type</tt> type header. See <xref target="RFC9110"/>. The user agent <bcp14>MUST</bcp14> validate that the content-type of the returned resource is <tt>application/json</tt>.</t>
                    <t>The HTTP server that serves the JSON configuration <bcp14>MUST NOT</bcp14> require any form of HTTP authentication to return the configuration.</t>
                    <t>For example:</t>
                    <sourcecode><![CDATA[
C: GET /.well-known/user-agent-configuration HTTP/2
C: Host: foo.example.com
C: user-agent: curl/8.4.0
C: accept: application/json
C:

S: HTTP/2 200
S: server: nginx/1.25.3
S: date: Mon, 23 Oct 2025 10:30:00 GMT
S: content-type: application/json
S: content-length: 1184
S:
S: {
S:     "protocols": {
S:         "jmap": {
S: ...
                    ]]></sourcecode>
                </section>
                <section anchor="dns-configuration-source">
                    <name>DNS Fallback</name>
                    <t>To construct the Well-Known URI described in <xref target="well-known-uri" />, the user agent requires a hostname. If the URI generated according to that section does not allow the user agent to retrieve a valid configuration, the user agent <bcp14>MAY</bcp14> attempt to retrieve an alternative hostname using DNS as described in this section. The user agent then uses this alternative hostname to construct an alternative Well-Known URI.</t>
                    <t>The user agent <bcp14>MUST NOT</bcp14> use DNS to retrieve an alternative hostname if the URI described in <xref target="well-known-uri" /> successfully provides a valid configuration.</t>
                    <t>When a user agent uses DNS for configuration discovery, it <bcp14>SHOULD</bcp14> validate all DNS responses using DNSSEC as described in <xref target="RFC9364"/> or a similar secure mechanism. See <xref target="sec-dns" /> for detailed security considerations.</t>
                    <section anchor="dns-srv">
                        <name>DNS SRV</name>
                        <t>The user agent sends a DNS request for the <tt>SRV</tt> Resource Record Type with a <tt>QNAME</tt> (Query Name) using the template <tt>_ua-auto-config._https.{domain}</tt>.</t>
                        <t>For example, if the user entered the email address <tt>jdoe@foo.example.com</tt>, the user agent performs a <tt>SRV</tt> lookup of <tt>_ua-auto-config._https.foo.example.com.</tt>.</t>
                        <t>The DNS response would then give the user agent the <em>name</em> to use instead of the email address’ <tt>domain</tt> to construct the Well-Known URI. For example:</t>
                        <sourcecode><![CDATA[
;; QUESTION SECTION:
;_ua-auto-config._https.foo.example.com.        IN    SRV

;; ANSWER SECTION:
_ua-auto-config._https.foo.example.com. 7200 IN    SRV    10 60 443 qux.example.com.
                        ]]></sourcecode>
                        <t>The DNS response returns the name <tt>qux.example.com</tt>, and the user agent would then attempt to retrieve the configuration from the Well-Known URI</t>
                        <sourcecode><![CDATA[https://qux.example.com/.well-known/user-agent-configuration]]></sourcecode>
                        <t>The <em>target</em> in the response is the domain name that will be used for the Well-Known URI. The <em>port</em> in the response <bcp14>MUST</bcp14> be 443, and user agents <bcp14>MUST</bcp14> ignore any response where the <em>port</em> is not 443.</t>
                        <t><xref target="RFC2782" /> describes DNS SRV in detail.</t>
                    </section>
                    <section anchor="dns-mx">
                        <name>DNS MX</name>
                        <t>If retrieving the configuration using both the well-known domain (as described in <xref target="well-known-uri" />) and using DNS SRV (as described in <xref target="dns-srv" />) fail, the user agent <bcp14>MAY</bcp14> choose to retrieve an alternative hostname by retrieving an <tt>MX</tt> record as described in the following.</t>
                        <t>The user agent <bcp14>MUST NOT</bcp14> use DNS MX to retrieve an alternative hostname if the approaches described in Sections <xref target="well-known-uri" format="counter" /> or <xref target="dns-srv" format="counter" /> allow the user agent to retrieve a valid configuration.</t>
                        <t>The user agent requests the <tt>MX</tt> records for the <tt>domain</tt> of the user’s email address. It then picks the hosts with the lowest priority value.</t>
                        <t>For each of the lowest priority value hostnames, the user agent then performs a DNS SRV lookup as described in <xref target="dns-srv" /> to retrieve a hostname and in turn construct a Well-Known URI for the configuration.</t>
                        <t>For example, if the user entered <tt>jdoe@foo.example.com</tt> as their email address, the user agent would construct a DNS query MX lookup using <tt>foo.example.com</tt> as the <tt>QNAME</tt> (Query Name).</t>
                        <sourcecode><![CDATA[
;; QUESTION SECTION:
;foo.example.com.        IN    MX

;; ANSWER SECTION:
foo.example.com.    3600    IN    MX    10 mail1.example.com.
foo.example.com.    3600    IN    MX    20 mail2.example.com.
                        ]]></sourcecode>
                        <t>The user agent would then perform a SRV lookup using <tt>_ua-auto-config._https.mail1.example.com</tt> as the <tt>QNAME</tt>:</t>
                        <sourcecode><![CDATA[
;; QUESTION SECTION:
;_ua-auto-config._https.mail1.example.com.        IN    SRV

;; ANSWER SECTION:
_ua-auto-config._https.mail1.example.com. 7200 IN    SRV    10 60 443 mail.example.com.
                        ]]></sourcecode>
                        <t>The user agent would then use the Well-Known URI</t>
                        <sourcecode><![CDATA[https://mail.example.com/.well-known/user-agent-configuration]]></sourcecode>
                        <t>to retrieve the configuration.</t>
                    </section>
                </section>
            </section>
            <section anchor="flow-config-validation">
                <name>Configuration Validation</name>
                <t>User agents <bcp14>MUST</bcp14> validate that the configuration contains valid JSON syntax according to RFC 8259. Additionally, user agents <bcp14>MUST</bcp14> validate the retrieved configuration against the JSON schema specification provided in <xref target="configuration-schema"/>. If the JSON syntax is invalid, user agents <bcp14>MUST</bcp14> ignore the configuration entirely and not use any portion of it.</t>
                <t>User agents <bcp14>MUST</bcp14> process only the properties that they support and <bcp14>MUST</bcp14> ignore properties not specified in the schema. This requirement enables future extensions of the format without breaking existing user agent implementations.</t>
            </section>
            <section anchor="selecting-protocols">
                <name>Selecting Protocols and Authentication</name>
                <t>After retrieving the configuration JSON, the user agent needs to determine:</t>
                <ul>
                    <li>Which protocols to use</li>
                    <li>Which authentication mechanism to employ</li>
                </ul>
                <t>Both user agents and servers support multiple protocols. The user agent needs to decide which protocols to use and determine whether the protocols specified in the configuration are sufficient to proceed. This document does not provide recommendations regarding protocol preferences or minimum protocol requirements, as these decisions depend on the specific needs and implementation details of individual user agents.</t>
                <t>The automatic configuration flow covers two distinct authentication types:</t>
                <ul>
                    <li>Username and password-based authentication</li>
                    <li>OAuth-based authentication</li>
                </ul>
                <t>User agents can support one or both authentication methods. Similarly, servers for each protocol can support one or both methods. Additionally, the specific implementation details of authentication can vary between protocols.</t>
                <t>User agents <bcp14>SHOULD</bcp14> probe each protocol and server of interest to determine compatible authentication methods. This probing process could influence the user agent's protocol selection. This probing process also allows the user agent to verify server availability.</t>
                <t>This document does not provide recommendations regarding protocol preferences. The user agent <bcp14>MUST</bcp14> make these decisions based on its needs, and any such decision is very specific to the implementation at hand.</t>
                <t>If the user agent determines that it can use either password based authentication or OAuth authentication, the user agent <bcp14>SHOULD</bcp14> prefer using OAuth based authentication.</t>
                <section anchor="probing-oauth">
                    <name>OAuth</name>
                    <t>The JSON configuration includes an <tt>oauth-public</tt> entry when the provider supports OAuth. According to <xref target="I-D.ietf-mailmaint-oauth-public" sectionFormat="of" section="2.2"/>, the OAuth Authorization Server Metadata is served at a URL constructed using the <tt>issuer</tt> value with the template <tt>https://{issuer}/.well-known/oauth-authorization-server</tt>.</t>
                    <t>For example, if the JSON configuration contains this entry:</t>
                    <sourcecode><![CDATA[
"oauth-public" : {
    "issuer" : "auth.example.com"
},
                    ]]></sourcecode>
                    <t>The OAuth Authorization Server Metadata would be at the URL <tt>https://auth.example.com/.well-known/oauth-authorization-server</tt></t>
                    <t>Before the user agent chooses to use OAuth for any protocols, it <bcp14>SHOULD</bcp14> make sure that it can retrieve the OAuth Authorization Server Metadata from the corresponding URI.</t>
                    <t>The user agent <bcp14>SHOULD</bcp14> connect to each protocol that it might be interested in to detect which authentication mechanism it supports. The user agent <bcp14>MUST NOT</bcp14> perform any authentication at this point, but it <bcp14>SHOULD</bcp14> record which mechanism(s) the server for each protocol of interest supports.</t>
                    <t>The user agent <bcp14>SHOULD</bcp14> still probe each server as described in the next sections <xref target="probing-http-auth-mechanism" format="counter" /> and <xref target="probing-text-auth-mechanism" format="counter" /> to check that the servers it is interested in have OAuth support.</t>
                </section>
                <section anchor="probing-http-auth-mechanism">
                    <name>HTTP Authentication Mechanisms</name>
                    <t>To check which HTTP authentication schemes a particular HTTP server supports, the user agent <bcp14>SHOULD</bcp14> send a request to the server’s endpoint without any `Authorization` header. For example</t>
                    <sourcecode><![CDATA[
GET /jmap/session HTTP/1.1
host: api.example.com
accept: application/json
                    ]]></sourcecode>
                    <t>As detailed in <xref target="RFC9110"/> the server <bcp14>SHOULD</bcp14> respond to this with a 401 <tt>Unauthorized</tt> status code and a <tt>www-authenticate</tt> response header indicating which authentication scheme(s) are supported.</t>
                    <t>The user agent <bcp14>SHOULD</bcp14> include an <tt>accept</tt> header with the content type it would expect for the given protocol. For JMAP, for example, the user agent <bcp14>SHOULD</bcp14> include <tt>accept: application/json</tt> as a header in this request.</t>
                    <t>If the server supports OAuth, the <tt>www-authenticate</tt> response header would include <tt>Bearer</tt>. <xref target="RFC6749"/> describes this in more detail. <xref target="RFC6750"/> and <xref target="RFC7616"/> describe username + password authentication using the so-called 'Basic' HTTP authentication scheme and the HTTP digest access authentication respectively. Other password based authentication mechanisms exist for HTTP, but their discussion is outside the scope of this document.</t>
                    <t>For example, a response header</t>
                    <sourcecode><![CDATA[
HTTP/1.1 401 Unauthorized
www-authenticate: Bearer realm="api.example.com"
                    ]]></sourcecode>
                    <t>would indicate that the server supports OAuth.</t>
                    <t>Alternatively, a response such as</t>
                    <sourcecode><![CDATA[
HTTP/1.1 401 Unauthorized
www-authenticate: Digest realm="api.example.com", qop="auth", algorithm=SHA-256, nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093", opaque="5ccc069c403ebaf9f0171e9517f40e41"
                    ]]></sourcecode>
                    <t>would indicate that the server supports digest access authentication.</t>
                    <t>Details of HTTP authentication are described in <xref target="RFC9110"/> but it is worth noting that a server supporting multiple authentication methods can return either multiple <tt>www-authenticate</tt> header fields in its response or a single <tt>www-authenticate</tt> header field with multiple authentication methods.</t>
                </section>
                <section anchor="probing-text-auth-mechanism">
                    <name>Other Protocols Authentication Mechanisms</name>
                    <t>For text based protocols (IMAP, POP3, and SMTP) the client <bcp14>SHOULD</bcp14> connect to the server to check that</t>
                    <ul>
                    <li>the client can reach the server,</li>
                    <li>the server implements the expected protocol, and</li>
                    <li>which authentication mechanisms the server supports.</li>
                    </ul>
                    <t>The client <bcp14>MUST</bcp14> attempt to connect to the server on the default ports</t>
                    <ul>
                    <li>port 993 for IMAP</li>
                    <li>port 995 for POP3</li>
                    <li>port 465 for SMTP</li>
                    </ul>
                    <t>using TLS. See <xref target="RFC2595"/> and <xref target="RFC3207"/> for details about using TLS with these protocols.</t>
                    <t>The client <bcp14>SHOULD NOT</bcp14> attempt to connect to an IMAP, POP3, or SMTP server on their cleartext ports.</t>
                    <t>The client <bcp14>MUST NOT</bcp14> allow for configuration with a cleartext protocol that is not protected by TLS.</t>
                    <t>The client <bcp14>MUST</bcp14> validate that the connection is secured by TLS, and that the TLS certificate is valid and matches the expected domain name. See <xref target="tls-validation" /> for details on TLS validation.</t>
                    <t>If the server announces either the <tt>OAUTHBEARER</tt> SASL authentication method, the client can assume that this server supports using <xref target="I-D.ietf-mailmaint-oauth-public" />. For IMAP for example, if the server’s <tt>CAPABILITY</tt> contains <tt>AUTH=OAUTHBEARER</tt> this would indicate this support.</t>
                    <t>Servers <bcp14>SHOULD NOT</bcp14> announce support for the <tt>OAUTHBEARER</tt> SASL mechanism if they do not support <xref target="I-D.ietf-mailmaint-oauth-public" />. Servers <bcp14>MUST</bcp14> announce support for the <tt>OAUTHBEARER</tt> SASL mechanism if they support OAuth Profile for Open Public Clients. Servers <bcp14>SHOULD NOT</bcp14> use the <tt>XOAUTH2</tt> SASL mechanism.</t>
                    <t>There are various SASL authentication mechanisms for password based authentication, and additionally IMAP and POP3 also support password based authentication through <tt>LOGIN</tt> and <tt>APOP</tt> respectively. The client needs to probe each server to determine which authentication methods are supported by both the client and the server.</t>
                    <section anchor="probing-text-auth-mechanism-imap">
                        <name>IMAP</name>
                        <t>The IMAP protocol provides various other authentication mechanisms. There are various SASL mechanisms for username + password authentication. <xref target="RFC4959"/> describes how to use SASL with IMAP.</t>
                        <t>Unless the server sends the <tt>LOGINDISABLED</tt> capability, clients know that they can use the <tt>LOGIN</tt> command for username + password authentication.</t>
                        <t>For IMAP, a sample session might look like this:</t>
                        <sourcecode><![CDATA[
S: * OK [CAPABILITY IMAP4 IMAP4rev1 SASL-IR AUTH=PLAIN AUTH=OAUTHBEARER] IMAP Server
C: A1 LOGOUT
S: * BYE
S: A1 OK
                        ]]></sourcecode>
                        <t>In this case the server returned its IMAP capabilities as part of the so-called greeting messages. The support for the <tt>OAUTHBEARER</tt> SASL authentication mechanism indicates to the client that the server supports OAuth. Similarly the <tt>PLAIN</tt> SASL authentication mechanism indicates that the server supports username + password authentication. The absence of the <tt>LOGINDISABLED</tt> also indicates support for username and password authentication.</t>
                        <t>If the server doesn’t include its capabilities in the server greeting, the client <bcp14>SHOULD</bcp14> send a <tt>CAPABILITY</tt> command as outlined in <xref target="RFC9051" sectionFormat="of" section="6.1.1" />. The client <bcp14>SHOULD</bcp14> send a <tt>LOGOUT</tt> command as outlined in <xref target="RFC9051" sectionFormat="of" section="6.1.3" /> and check that the server sends an untagged <tt>BYE</tt> response.</t>
                    </section>
                    <section anchor="probing-text-auth-mechanism-smtp">
                        <name>SMTP</name>
                        <t>SMTP similarly announces which authentication mechanisms is supports. <xref target="RFC4954"/> describes how to use SASL with SMTP.</t>
                        <t>For SMTP, the client would use the <tt>EHLO</tt> command to retrieve the SMTP server’s supported authentication mechanisms. For example:</t>
                        <sourcecode><![CDATA[
S: 220 smtp.example.com ESMTP service ready
C: EHLO client.example.com
S: 250-smtp.example.com
S: 250-PIPELINING
S: 250-SIZE 10240000
S: 250-AUTH PLAIN LOGIN OAUTHBEARER
S: 250-ENHANCEDSTATUSCODES
S: 250 8BITMIME
C: QUIT
S: 221 Bye
                        ]]></sourcecode>
                        <t><xref target="RFC5321" sectionFormat="of" section="3.2" /> describe this client initiation of the SMTP protocol. <xref target="RFC4954" /> describes SMTP authentication in detail. In the above example <tt>PLAIN</tt> and <tt>LOGIN</tt> indicate that the server supports username + password based authentication, and <tt>OAUTHBEARER</tt> indicates that the server supports OAuth.</t>
                        <t>The client <bcp14>SHOULD</bcp14> send a <tt>QUIT</tt> command and check for the server’s <tt>221 Bye</tt> response.</t>
                    </section>
                    <section anchor="probing-text-auth-mechanism-pop3">
                        <name>POP3</name>
                        <t>For POP3 <xref target="RFC5034"/> describes how to use SASL. POP3 additionally supports password based authentication using its <tt>USER</tt> and <tt>PASS</tt> commands, or through the optional <tt>APOP</tt> command. The client can check which SASL authentication methods the server supports using the <tt>CAPA</tt> command.</t>
                        <t>For example:</t>
                        <sourcecode><![CDATA[
S: +OK pop.example.com POP3 server ready
C: CAPA
S: +OK List of capabilities follows
S: SASL PLAIN OAUTHBEARER
S: IMPLEMENTATION BlurdyBlurp POP3 server
S: .
C: QUIT
S: +OK POP3 server signing off (maildrop empty)
                        ]]></sourcecode>
                        <t>The client <bcp14>SHOULD</bcp14> send a <tt>QUIT</tt> command and check for the server’s <tt>+OK</tt> response.</t>
                    </section>
                </section>
            </section>
            <section anchor="confirming-hostnames">
                <name>Confirming Server Names</name>
                <t>The client <bcp14>SHOULD</bcp14> display to the user the hostnames of all servers that it intends to authenticate with. This list of server hostnames gives the user a chance to validate if they want to move ahead.</t>
                <t>The client <bcp14>MAY</bcp14> choose to limit the hostnames to their second-level domain names when displaying this list. Instead of displaying <tt>mail.example.com</tt> the client would display <tt>example.com</tt> if it chooses to do so. Limiting the hostnames to their second-level domain names helps users identify if this is the domain they intend to connect to or not.</t>
                <t>The client <bcp14>MUST NOT</bcp14> cut off parts of long second-level domains, to avoid spoofing. At least 63 characters of the second-level domain names <bcp14>MUST</bcp14> be displayed.</t>
                <t>If the user mistyped their email address in <xref target="flow-user-enters-email-address" />, letting the user confirm the server hostnames gives the user a chance to notice this.</t>
                <t>Clients can enhance the user experience by using the <tt>info</tt> section of the configuration (described in <xref target="json-config-info" />) to display the provider's name and logo during this configuration step.</t>
                <t><xref target="sec-domain-names" /> list security considerations related to the user confirming these hostnames.</t>
            </section>
            <section anchor="username">
                <name>Username</name>
                <t>For password-based authentication, the full <tt>addr-spec</tt> part of the email address <bcp14>MUST</bcp14> be used as the username. For example:</t>
                <table>
                    <name>Username from email address</name>
                    <thead>
                        <tr>
                            <th align="left">Text Entered by User</th>
                            <th align="left">username</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td align="left">jdoe@example.com</td>
                            <td align="left">jdoe@example.com</td>
                        </tr>
                        <tr>
                            <td align="left">"J Doe" &lt;jdoe@example.com&gt;</td>
                            <td align="left">jdoe@example.com</td>
                        </tr>
                        <tr>
                            <td align="left">&lt;jdoe@example.com&gt;</td>
                            <td align="left">jdoe@example.com</td>
                        </tr>
                    </tbody>
                </table>
                <t>For OAuth Profile for Open Public Clients, the client <bcp14>MUST</bcp14> send this username as the <tt>login_hint</tt> in the authorization request URL.</t>
                <t>The provider <bcp14>MUST</bcp14> ensure that any valid email address that the user might enter
                    during setup is a valid username for all servers given in this configuration.
                    This will require a mapping on the server level from email address to internal
                    username. This mapping happens internally in the server and the client
                    is not involved in this mapping.</t>
            </section>
            <section anchor="flow-config-oauth">
                <name>Configuring OAuth</name>
                <t>If the client and the provider both support OAuth Profile for Open Public Clients, and if the servers that the client wants to use support OAuth, the client can configure OAuth.</t>
                <t>The <tt>authentication</tt> section in the JSON configuration described in <xref target="json-config-authentication" /> will let the client create a URL to retrieve the OAuth Authorization Server Metadata as described in section <xref target="probing-oauth" />. With this metadata, the client can then use <xref target="I-D.ietf-mailmaint-oauth-public" /> to configure OAuth.</t>
                <t>Part of this will require opening the authorization request URL in an external user-agent, which is typically the default browser. The client <bcp14>SHOULD</bcp14> make it very apparent to the user which hostname is being used for the authorization request URL. The client <bcp14>SHOULD</bcp14> make the user confirm least the second-level domain name(s) of the hostname of this URL. This is to minimize the risk of the user exposing their credentials to a third party. </t>
                <t>As described in <xref target="confirming-hostnames" />, the client <bcp14>SHOULD</bcp14> also confirm the server hostnames with the user. For OAuth authentication, the client <bcp14>SHOULD</bcp14> include the hostname of the authorization request URL in this list of hostnames.</t>
            </section>
            <section anchor="flow-config-password">
                <name>Configuring Password-Based Authentication</name>
                <t>If the client and provider both support password-based authentication, and if the servers that the client wants to use support password-based authentication, the client can configure itself to use these servers.</t>
                <t>The client <bcp14>SHOULD</bcp14> at this point ask the user for the password for their account with the provider.</t>
                <t>Once the user has entered their password, the client <bcp14>SHOULD</bcp14> validate that it is able to authenticate using the entered password with all servers that it is interested in. Only then would it save the new configuration.</t>
            </section>
        </section>
        <section anchor="config-validation">
            <name>Configuration Validation</name>
            <section anchor="user-approval">
                <name>User Approval</name>
                <t>Regardless of the mechanism used to obtain the configuration, clients <bcp14>SHOULD</bcp14> display the configuration details to users and request explicit confirmation before use. During this confirmation process:</t>
                <ul spacing="normal">
                    <li>
                        <t>At least the second-level domain names of all involved hostnames <bcp14>MUST</bcp14> be displayed clearly and prominently.</t>
                    </li>
                    <li>
                        <t>Clients <bcp14>MUST NOT</bcp14> truncate long second-level domain names to prevent spoofing attacks. At least 63 characters <bcp14>MUST</bcp14> be displayed.</t>
                    </li>
                </ul>
            </section>
            <section anchor="oauth2-requirements">
                <name>OAuth2 requirements</name>
                <t>If OAuth2 is used, the OAuth2 server <bcp14>MUST</bcp14> adhere to <xref target="I-D.ietf-mailmaint-oauth-public" />.</t>
                <t>Notably, the Dynamic Client Registration <bcp14>MUST</bcp14> be implemented and return a working Client ID in response HTTP calls defined by the specification.</t>
                <t>The OAuth2 scopes defined in <xref target="I-D.ietf-mailmaint-oauth-public" /> <bcp14>MUST</bcp14> be included and <bcp14>MUST</bcp14> give access to the servers returned in the JSON configuration described in <xref target="json-configuration" />.</t>
                <t>A single token <bcp14>MUST</bcp14> work for all servers in the JSON configuration, such that a single user login is sufficient for all services. For that purpose, the client will include all relevant scopes in the authentication requests.</t>
            </section>
        </section>
        <section anchor="security-considerations">
            <name>Security Considerations</name>
            <t>While the mechanism described in this document makes it easier for users to correctly configure their user agent, there’s an associated risk with making it easier for users to expose their credentials to a third party.</t>
            <t>User agents using the mechanism described in this document need to design their user interface and user experience such that this risk is minimized. Actual affordances depend on implementation details of the user interface and are outside the scope of this document.</t>
            <section anchor="sec-domain-names">
                <name>Mistyped Domain Names</name>
                <t>As part of the first step of the mechanism described in this document, the user enters their email address. If the user mistyped the domain part of their email address, and if the mistyped domain exists and supports the mechanism described in this document, the user could expose their credentials to the owner of that domain. An attacker could use this in an attempt to gain knowledge of the user’s credentials.</t>
                <t>As a result, user agents need to carefully design their user interface and user experience as to let the user know which domain is being used. It would make sense to display this very clearly to the user, before they enter any credentials.</t>
                <t>The user agent would want to display a list of all second-level domains (SLDs) for all the servers that it intends to use. The user can then confirm these.</t>
                <t>When the mechanism described in this document uses OAuth, it would make sense to ask the user to confirm the domains of the servers that will be used and additionally confirm the domains of</t>
                <ul>
                    <li>the URL to retrieve the OAuth Authorization Server Metadata and/or</li>
                    <li>the authorization request URL.</li>
                </ul>
                <t>When asking the user to confirm these domains, it would make sense to only display the second-level domain (SLD) of those domains. This would make it more difficult for an attacker to do URL obfuscation and use subdomain phishing.</t>
                <t>When using a browser for OAuth, the user agent would want to display the second-level domain (SLD) that the browser is currently displaying, and update this when redirects happen or new pages are loaded.</t>
            </section>
            <section anchor="sec-attacker-controlled-conf">
                <name>Attacker Controlled JSON Configuration</name>
                <t>If an attacker can direct the user agent to use an attacker-controlled JSON configuration, the attacker would be able to direct the user to servers of the attacker's choosing.</t>
                <t>In <xref target="sec-domain-names" /> some mechanisms to limit this attack vector are described.</t>
                <t>However, the user agent needs to combine this with a conservative trust policy for its TLS when retrieving the JSON configuration.</t>
            </section>
            <section anchor="sec-dns">
                <name>DNS</name>
                <t>If the user agent uses the DNS mechanisms described in <xref target="dns-configuration-source" />, care needs to be taken to make sure that an attacker hasn’t altered the DNS response. Using DNSSEC is one method of improving the security aspects of this approach. Alternatively, user agents <bcp14>MAY</bcp14> choose not use the DNS based mechanisms described in <xref target="dns-configuration-source" /> at all.</t>
            </section>
            <section anchor="tls-validation">
                <name>TLS Validation</name>
                <t>Whenever TLS is used, clients <bcp14>MUST</bcp14> validate TLS certificates and ensure that certificates are valid for the hostnames specified in the configuration. If certificate validation fails or the TLS certificate is otherwise invalid, the client <bcp14>MUST</bcp14> disconnect and <bcp14>MUST NOT</bcp14> use any configuration retrieved from that URI.</t>
                <t>Certificate validation failures represent significant security risks, as they may indicate attempts to redirect users' credentials to an attacker. Clients <bcp14>SHOULD NOT</bcp14> allow users to override TLS certificate validation checks.</t>
                <t>Clients <bcp14>MAY</bcp14> implement more restrictive TLS policies for configuration retrieval than those typically required for web browsing, in order to provide stronger security guarantees. Clients <bcp14>MAY</bcp14> want to limit the allowed protocol version(s) to recent versions, and <bcp14>MAY</bcp14> similarly want to restrict the allowed cipher suites.</t>
            </section>
            <section anchor="config-updates">
                <name>Updating the Configuration</name>
                <t>The mechanism described in this document can be used to upgrade a user's configuration. The user agent could check for configurations even when it has a working configuration for an account. If the user agent finds a configuration that is better (in some way) than the already existing configuration, it could then upgrade the existing configuration.</t>
                <t>But in doing so, the user agent would increase the attack window that a potential attacker has. Instead of only giving an attacker the opportunity when the user configures their user agent for the first time, the attacker would now have an opportunity each time the user agent checks for a better configuration. That could be undesirable.</t>
            </section>
            <section anchor="security-provider">
                <name>Provider Information</name>
                <t>Image parsers are a common attack vector, and clients <bcp14>MUST NOT</bcp14> display the <tt>logo</tt> images described in <xref target="provider" /> unless they can do so in a way that doesn't expose the client to such attacks.</t>
            </section>
        </section>
        <section anchor="iana-considerations">
            <name>IANA Considerations</name>
            <section anchor="iana-proto-registry">
                <name>The User-Agent Auto-Configuration Protocol Registry</name>
                <t>This document establishes the user-agent auto-configuration protocol registry.</t>
                <t>User-agent auto-configuration protocols are registered on the advice of one or more Designated Experts (appointed by the IESG or their delegate), with a Specification Required (using terminology from <xref target="RFC8126" />).  However, to allow for the allocation of values prior to publication, the Designated Expert(s) may approve registration once they are satisfied that such a specification will be published.</t>
                <t>Registration requests are sent to the ____@ietf.org mailing list for review and comment, with an appropriate subject (e.g., "Request for well-known URI: example").</t>
                <t>Before a period of 14 days has passed, the Designated Expert(s) will either approve or deny the registration request, communicating this decision both to the review list and to IANA.  Denials should include an explanation and, if applicable, suggestions as to how to make the request successful.  Registration requests that are undetermined for a period longer than 21 days can be brought to the IESG's attention (using the iesg@iesg.org mailing list) for resolution.</t>
                <dl newline="true">
                    <dt>Registry Name:</dt>
                    <dd>User-Agent Auto-Configuration Protocols</dd>
                    <dt>Registration Procedure:</dt>
                    <dd>Specification Required (per <xref target="RFC8126" />)</dd>
                </dl>

                <section anchor="iana-proto-registration-template">
                    <name>Registration Template</name>
                     <dl newline="true">
                         <dt>Name</dt>
                         <dd>The commonly used name of the protocol</dd>
                         <dt>Protocol Key:</dt>
                         <dd>The JSON key using in the <tt>protocols</tt> object in the JSON configuration described in <xref target="json-configuration"/></dd>
                         <dt>URL Scheme:</dt>
                         <dd>(Optional) The URL scheme to be used for this protocol. HTTP based protocols specify <tt>https</tt>. If left empty, the <tt>protocols</tt> entry in the JSON configuration will only specify a hostname using <tt>host</tt>. If a URL scheme is specified, the JSON configuration entry will instead use <tt>url</tt> with a URL using this URL scheme.</dd>
                         <dt>Specification</dt>
                         <dd>Which RFC(s) or document(s) specify the protocol</dd>
                         <dt>Additional Properties:</dt>
                         <dd>Which additional property values are present in the protocol’s JSON object.</dd>
                     </dl>
                </section>
                <section anchor="initial-registration">
                    <name>Initial Registrations</name>
                    <table>
                        <name>Initial registrations to the User-Agent Auto-Configuration Protocol Registry</name>
                        <thead>
                            <tr>
                                <th align="left">Name</th>
                                <th align="left">Protocol Key</th>
                                <th align="left">URL scheme</th>
                                <th align="left">Specification</th>
                                <th align="left">Additional Properties</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td align="left">JMAP</td>
                                <td align="left"><tt>jmap</tt></td>
                                <td align="left">https</td>
                                <td align="left">RFC 8620, RFC 8621, RFC 8887, RFC 9610</td>
                                <td align="left"></td>
                            </tr>
                            <tr>
                                <td align="left">IMAP</td>
                                <td align="left"><tt>imap</tt></td>
                                <td align="left"></td>
                                <td align="left">RFC 9051</td>
                                <td align="left"></td>
                            </tr>
                            <tr>
                                <td align="left">POP3</td>
                                <td align="left"><tt>pop3</tt></td>
                                <td align="left"></td>
                                <td align="left">RFC 1939, RFC 5034</td>
                                <td align="left"></td>
                            </tr>
                            <tr>
                                <td align="left">SMTP</td>
                                <td align="left"><tt>smtp</tt></td>
                                <td align="left"></td>
                                <td align="left">RFC 5321, RFC 2822</td>
                                <td align="left"></td>
                            </tr>
                            <tr>
                                <td align="left">CalDAV</td>
                                <td align="left"><tt>caldav</tt></td>
                                <td align="left">https</td>
                                <td align="left">RFC 4791</td>
                                <td align="left"></td>
                            </tr>
                            <tr>
                                <td align="left">CardDAV</td>
                                <td align="left"><tt>carddav</tt></td>
                                <td align="left">https</td>
                                <td align="left">RFC 6352</td>
                                <td align="left"></td>
                            </tr>
                            <tr>
                                <td align="left">WebDAV</td>
                                <td align="left"><tt>webdav</tt></td>
                                <td align="left">https</td>
                                <td align="left">RFC 4918</td>
                                <td align="left"></td>
                            </tr>
                            <tr>
                                <td align="left">ManageSieve</td>
                                <td align="left"><tt>managesieve</tt></td>
                                <td align="left"></td>
                                <td align="left">RFC 5804, RFC 5228</td>
                                <td align="left"></td>
                            </tr>
                        </tbody>
                    </table>
                    <t>The <em>Additional Properties</em> field is empty in all of the initial values.</t>
                </section>
            </section>
            <section anchor="registration">
                <name>Registration</name>
                <section anchor="new-records-to-be-registered">
                    <name>New record to be registered</name>
                    <t>This registers the <tt>user-agent-configuration</tt> name from <xref target="well-known-uri" /> according to <xref target="RFC8615"/>.</t>

                    <dl newline="false" spacing="compact">
                      <dt>URI suffix:</dt>
                      <dd><tt>user-agent-configuration</tt></dd>

                      <dt>Change controller:</dt>
                      <dd><tt>IETF</tt></dd>

                      <dt>Specification document(s):</dt>
                      <dd>This document</dd>

                      <dt>Related information:</dt>
                      <dd>/</dd>
                    </dl>
                </section>
                <section anchor="registration-of-srv-service-name-ua-auto-config">
                    <name>Registration of SRV Service Name <tt>uaac</tt></name>
                    <t>This registers the name <tt>ua-auto-config</tt> from <xref target="dns-configuration-source" /> according to <xref target="RFC6335"/>.</t>
                    <dl newline="false" spacing="compact">
                      <dt>Service Name:</dt>
                      <dd><tt>ua-auto-config</tt></dd>

                      <dt>Port Number:</dt>
                      <dd>/</dd>

                      <dt>Transport Protocol:</dt>
                      <dd>tcp</dd>

                      <dt>Description:</dt>
                      <dd>User-Agent Automatic Configuration</dd>

                      <dt>Reference:</dt>
                      <dd>This document</dd>
                    </dl>
                </section>
            </section>
        </section>
    </middle>
    <back>
        <displayreference target="I-D.ietf-mailmaint-oauth-public" to="OAuthPublic"/>
        <references anchor="sec-normative-references">
            <name>Normative References</name>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.1939.xml"/>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2045.xml"/>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2595.xml"/>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2782.xml"/>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3207.xml"/>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4791.xml"/>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4918.xml"/>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4954.xml"/>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4959.xml"/>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5034.xml"/>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5321.xml"/>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5322.xml"/>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5804.xml"/>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5890.xml"/>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5891.xml"/>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6335.xml"/>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6352.xml"/>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6749.xml"/>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6750.xml"/>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7616.xml"/>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8126.xml"/>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8615.xml"/>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8620.xml"/>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9051.xml"/>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9110.xml"/>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9364.xml"/>
            <xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.svg-tiny-ps-abrotman.xml"/>
            <reference anchor="I-D.ietf-mailmaint-oauth-public" target="https://datatracker.ietf.org/doc/html/draft-ietf-mailmaint-oauth-public">
                <front>
                    <title>OAuth Profile for Open Public Clients</title>
                    <author initials="N." surname="Jenkins" fullname="Neil Jenkins">
                        <organization>Fastmail</organization>
                    </author>
                    <author initials="B." surname="Bucksch" fullname="Ben Bucksch">
                        <organization>Beonex</organization>
                    </author>
                    <abstract>
                        <t>This document specifies a profile of the OAuth authorization protocol to allow for interoperability between native clients and servers using open protocols, such as JMAP, IMAP, SMTP, POP, CalDAV, and CardDAV.</t>
                    </abstract>
                </front>
                <seriesInfo name="Internet-Draft" value="draft-ietf-mailmaint-oauth-public"/>
            </reference>
        </references>
        <section anchor="configuration-schema">
            <name>Configuration JSON Schema</name>
            <t>The following JSON schema defines the format of the JSON configuration in <xref target="json-configuration"/></t>
            <sourcecode><![CDATA[
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "ua-auto-conf",
    "title": "User-Agent Automatic Configuration",
    "description": "Automatic Configuration of Email, Calendar, and Contact Server Settings",
    "type": "object",
    "properties": {
        "protocols": {
            "type": "object",
            "properties": {
                "caldav": { "$ref": "#/$defs/http-server" },
                "carddav": { "$ref": "#/$defs/http-server" },
                "imap": { "$ref": "#/$defs/text-server" },
                "jmap": { "$ref": "#/$defs/http-server" },
                "managesieve": { "$ref": "#/$defs/text-server" },
                "pop3": { "$ref": "#/$defs/text-server" },
                "smtp": { "$ref": "#/$defs/text-server" },
                "webdav": { "$ref": "#/$defs/http-server" }
            }
        },
        "authentication": {
            "properties": {
                "oauth-public": {
                    "properties": {
                        "issuer": {
                            "format": "hostname",
                            "type": "string"
                        }
                    },
                    "required": [
                        "issuer"
                    ],
                    "type": "object"
                },
                "password": {
                    "type": "boolean"
                }
            },
            "required": [ "password" ]
        },
        "info": {
            "type": "object",
            "properties": {
                "provider": {
                    "type": "object",
                    "properties": {
                        "name": { "type": "string", "minLength": 1 },
                        "shortName": { "type": "string", "minLength": 1 },
                        "logo": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "properties": {
                                    "url": { "type": "string", "format": "uri" },
                                    "content-type": { "type": "string", "minLength": 1 },
                                    "width": { "type": "integer", "minimum": 1 },
                                    "height": { "type": "integer", "minimum": 1 }
                                },
                                "required": [ "url", "content-type" ]
                            }
                        }
                    },
                    "required": [ "name" ]
                },
                "help": {
                    "type": "object",
                    "properties": {
                        "documentation": { "type": "string", "format": "uri" },
                        "developer": { "type": "string", "format": "uri" },
                        "contact": {
                            "type": "array",
                            "items": { "type": "string", "minLength": 1 }
                        }
                    }
                }
            },
            "required": [ "provider" ]
        }
    },
    "required": [ "protocols", "info" ],
    "$defs": {
        "http-server": {
            "type": "object",
            "properties": {
                "url": { "type": "string", "format": "uri" }
            },
            "required": ["url"]
        },
        "text-server": {
            "type": "object",
            "properties": {
                "host": { "type": "string", "format": "hostname" }
            },
            "required": ["host"]
        }
    }
}
            ]]></sourcecode>
        </section>
        <section anchor="Acknowledgements" numbered="false">
            <name>Acknowledgements</name>
            <t>This document is based on the work of Ben Bucksch.</t>
        </section>
    </back>
</rfc>
