| Internet-Draft | autoconfig | November 2026 |
| Bucksch | Expires 6 May 2027 | [Page] |
This document describes a protocol that allows client applications to set up mail accounts and related services like calendar, contact and file sync, chat and video conference accounts, using only the email address and password.¶
This existing protocol is used by service providers to publish the account configuration, so that client applications can find a working configuration automatically. The configuration is based on an email address, but is not limited to configuring email service.¶
The running code and deployments documented here are in some cases no longer in line with security best-practices. Implementers are urged to study the security considerations attentively.¶
This note is to be removed before publishing as an RFC.¶
The latest revision of this draft can be found at https://benbucksch.github.io/autoconfig-spec/draft-ietf-mailmaint-autoconfig.html. Status information for this document may be found at https://datatracker.ietf.org/doc/draft-ietf-mailmaint-autoconfig/.¶
Discussion of this document takes place on the mailmaint Working Group mailing list (mailto:mailmaint@ietf.org), which is archived at https://mailarchive.ietf.org/arch/browse/mailmaint/. Subscribe at https://www.ietf.org/mailman/listinfo/mailmaint/.¶
Source for this draft and an issue tracker can be found at https://github.com/benbucksch/autoconfig-spec.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 6 May 2027.¶
Copyright (c) 2026 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
Configuring email, calendar and contacts client applications for a given user account at a specific service provider is often a tedious, error-prone and unnerving process. This document describes an automatic configuration protocol, originally defined in 2008 and in wide use since. As of 2026, about 80% of email accounts can be automatically configured using this protocol.¶
The protocol works by first determining the domain from the email address, and then querying well-known URLs, which return the configuration parameters in computer-readable form. Failing that, various fallback sources can be applied, including a database of configurations for some major domains. While this protocol was originally conceived for configuring mail clients, it is also used for other kinds of services accessible to the user at the same provider, like calendar, contact and file sync, chat and video conference accounts. This document describes the AutoConfig protocol as it is used in the wild. Some of it, such as falling back to an HTTP URL, is not advisable from a security viewpoint. This document describes the protocol as compatible with running code, and another document will describe a potentially not backwards compatible process following today's best security practices.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
Whether the ISP or a common central database returns the configuration, the resulting document MUST have the following data format and qualities.¶
The format is in [XML]. The MIME type is text/xml.¶
The sections below define the XML and its meaning. Most sections start with a concrete example of the elements that they define.¶
The following example shows the syntax of the XML configuration file.¶
<?xml version="1.0"?>
<clientConfig version="1.2">
<emailProvider id="example.com">
<domain>example.com</domain>
<domain>example.net</domain>
<displayName>Google Workspace</displayName>
<displayShortName>GMail</displayShortName>
<incomingServer type="jmap">
<url>https://jmap.example.com</url>
<!-- For "OAuth2", the provider MUST adhere to "OAuth2 server requirements". -->
<authentication>OAuth2</authentication>
<authentication system="http">Basic</authentication>
<username>%EMAILADDRESS%</username>
</incomingServer>
<!-- There can be multiple incoming servers,
and even multiple IMAP server configs.
The first configuration is the preferred one, but the user or client
can choose the alternative configs based on their own preferences. -->
<incomingServer type="imap">
<hostname>imap.example.com</hostname>
<port>993</port>
<!-- One of:
"plain": no encryption
"SSL": TLS on TLS-specific port
"STARTTLS": mandatory upgrade to TLS via STARTTLS -->
<socketType>SSL</socketType>
<!-- Common authentication methods for TCP-based protocols:
"password-cleartext": SASL PLAIN, LOGIN or protocol-native login.
"password-encrypted": SASL CRAM-MD5, DIGEST-MD5 etc. Not TLS.
"OAuth2": Provider MUST adhere to section "OAuth2 server requirements".
Multiple <authentication> elements per server
configuration are valid. Clients will pick the first
one that they support. -->
<authentication>password-cleartext</authentication>
<username>%EMAILADDRESS%</username>
</incomingServer>
<incomingServer type="pop3">
<hostname>pop.example.com</hostname>
<port>995</port>
<socketType>SSL</socketType>
<authentication>password-cleartext</authentication>
<username>%EMAILADDRESS%</username>
</incomingServer>
<!-- Only for IMAP and POP3 -->
<outgoingServer type="smtp">
<hostname>smtp.example.com</hostname>
<port>587</port>
<socketType>STARTTLS</socketType>
<authentication>password-cleartext</authentication>
<username>%EMAILADDRESS%</username>
</outgoingServer>
<incomingServer type="activesync">
<url>https://mail.example.com/Microsoft-Server-ActiveSync</url>
<username>%EMAILADDRESS%</username>
<authentication>OAuth2</authentication>
</incomingServer>
<documentation url="https://www.example.com/help/mail/">
<descr lang="en">Configure mail app for IMAP</descr>
<descr lang="de">Email mit IMAP konfigurieren</descr>
</documentation>
</emailProvider>
<addressbook type="carddav">
<url>https://contacts.example.com/remote.php/dav</url>
<authentication system="http">Basic</authentication>
<username>%EMAILADDRESS%</username>
</addressbook>
<calendar type="caldav">
<url>https://calendar.example.com/remote.php/dav</url>
<authentication system="http">Basic</authentication>
<username>%EMAILADDRESS%</username>
</calendar>
<!-- Upload files, allowing the user to share them.
This can be used to send links instead of attachments,
or to set up a file sync folder on the user's desktop. -->
<fileShare type="webdav">
<url>https://share.example.com/remote.php/dav</url>
<authentication>OAuth2</authentication>
<authentication system="http">Basic</authentication>
<username>%EMAILADDRESS%</username>
</fileShare>
<chatServer type="xmpp">
<url>wss://example.com:5281/xmpp-websocket</url>
<authentication system="http">Basic</authentication>
<username>%EMAILADDRESS%</username>
</chatServer>
<videoConference type="opentalk">
<url>https://talk.example.com/login</url>
<authentication>OAuth2</authentication>
<username>%EMAILADDRESS%</username>
</videoConference>
<!-- OAuth2 configuration for native public client apps.
Gives e.g. clientID, expiry, and login page.
The provider MUST adhere to "OAuth2 server requirements". -->
<oAuth2>
<issuer>https://login.example.com</issuer>
<authURL>https://login.example.com/auth</authURL>
<tokenURL>https://login.example.com/token</tokenURL>
<scope>IMAP POP3 SMTP CalDAV CardDAV WebDAV offline_access</scope>
<clientID>open</clientID>
</oAuth2>
<clientConfigUpdate url="https://www.example.com/config/mail.xml" />
</clientConfig>
¶
The formal grammar is in appendix RELAX NG schema.¶
The file starts with an XML header, e.g. <?xml version="1.0"?>,
and is encoded in UTF-8 without BOM.¶
The root element of the XML file is <clientConfig version="1.2">.¶
The version is 1.2 for the version defined in this specification. 1.1 is
a compatible previous version of this protocol: [AutoConfig1.1]. Higher versions are for future specifications.
The client MUST NOT reject a configuration file solely based on the version number, and MUST accept configurations
with an unknown version number that are otherwise adhering to this specification.¶
Example:¶
<emailProvider id="example.com">¶
RELAX NG:¶
emailProvider = element emailProvider {
attribute id { text },
( domain | displayName | displayShortName | documentation
| incomingServer | outgoingServer )* }
¶
Element <emailProvider> is within the root element.¶
The id is a unique string that typically matches the primary domain of the provider. The syntax of the ID is the same as for domain and hostname.¶
Within <emailProvider> are <domain>, <displayName> and
<displayShortName>, <documentation>, <incomingServer> and
<outgoingServer>.¶
Example:¶
<domain>example.com</domain> <domain>example.net</domain> <domain purpose="mx">example-hosting.com</domain>¶
RELAX NG:¶
domain = element domain {
attribute purpose { text }?, # the only defined value is "mx"
text }
¶
The content of the <domain> element defines which email addresses this configuration
is valid for. For example, a configuration with <domain>example.com</domain> is valid for
email address fred@example.com.¶
Multiple <domain> elements may be included, which means that the configuration is
valid for all of these domains. Their order has no meaning - they may be sorted
by number of users, importance to the provider, or alphabetically.¶
<domain purpose="mx"> specifies the domain name of the MX server
of this provider. It is used during the configuration file lookup using MX
server names, as specified in MX MX. If the email address that is to be configured has an MX server that is within the domain given by <domain purpose="mx">, then this configuration is applicable for that email address.
Adding the purpose attribute is RECOMMENDED.¶
Example:¶
<displayName>Google Workspace</displayName> <displayShortName>GMail</displayShortName>¶
RELAX NG:¶
displayName = element displayName { text }
displayShortName = element displayShortName { text }
¶
Both elements may be used to display the provider or account name by the mail client UI, which therefore has expectations on length and expressiveness.¶
The <displayName> element contains the name of the provider, e.g.
as preferred by the marketing of the provider itself. It should be no
longer than 30 characters, to be meaningful to the user and to fit in
the UI fields.¶
The <displayShortName> element contains the name of the provider, as
typically used by end users. It should be no longer than 12
characters. It may be used by the mail client as base for the account name,
and during everyday use of the app to represent the account, so it
should be short, distinctive and represent the provider in the way
end users refer and think of it.¶
The mail client might concatenate either value with the email address, so these values should not be the email address.¶
Example:¶
<documentation url="https://www.example.com/help/mail/"> <descr lang="en">Configure mail app for IMAP</descr> <descr lang="de">Email mit IMAP konfigurieren</descr> </documentation>¶
RELAX NG:¶
documentation = element documentation {
attribute url { text },
descr* }
descr = element descr {
attribute lang { text }?, # 2-letter ISO language code
text }
¶
This is purely informational and not required for the automatic setup.¶
This element contains the end-user help webpage at the provider that describes the mail server settings. The configuration may be based on that page, but does not necessarily have to match it, e.g. when a better configuration is available than the one described on the webpage.¶
The url attribute contains the URL of the webpage. The <descr>
content describes the content and purpose of the page and why it's
referenced here.
Multiple <descr> elements with different lang attributes are
allowed, whereby the lang attribute contains the 2-letter ISO language
code, like the HTML lang attribute.¶
Example:¶
<oAuth2> <issuer>https://login.example.com</issuer> <authURL>https://login.example.com/auth</authURL> <tokenURL>https://login.example.com/token</tokenURL> <scope>IMAP POP3 SMTP CalDAV CardDAV WebDAV offline_access</scope> <clientID>open</clientID> </oAuth2>¶
RELAX NG:¶
oAuth2 = element oAuth2 {
( authURL | tokenURL | issuer | scope | clientID | clientSecret )* }
authURL = element authURL { text }
tokenURL = element tokenURL { text }
issuer = element issuer { text }
scope = element scope { text }
clientID = element clientID { text }
clientSecret = element clientSecret { text }
¶
Element <oAuth2> is within the root element.¶
It contains all necessary information to find and contact the OAuth2 authentication server to get an auth token, which can be used to log in directly to the servers marked with¶
<authentication>OAuth2</authentication>¶
See OAuth2 server requirements and OAuth2 client requirements.¶
<incomingServer type="jmap">, <calendar type="caldav"> etc.¶
RELAX NG:¶
serverSection =
attribute type { text }, # see the IANA registry
( url | hostname | port | socketType | authentication
| username )*
incomingServer = element incomingServer { serverSection }
outgoingServer = element outgoingServer { serverSection }
calendar = element calendar { serverSection }
addressbook = element addressbook { serverSection }
fileShare = element fileShare { serverSection }
chatServer = element chatServer { serverSection }
videoConference = element videoConference { serverSection }
setupServer = element setupServer { serverSection }
¶
The type attribute specifies the wire protocol that this server uses. See
type below.¶
<incomingServer> specifies the server that the mail client retrieves email
from and submits changes to. In many protocols, this server is also used for
sending email.¶
<outgoingServer> is used for sending, if <incomingServer> does not
support that directly.
This is currently used only for SMTP in combination with IMAP and POP3.¶
<incomingServer> and <outgoingServer> are within element
<emailProvider>, whereas <calendar>, <addressbook>, <fileShare>,
<chatServer>, <videoConference> and <setupServer> are within the
root element <clientConfig>, i.e. one level higher.
Other than that, they work the same.¶
In some protocols, the <incomingServer> server additionally provides
calendars, addressbooks, and other data. For such protocols, the same server
is not repeated in other specific server sections like <calendar>.
Calendar-only clients supporting such multi-purpose protocols MUST read the
<incomingServer> (notwithstanding that it's within legacy element
<emailProvider>)
and test and use the parts of the protocol needed for their
functionality.¶
Server sections of the same type (like <incomingServer> or <calendar>)
may appear multiple times in the same configuration file.
In this case, they are listed in the order of preference by the configuration provider.
The client should pick the first configuration that matches the client's requirements.¶
The client may choose a different order or ignore some configurations, because¶
the client doesn't support a higher-priority protocol, e.g. a JMAP configuration is listed first and is the most preferred, but the client does not support JMAP yet, or¶
the client doesn't support a configuration setting, e.g. it doesn't support STARTTLS, or the configuration specifies only an OAuth2 authentication and the client either doesn't implement OAuth2, or there is a problem in the OAuth2 flow with this provider, or¶
the client has a specific policy to prefer another configuration, e.g. a STARTTLS configuration is listed before a direct TLS configuration, and the client has a policy of preferring direct TLS, or likewise the client prefers IMAP over POP3.¶
Server types, elements and protocols that the client does not support MUST be ignored and the client MUST continue to parse the other server sections, which may contain configs that the client understands and supports. The client ignores the file only if there is no supported and working configuration found.¶
The type attribute on the server section element specifies the
wire protocol that this server uses.¶
| Element | Type | Base | Name | Specification |
|---|---|---|---|---|
| incomingServer |
jmap
|
URL | JMAP | [JMAP-Core], [JMAP-Mail], [JMAP-WebSocket], [JMAP-Contacts] et al |
| incomingServer |
imap
|
TCP | IMAP | [IMAP4rev2] or [IMAP4rev1], et al |
| incomingServer |
pop3
|
TCP | POP3 | [POP3], [POP3-SASL] |
| outgoingServer |
smtp
|
TCP | SMTP | [SMTP], [EMail] |
| calendar |
caldav
|
URL | CalDAV | [CalDAV] |
| addressbook |
carddav
|
URL | CardDAV | [CardDAV] |
| fileShare |
webdav
|
URL | WebDAV | [WebDAV] |
| chatServer |
xmpp
|
URL | XMPP | [XMPP], [XMPP-IM], [XMPP-WebSocket] |
| chatServer |
xmpp-tcp
|
TCP | XMPP | [XMPP], [XMPP-IM] |
| chatServer |
matrix
|
URL | Matrix | [Matrix] |
| setupServer |
managesieve
|
TCP | ManageSieve | [ManageSieve], [Sieve] |
| incomingServer |
ews
|
URL | Exchange Web Services | |
| incomingServer |
activesync
|
URL | ActiveSync | |
| incomingServer |
graph
|
URL | Microsoft Graph |
Other protocol names can be added using an IANA registry. See the corresponding section below.¶
<incomingServer type="jmap"> <url>https://jmap.example.com/session</url> <authentication system="http">Basic</authentication> <username>%EMAILADDRESS%</username> </incomingServer>¶
For server sections with protocols that are based on HTTPS or other URLs, the following elements are supported:¶
Example:¶
<url>https://jmap.example.com/session</url>¶
RELAX NG:¶
url = element url { text }
¶
The content of the <url> element contains the [URL] where to contact the server.¶
The URL scheme will normally be HTTPS and the URL starts with https:// ([HTTP], Section 4.2.2).
Some protocols may use other schemes, e.g. WebSockets wss:// ([WebSocket], Section 3).¶
Examples:¶
<authentication>OAuth2</authentication> <authentication system="http">Basic</authentication>¶
RELAX NG:¶
authentication = element authentication {
attribute system { text }?, # "http" or "sasl"
text }
¶
The content of the <authentication> element defines which HTTP
authentication method to use. The system="http" attribute
signals that the value refers to a WWW-Authenticate mechanism.¶
Basic: Authenticate to the HTTP server using
WWW-Authenticate: Basic. See [HTTP-Basic-Auth].¶
Digest: Authenticate to the HTTP server using
WWW-Authenticate: Digest. See [HTTP-Digest-Auth]¶
NTLM: Legacy Windows login mechanisms NTLM or NTLMv2,
potentially with a Negotiate before.¶
OAuth2: Authenticate to the HTTP server using
WWW-Authenticate: Bearer. See [OAuth2], Section 3.
The provider MUST adhere to the requirements defined in OAuth2 server requirements.¶
Note: The XML element for OAuth2 is
<authentication>OAuth2</authentication> without system attribute.
<authentication system="http">Bearer</authentication> is invalid.¶
The rules as specified in Multiple authentication alternatives and Authentication verification and fallback apply here as well.¶
For server sections with protocols that are based on TCP, the following elements are supported:¶
<incomingServer type="imap"> <hostname>imap.example.com</hostname> <port>993</port> <socketType>SSL</socketType> <authentication>password-cleartext</authentication> <username>%EMAILADDRESS%</username> </incomingServer>¶
Example:¶
<hostname>imap.example.com</hostname>¶
RELAX NG:¶
hostname = element hostname { text }
¶
The content of the <hostname> element contains the fully qualified hostname
of the server.¶
Example:¶
<port>993</port>¶
RELAX NG:¶
port = element port { xsd:positiveInteger } # TCP port, 1-65535
¶
The content of the <port> element is an integer and contains the TCP port
number at the hostname. The port is typically specific to the combination of
the wire protocol and socketType.¶
Example:¶
<socketType>SSL</socketType>¶
RELAX NG:¶
socketType = element socketType { text }
¶
The content of the <socketType> element specifies whether to use direct TLS,
STARTTLS, or none of these.¶
SSL: Directly contact the TCP port using TLS. TLS version 1.2
[TLSv1.2]
or higher SHOULD be used. Higher versions may be required based on security
situation, server support, and client policy decisions.¶
STARTTLS: Contact the TCP port first using an unencrypted plain socket,
then upgrade to TLS using the protocol-specific STARTTLS specification
[STARTTLS]. With this configuration,
STARTTLS MUST be used and TLS MUST be used after the STARTTLS upgrade. If
the upgrade to TLS fails for whatever reason, the client MUST
disconnect and MUST NOT try to authenticate. This prevents downgrade attacks
that could otherwise steal passwords, user data, and impersonate users.¶
plain: Unencrypted connection, with neither TLS nor STARTTLS. May be
needed for local servers. Deprecated.¶
In all cases where TLS is used, either directly or using STARTTLS, the client MUST validate the TLS certificate and ensure that the certificate is valid for the hostname given in this configuration. If not, or if the TLS certificate is otherwise invalid, the client MUST either disconnect or MAY warn the user of the dangers and ask for user confirmation. Such fallback with warning and confirmation is allowed only at original configuration and MUST NOT be allowed during normal everyday connection.¶
If the server had a valid TLS certificate during original configuration and the TLS certificate is later invalid during normal connection, the client MUST disconnect.¶
As an exception, if the problem is that the TLS certificate expired recently, the client MAY choose to not consider that a failure during normal connection and MAY use other recovery mechanisms.¶
Example:¶
<authentication>password-cleartext</authentication>¶
RELAX NG:¶
authentication = element authentication {
attribute system { text }?, # "http" or "sasl"
text }
¶
The content of the <authentication> element defines which authentication
method to use. This can be either an authentication defined by the wire
protocol, or a SASL scheme, or a successor to SASL.¶
password-cleartext: Send password in the clear.
Uses either the native authentication method defined by the wire protocol
(if that is based on plaintext passwords), or a SASL authentication scheme
like SASL PLAIN or SASL LOGIN, or a successor.¶
password-encrypted: An encrypted or hashed password mechanism.
Includes SASL CRAM-MD5 [CRAM-MD5],
DIGEST-MD5 [DIGEST-MD5],
SCRAM-SHA-256-PLUS [SCRAM], and successors.
TLS by itself does not qualify as password-encrypted.¶
NTLM: Legacy Windows login mechanisms NTLM or NTLMv2.¶
GSSAPI: [Kerberos] or [GSSAPI],
a single sign-on mechanism based on TCP.¶
TLS-client-cert: On the SSL/TLS layer, after server request, the client
sends a TLS client certificate for the user, possibly after letting the user
select or confirm it. Uses SASL EXTERNAL scheme [SASL], Appendix A.¶
OAuth2: SASL OAUTHBEARER [SASL-OAuth2] (current) or
XOAUTH2 (deprecated) or successors.
The provider MUST adhere to the requirements defined in OAuth2 server requirements.¶
client-IP-address: The server can be used without any explicit authentication,
and the client is admitted based on its IP address.
This may be the case for some SMTP servers on local networks.
Not supported on the Internet. Deprecated, because it breaks mobile devices.¶
Example:¶
<authentication system="sasl">SCRAM-SHA-256-PLUS</authentication>¶
A specific SASL scheme [SASL] MAY be specified using
the specific SASL authentication scheme name, e.g.
SCRAM-SHA-256-PLUS [SCRAM]. To signal that, the
<authentication> element MUST have the system attribute set
to value sasl, i.e. <authentication system="sasl">.¶
In such a case, the server configuration section should also specify a more generic authentication mechanism as a lower priority alternative. Clients that support the specific authentication mechanism will use that, and other clients will use the more generic authentication mechanism. Without such fallback, the latter clients would fail.¶
The <authentication> element may appear multiple times within a server
section. In this case, they are ordered from the most to the least preferred
method, based on the policy of the provider.¶
If a client does not support a
specific authentication scheme, or does not have the conditions to use it,
e.g. the client does not have a Client ID for this OAuth2 server, then the
client MUST skip this <authentication> element and use the next in the list
instead.¶
If none of the authentication methods are supported by the client, the client MUST ignore that server section and use the remaining server sections.¶
The client should test the configuration during setup, with an actual authentication attempt.¶
If the authentication fails, the client decides based on the authentication error code how to proceed. For example, if the authentication method itself failed, or the error code indicates a systemic failure, the client should use a lower-priority authentication method from the list.¶
If the authentication method is working, but the error code indicated that the username or password was wrong, then the client MAY ask the user to correct the password.¶
For that reason, the server should be specific in the error codes and allow the client to distinguish between¶
an unsupported or non-working authentication method or other systemic failures¶
the client being rejected by the server¶
the user being blocked from login¶
the user authentication failing due to wrong password or username¶
other reasons¶
If the server were to return the same error code for all these cases, the client might tell the user that the password is wrong, and the user starts attempting other passwords, potentially revealing passwords to other higher-value assets, which is highly dangerous.¶
If the authentication succeeded, the client MUST remember the working configuration and use that for all subsequent connections, until an explicit reconfiguration occurs. During normal everyday operation, the client SHOULD NOT fall back nor attempt multiple different authentication methods. See Configuration updates for the reasons.¶
The <username> value may contain placeholders.¶
The following special substrings in the value MUST be replaced by the client, before the value is actually used.¶
| Placeholder | Replace with | Example |
|---|---|---|
%EMAILADDRESS%
|
Email address of the user |
fred@example.com
|
%EMAILLOCALPART%
|
Part before @ in the email address |
fred
|
%EMAILDOMAIN%
|
Part after @ in the email address |
example.com
|
Some clients MAY also support the same placeholders for the fields
<hostname>, <url>, <authURL>, <tokenURL>, <issuer>,
<displayName> and <displayShortName>.¶
If the XML syntax is invalid, the client MUST ignore the entire file. In contrast, if there are merely unknown elements or attributes, the client MUST NOT ignore the file.¶
The client MUST disregard those elements, attributes and values that it does not
support. The presence of unknown elements, attributes or values MUST NOT result
in an error. Instead, they are simply ignored and treated as if they don't
exist. Compare the rules for <authentication> elements in Multiple authentication alternatives. If a
server section then becomes invalid due to missing information, only that server section
is ignored and the other server sections will still be processed. Only if no valid
configuration is found in the document, the document as a whole is ignored, but other
retrieval mechanisms might produce a different document with a valid configuration.¶
This allows future extensions of the format without breaking existing clients.¶
The RELAX NG schema is written to follow these rules: it accepts unknown elements, attributes, attribute values and element values, so that a validator does not reject a document merely because it uses extensions not defined here.¶
The mail client application, when it needs the configuration for a given email address, will perform several steps to retrieve the configuration from various sources.¶
The steps are ordered by priority. They may all be requested at the same time, but a higher priority result that is available should be preferred over a lower priority one, even if the lower priority one is available earlier. Exceptions apply when a higher priority result is either invalid or outdated, e.g. it doesn't work anymore, or the fetch method is less secure, according to the client's assessment. Lower priority requests MAY be cancelled, if a valid higher priority result has been successfully received. The priority is expressed below with the number before the URL or location, with lower numbers meaning higher priority, e.g. 1.2 has higher priority than 4.1.¶
In the URLs below, %EMAILADDRESS% SHALL be replaced with the email address
that the user entered and wishes to use, and %EMAILDOMAIN% SHALL be replaced
with the email domain extracted from the email address. For example, for
fred@example.com, the email domain is example.com, and for
fred@test.cs.example.net, the email domain is test.cs.example.net.¶
For full support of this specification in clients, all "Required" and "Recommended" mechanisms MUST be implemented and working. For partial support of this specification in clients, all "Required" mechanisms MUST be implemented and working, and in this case, the implementor SHALL make explicit when advertising or referring to AutoConfig that there is only partial support of this specification.¶
In servers, at least URL 1.1. MUST be implemented and working. If the email address parameter is not passed by the client, the server MUST return a configuration that works for all accounts or at least for a large part of accounts.¶
The first step is to directly ask the mail provider and allow it to return the configuration. This step ensures that the protocol is decentralized and the mail provider is in control of the configuration issued to mail clients.¶
1.1. https://autoconfig.%EMAILDOMAIN%/.well-known/client-autoconfig.xml?emailaddress=%EMAILADDRESS% (Required)¶
1.2. https://autoconfig.%EMAILDOMAIN%/mail/config-v1.1.xml?emailaddress=%EMAILADDRESS% (Deprecated, but deployed)¶
1.3. https://%EMAILDOMAIN%/.well-known/autoconfig/mail/config-v1.1.xml (Deprecated, but deployed)¶
1.4. http://autoconfig.%EMAILDOMAIN%/mail/config-v1.1.xml (Deprecated, but deployed)¶
The emailaddress URL parameter is Optional.¶
For example:¶
1.1. https://autoconfig.example.com/.well-known/client-autoconfig.xml?emailaddress=fred@example.com¶
1.2. https://autoconfig.example.com/mail/config-v1.1.xml?emailaddress=fred@example.com¶
1.3. https://example.com/.well-known/autoconfig/mail/config-v1.1.xml¶
1.4. http://autoconfig.example.com/mail/config-v1.1.xml¶
URL 1.1. follows [RFC8615] for well-known URLs. Servers adhering to this version of the specification MUST support URL 1.1 and MUST have a valid TLS certificate for that hostname.¶
URLs 1.2., 1.3. and 1.4. were used in the original protocol from around 2008, before [RFC8615] and predecessors existed.¶
URL 1.4. is used by many current deployments, particularly email hosting companies that use DNS CNAME to redirect the customer email domain to a central provider AutoConfig server, which has a TLS certificate only for the provider domain and not every customer domain. Although HTTP is insecure, a large number of existing domains use it at the time of this writing, and ignoring it may lead to no result for many domains. Implementors need to balance this risk with the alternatives like guessing hostnames or users searching the Internet. Security Considerations contains more detail on what an implementor needs to consider.¶
To allow the mail provider to return a configuration adjusted for that mailbox, the client sends the email address as query parameter in URL 1.1.¶
For example, a global company might want to locate the mailbox geographically close to the user, in the same country or even in the same office building.¶
However, while the protocol allows for such heterogeneous configurations, mail providers are discouraged from doing so, and are instead encouraged to provide one single configuration for all their users. For example, DNS resolution based on location, mail proxy servers, or other techniques as necessary, can be used to route the traffic and host the mail efficiently.¶
This mechanism also allows the AutoConfig server to map the email address to a username that cannot be expressed using the Placeholders (see Section 3.6). However, this method is discouraged. Instead, the email server login should accept email addresses as username, and do the mapping to internal usernames at login time, which avoids the need for the client to know a different username.¶
AutoConfig servers that customize the returned configuration file to the email address should prevent email addresses from being tested for validity by hostile parties like spammers or attackers.¶
Returning an error or a fake configuration for non-existing email addresses would allow the attacker to differentiate valid email addresses. A mitigation is to answer requests for non-existing email addresses with a random configuration from the set of valid configurations.¶
A static configuration that works for all users is the preferred deployment method.¶
The ISPDB (Internet service provider database) is a central database that contains the configurations for large mail providers.¶
This is a useful fallback that allows mail clients to support mail providers which do not host a configuration server described in the previous step. This step is often necessary to find a working configuration for many email accounts.¶
The mail client application chooses the mail configuration database provider. A
public mail configuration database is available at base URL https://v1.ispdb.net/.¶
%ISPDB% below is the base URL of that database.¶
2.1. %ISPDB%%EMAILDOMAIN% (Recommended)¶
For example:¶
Many companies do not maintain their own mail server, but let their email be hosted by a hosting company, which is then responsible for the email of dozens or thousands of domains. For these hosters, it may be difficult to set up the configuration server (step 1.1.) with valid TLS certificate for each of their customers, and to convince their customers to modify their root DNS specifically for AutoConfig. On the other side, the ISPDB can only contain the hosting company and cannot know all their customers. To handle such domains, the protocol first needs to find the server hosting the email.¶
If the previous mechanisms yield no result, the client performs a DNS MX lookup on the email domain, and retrieves the MX server (incoming SMTP server) for that domain. Only the highest priority MX hostname is considered. From that MX hostname, two values are extracted:¶
Extract only the second-level domain from the MX hostname, and use that as
value for %MXBASEDOMAIN%. To determine the second-level domain, use the
Public Suffix List or a similarly suited method,
to correctly handle domains like .co.uk and .com.au.¶
Remove the first component from the MX hostname, i.e. everything up to and
including the first ., and use that as value for %MXFULLDOMAIN%. Use it
only if it is longer than %MXBASEDOMAIN%.¶
For example:¶
For mx.example.com, the MXFULLDOMAIN and MXBASEDOMAIN are both
example.com.¶
For mx.example.co.uk, the MXFULLDOMAIN and MXBASEDOMAIN are both
example.co.uk.¶
For mx.premium.europe.example.com, the MXFULLDOMAIN is
premium.europe.example.com and the MXBASEDOMAIN is example.com.¶
Then, attempt to retrieve the configuration for these MX domains, using the previous methods, starting with:¶
3.1. https://autoconfig.%MXFULLDOMAIN%/.well-known/client-autoconfig.xml?emailaddress=%EMAILADDRESS% (Required)¶
3.2. https://autoconfig.%MXBASEDOMAIN%/.well-known/client-autoconfig.xml?emailaddress=%EMAILADDRESS% (Recommended)¶
3.3. https://autoconfig.%MXFULLDOMAIN%/mail/config-v1.1.xml?emailaddress=%EMAILADDRESS% (Deprecated, but deployed)¶
3.4. https://autoconfig.%MXBASEDOMAIN%/mail/config-v1.1.xml?emailaddress=%EMAILADDRESS% (Deprecated, but deployed)¶
3.5. %ISPDB%%MXFULLDOMAIN% (Recommended)¶
3.6. %ISPDB%%MXBASEDOMAIN% (Recommended)¶
The emailaddress URL parameter is Optional.¶
For example:¶
3.1. https://autoconfig.premium.europe.example.com/.well-known/client-autoconfig.xml?emailaddress=fred@example.com¶
3.2. https://autoconfig.example.com/.well-known/client-autoconfig.xml?emailaddress=fred@example.com¶
3.3. https://autoconfig.premium.europe.example.com/mail/config-v1.1.xml?emailaddress=fred@example.com¶
3.4. https://autoconfig.example.com/mail/config-v1.1.xml?emailaddress=fred@example.com¶
3.5. https://v1.ispdb.net/premium.europe.example.com¶
3.6. https://v1.ispdb.net/example.com¶
For testing purposes, a mail client may want to define a location on the disk, relative to the application installation directory, or relative to the user configuration directory, which may contain a configuration file for a specific domain, and which the mail client will use, if the above methods fail.¶
4.1. %USER_CONFIGURATION_DIR%/isp/%EMAILDOMAIN%.xml (Optional)¶
4.2. %APP_INSTALL_DIR%/isp/%EMAILDOMAIN%.xml (Optional)¶
For example:¶
A mail client may want to implement other mechanisms to find a configuration, for example Exchange AutoDiscover, DNS-SRV [RFC6186], or heuristic guessing. If the mail client implements such alternative methods, and if they are less secure than some of the mechanisms provided here, the alternative methods SHOULD be considered only with lower priority (as defined above) than the more secure mechanisms defined here. For evaluating other mechanisms, use similar criteria as outlined in Security Considerations.¶
If the above mechanisms fail to provide a working configuration, or if the user explicitly chooses so, the mail client should give the end user the ability to manually enter a configuration, and use that configuration to configure the account.¶
Independent of the mechanisms used to find the configuration, before using that configuration, the mail client SHOULD display that configuration to the end user and let him confirm it. This is an important security precaution (Section 7), a client not asking for user approval needs to consider all security properties.¶
When displaying the configuration for approval:¶
At least the second-level domain name(s) of the hostnames involved MUST be shown clearly and with high prominence.¶
To avoid spoofing, the client MUST NOT cut off parts of long second-level domains. At least 63 characters MUST be displayed.¶
Care should be taken with international characters that look like ASCII characters, but have a different code.¶
After the user confirmed the configuration, the mail client should test the configuration, by attempting a login to each server configured. Only if the login succeeded, and the server is working, should the configuration be saved and retrieving and sending mail be started.¶
If the configuration contains OAuth2 authentication, or any other kind of authentication that uses a web browser with URL redirects, the mail client MUST show the full URL or the second-level domain of the current page to the end user, at all times, including after page changes, URL changes, or redirects. The authentication start URL may be the email hoster, but it redirects to a corporate server for login, and then back to the hoster. This allows for setups where the hoster is not allowed to see the plaintext passwords.¶
Showing the URL or hostname allows the end user to verify to be at the expected page while logging in, e.g. the login server of their company, instead of the email hoster's page. It is important that the user verifies to enter the password on the right domain.¶
The client can decide whether to¶
use the <issuer> to fetch the OAuth2 server metadata using [RFC8414]
(e.g. <issuer>/.well-known/oauth-authorization-server, see spec for issuer with path) or
OpenID Connect Discovery [OpenIDConnect] (e.g. <issuer>/.well-known/openid-configuration)
and get the authorization_endpoint and token_endpoint values and
other parameters from that JSON document,
and compare the issuer value as specified by [RFC8414], or¶
use the <authURL> and <tokenURL> from this AutoConfig document, or¶
combine both methods and verify that the URLs match.¶
Not all OAuth2 servers publish the metadata according to [RFC8414] or OpenID Connect Discovery [OpenIDConnect].¶
Particular care must be taken when authURL and tokenURL are on different hostnames,
because it means that a user might be logging in at the correct login page, the app
gets the auth code from the real auth server, and then sends the working auth code
to the tokenURL server run by an attacker.
The client application must handle this case with particular caution,
e.g. by warning the user or aborting.
Currently, one large mail provider uses such a split configuration,
which could be worked around by hardcoding a whitelist or other methods.¶
Either way, the client MUST check whether both the authURL and the tokenURL
match either the email address domain or the server domain,
and if not, MUST show that OAuth2 domain to the end user while the end user
approves the servers (Section 5.1), or alternatively abort the process.¶
Mail service providers who want to support this specification and publish the mail configuration for their own mail service, so that mail client apps can be automatically configured, MUST follow this section as guideline and MUST respect the definitions in this specification.¶
Configuration fields MUST NOT contain invalid or non-working configuration data.¶
The provided configuration MUST be working, and SHOULD use state-of-the-art security.¶
Configurations MUST be public and MUST NOT require authentication (see below).¶
The configuration file should be published at the URL for step 1.1., i.e.¶
https://autoconfig.%EMAILDOMAIN%/.well-known/client-autoconfig.xml¶
e.g. for fred@example.com¶
https://autoconfig.example.com/.well-known/client-autoconfig.xml¶
For mail providers which host entire domains for their business customers, the same URL 1.1., as listed in the previous section, is recommended.¶
If that URL is not used, the configuration file should be published at the locations for step 3.1. and 3.2., i.e.¶
https://autoconfig.%MXFULLDOMAIN%/.well-known/client-autoconfig.xml¶
https://autoconfig.%MXBASEDOMAIN%/.well-known/client-autoconfig.xml¶
For example, if the MX server for customer domain example.net is
mx.premium.europe.example.com, then the configuration file should be at both¶
https://autoconfig.premium.europe.example.com/.well-known/client-autoconfig.xml¶
https://autoconfig.example.com/.well-known/client-autoconfig.xml¶
If the MX server hostname is directly in the email domain, e.g. mail.example.com,
then URL 3.1 would of course be the same URL as 3.2.¶
Any of the above URLs for retrieving the configuration file MUST NOT require authentication, but MUST be public.¶
This is because the configuration information in the AutoConfig file
includes the authentication method. Without the AutoConfig file,
the client does not know which authentication method is required and
which username form to use
(e.g. username fred or fred@example.com or fred\EXAMPLE).
Given that this information is required for authentication,
the AutoConfig file itself cannot require authentication.¶
If OAuth2 is used, the OAuth2 server MUST adhere to the [OAuth2Client] specification, including all SHOULD requirements. However, given that¶
are provided in the AutoConfig response, the steps "Fetching the Authorization Server Metadata" and "Dynamic Client Registration" as well as scope names MAY be skipped in favor of the values in the AutoConfig response. What stays in force from [OAuth2Client] are the remaining guarantees in the [OAuth2Client] specification that the OAuth2 server gives to the mail client, including refresh token validity times.¶
The provider MUST allow any client application that acts on behalf of the end user who the mailbox is for. Failure to do so implies a cartel or monopolistic behavior to lock out competing email applications from fulfilling their purpose on behalf of end users, which may be contrary to laws in multiple countries.¶
The OAuth2 server MUST¶
accept the client ID that is given in the configuration file, or if that is not given,¶
implement Dynamic Client Registration [RFC7591] or [CMID] in the way as defined by [OAuth2Client] and accept the resulting Client ID,¶
without client secret. It MAY support multiple of those methods.¶
The server MUST NOT employ any methods at any point to block or hinder client applications that are acting on behalf of end users.¶
The specifications above contain requirements for expiry times and the login page, which are needed for mail client applications to work, and MUST be followed.¶
The OAuth2 scope MUST include all services defined in this configuration file, so that a single user login is sufficient for all services. The resulting refresh and access tokens MUST be valid for all services defined in the configuration file, including for all URL-based protocols like CalDAV and all TCP-based protocols like IMAP.¶
If an attacker can provide a forged configuration, the provided mail hostname and authentication server can be controlled by the attacker, and the attacker can get access to the plain text password of the user. The attack can be implemented as man-in-the-middle, so the end user might receive mail as expected and never notice the attack.¶
An attacker gaining the plain text password of a real user is a very significant threat for the organization, not only because mail itself can contain sensitive information and can be used to issue orders within the organization that have wide-ranging impact, but given single-sign-on solutions, the same username and password may give access to other resources at the organization, including other computers or, in the case of admin users, even administrative access to the core of the entire organization.¶
Multi-factor authentication might not defend against such attacks, because the user may believe to be logging into his email and therefore comply with any multi-factor authentication steps required.¶
Any protocol that relies on DNS without further validation, e.g. HTTP or DNS SRV, should be considered insecure. This also applies to the MX lookup and the HTTPS calls that are based on its results.¶
One possible mitigation is to use multiple different DNS servers and verify that the results match, e.g. to use the native DNS resolver of the operating system, and additionally also query a hardcoded DoH (DNS over HTTPS) server.¶
Nonetheless, the result should be used with care. If such configs are used, the end user MUST explicitly confirm the configuration, particularly the resulting second-level domains. See User approval.¶
HTTP requests may be intercepted, redirected, or altered at the network level. See Risk above. Even if an http: URL redirects to an https: URL, that is still insecure.¶
For that reason, clients MUST prefer HTTPS (URLs 1.1. to 1.3.) over HTTP (URL 1.4.) during configuration retrieval, within the same retrieval method.¶
If such configs from HTTP are used, the end user MUST explicitly confirm the configuration, particularly the resulting second-level domains. See User approval.¶
As mentioned above (Section 7.2), DNS SRV suffers from similar weaknesses.¶
Part of the security properties of this protocol assume that the timeframe of possible attack is limited to the moment when the user manually sets up a new mail client. This moment is triggered by the end user, and a rare action - e.g. maybe once per year or even less, for typical setups -, so an attacker has limited chances to run an attack. While not a complete protection on its own, this reduces the risk significantly.¶
However, if the mail client does regular configuration updates using this protocol, this security property is no longer given. For regular configuration updates, the mail client MUST use only mechanisms that are secure and cannot be tampered with by an active attacker. Furthermore, the user should still approve configuration changes.¶
But even with all these protections implemented, the mail client vendor should make a security assessment for the risks of making such regular updates. The mail client vendor should consider that servers can be hacked, and most users simply approve changes proposed by the app, so these give only a limited protection.¶
Given that mail clients will trust the configuration, the server delivering the configuration file needs to be secure. A static web server offers better security. The server software should be updated regularly and hosted on a dedicated secure server with all unnecessary services and server features turned off.¶
For the Central database, additions and modifications to the configurations are applicable to all respective users and must be made with care. The authenticity of the configuration MUST be verified from authoritative sources. Server hostnames MUST be compared with the email domain names they are serving, and if they differ, the ownership of the server hostnames MUST be validated.¶
The risk is mitigated to some degree by User approval.¶
If the provider returns different configurations based on the emailaddress
parameter of the URL, then attackers can find out whether a given email address is valid.
See Section 4.1.2 for mitigations.
It is recommended to return the same configuration for all users, which avoids this problem.¶
If rate-limits are used, the limits should be high enough for at least 100 requests per minute from the same client, given that normal clients routinely make 10 or more requests at once, and might repeat that process multiple times after user mistakes or configuration errors.¶
A static configuration file served by a static web server is recommended.¶
IANA will create the following registry in a new registry group called "Mail AutoConfig":¶
Registry Name: "AutoConfig Protocol Type Names"¶
Registration Procedure: Specification Required, per [RFC8126], Section 4.6¶
Designated Expert: The author of this document.¶
Table, with fields Element (alphanumeric), Type (alphanumeric), Base (URL or TCP or URL/TCP), Name, Specification, and Additional Elements¶
The registrations need to define:¶
Element: The XML element wrapping the server section.¶
Type: The type attribute value of the server section.¶
Base: Whether the protocol is URL-based or TCP-based,¶
Name: The commonly used name of the protocol¶
Specification: Which RFCs or document specifies the protocol, and¶
Additional Elements: (Optional) Protocol-specific XML elements and their meaning.¶
| Element | Type | Base | Name | Specification | Additional Elements |
|---|---|---|---|---|---|
| incomingServer |
jmap
|
URL | JMAP | RFC 8620, RFC 8621, RFC 8887, RFC 9610 et al | |
| incomingServer |
imap
|
TCP | IMAP | RFC 9051 or RFC 3501, et al | |
| incomingServer |
pop3
|
TCP | POP3 | RFC 1939, RFC 5034 | |
| outgoingServer |
smtp
|
TCP | SMTP | RFC 5321, RFC 5322 | |
| calendar |
caldav
|
URL | CalDAV | RFC 4791 | |
| addressbook |
carddav
|
URL | CardDAV | RFC 6352 | |
| fileShare |
webdav
|
URL | WebDAV | RFC 4918 | |
| chatServer |
xmpp
|
URL | XMPP | RFC 6120, RFC 6121, RFC 7395 | |
| chatServer |
xmpp-tcp
|
TCP | XMPP | RFC 6120, RFC 6121 | |
| chatServer |
matrix
|
URL | Matrix | https://spec.matrix.org | |
| setupServer |
managesieve
|
TCP | ManageSieve | RFC 5804, RFC 5228 | |
| incomingServer |
ews
|
URL | Exchange Web Services | ||
| incomingServer |
activesync
|
URL | ActiveSync | ||
| incomingServer |
graph
|
URL | Microsoft Graph |
The Additional Elements field is empty in all of the initial values.¶
Due to their top-level domain, some domains do not have [DNSSEC] available to them, even if they would like to deploy it.¶
Even where the top-level domain supports it, DNSSEC is currently deployed in only 1% of domains, with adoption rates falling instead of rising, due to the difficulties of administrating it correctly.¶
Therefore, DNSSEC cannot be relied on in this specification, and DNS must be considered insecure for the purposes of this specification.¶
DNS SRV protocols [DNS-SRV] [RFC6186] are not used here, for two reasons:¶
DNS SRV relies on insecure DNS and the configuration can therefore be trivially spoofed by an attacker. See also DNSSEC above.¶
DNS SRV does not provide all the necessary configuration parameters. For example, we need all of:¶
the username form (fred@example.com, or fred, or fred\EXAMPLE, or even
a username with no relation to the email address)¶
authentication method (password, CRAM-MD5, OAuth2, SSL client certificate)¶
authentication method parameters (e.g. OAuth2 parameters)¶
and other parameters. If any of these parameters are not configured right, the configuration won't work. While these parameters could theoretically be added to DNS SRV, that would mean a new specification and render the idea void that this is a protocol that already exists, is standardized and deployed. It is unlikely that all DNS SRV records would be updated with the new values. Therefore, it does not solve the problem.¶
This specification was created as an answer to these deficiencies and provides an alternative to DNS SRV.¶
Deployments in the wild from actual ISPs show that protocol-specific commands
to find available authentication methods, e.g. IMAP CAPABILITY or POP3
CAPA, are not reliable. Many email servers advertise authentication methods
that do not work.¶
Some IMAP servers are default configured to list all SASL authentication methods that have corresponding libraries installed on the system, independent of whether they are actually configured to work. The client receives a long list of authentication methods, and many of them do not work. Additionally, the server response may be only "authentication failed" and may not indicate whether the method failed due to lack of configuration, or because the password was wrong. Because some authentication servers lock the account after 3 failed login attempts, and it may also fail due to unrelated reasons (e.g. username form, wrong password, etc.), the client cannot blindly issue countless login attempts. Locking the account must be avoided. So, simply attempting all methods and seeing which one works is not an option for the email client.¶
Additionally, some email servers advertise [Kerberos] / [GSSAPI], but when trying to use it, the method fails, and also runs into a long 2 minute timeout in some cases. End users consider that to be a broken app.¶
Additionally, such commands are protocol specific and have to be implemented in multiple different ways.¶
Finally, some non-mail protocols may not support capabilities commands that include authentication methods.¶
Currently, this protocol or parts of it have been implemented by:¶
and likely other mail clients.¶
At the time of this writing, this specification is the most widely supported protocol for email client configuration. A large number of email domains use AutoConfig to provide the configuration to mail clients and allow an automatic setup.¶
Some mail servers automatically provide AutoConfig files that follow this specification, including Stalwart, Mailcow and many others.¶
This appendix specifies the RELAX NG compact syntax [RELAXNG] for the configuration file format defined in this document. It is provided for the convenience of implementers and not normative. Where the schema and the body of this document disagree, the body of this document is normative.¶
The schema deliberately implements the must-ignore rule of XML validation: it accepts unknown attributes, unknown child elements, and unknown attribute and element values, instead of rejecting them. This is achieved by:¶
using text for the content of every value-bearing element, so that values
that are not defined here still validate, for example a future socketType or
authentication method. The values defined by this document
are listed in comments next to the corresponding patterns¶
allowing any attribute whose name is not defined for a given element, using
the attribute * - (...) and attribute * { text } patterns¶
allowing any element whose name is not defined by this schema, at every
extension point, using the extensionElement pattern.¶
Known elements are still validated against their own definitions. A malformed
known element (for example, a <port> whose content is not an integer) makes
that element invalid, and therefore its enclosing server section is invalid as well.
The remaining server sections and the rest of the document are still processed.
A document is rejected as a whole only when it is not well-formed XML.¶
The fragments shown in the body of this document are excerpts of the grammar below. The grammar below additionally carries the wildcards that implement the must-ignore rule.¶
# RELAX NG compact syntax schema for the Mail AutoConfig configuration file.
#
# This schema implements the must-ignore rule of Section "XML validation":
# unknown attributes, unknown child elements and unknown values are accepted
# rather than being rejected, so that clients can ignore them.
default namespace = ""
datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"
start = clientConfig
# --- Wildcards used to implement the must-ignore rule -----------------------
# Any attribute (used on elements that define no attributes of their own).
anyAttr = attribute * { text }
# Any element at all, with any attributes and any content. Used inside
# foreign (extension) subtrees, where everything is unknown and ignored.
anyElement = element * { ( anyAttr | text | anyElement )* }
# Any element whose name is NOT defined by this schema. Placed at every
# extension point so that unknown elements validate, while known elements
# are still matched (and validated) by their own patterns.
extensionElement =
element * - ( clientConfig | emailProvider | domain | displayName
| displayShortName | documentation | descr | incomingServer
| outgoingServer | calendar | addressbook | fileShare
| chatServer | videoConference | setupServer | url | hostname
| port | socketType | authentication | username | oAuth2
| authURL | tokenURL | issuer | scope | clientID | clientSecret
| clientConfigUpdate ) {
( anyAttr | text | anyElement )*
}
# --- Global structure -------------------------------------------------------
clientConfig =
element clientConfig {
attribute version { text }, # e.g. "1.1" or "1.2"
( attribute * - version { text } )*,
( emailProvider | calendar | addressbook | fileShare | chatServer
| videoConference | setupServer | oAuth2 | clientConfigUpdate
| extensionElement )*
}
emailProvider =
element emailProvider {
attribute id { text },
( attribute * - id { text } )*,
( domain | displayName | displayShortName | documentation
| incomingServer | outgoingServer | extensionElement )*
}
domain =
element domain {
attribute purpose { text }?, # the only defined value is "mx"
( attribute * - purpose { text } )*,
text
}
displayName = element displayName { anyAttr*, text }
displayShortName = element displayShortName { anyAttr*, text }
documentation =
element documentation {
attribute url { text },
( attribute * - url { text } )*,
( descr | extensionElement )*
}
descr =
element descr {
attribute lang { text }?, # 2-letter ISO language code
( attribute * - lang { text } )*,
text
}
# --- Server sections --------------------------------------------------------
#
# incomingServer, outgoingServer, calendar, addressbook, fileShare,
# chatServer, videoConference and setupServer all share the same body.
# Every child element is optional and may appear in any order; a section
# that lacks the information needed for its protocol is simply ignored by
# the client (Section "XML validation").
serverSection =
attribute type { text }, # see the IANA registry
( attribute * - type { text } )*,
( url | hostname | port | socketType | authentication | username
| extensionElement )*
incomingServer = element incomingServer { serverSection }
outgoingServer = element outgoingServer { serverSection }
calendar = element calendar { serverSection }
addressbook = element addressbook { serverSection }
fileShare = element fileShare { serverSection }
chatServer = element chatServer { serverSection }
videoConference = element videoConference { serverSection }
setupServer = element setupServer { serverSection }
# --- Server child elements --------------------------------------------------
url = element url { anyAttr*, text }
hostname = element hostname { anyAttr*, text }
port = element port { anyAttr*, xsd:positiveInteger } # 1-65535
socketType = element socketType { anyAttr*, text } # "SSL" / "STARTTLS" / "plain"
username = element username { anyAttr*, text }
authentication =
element authentication {
attribute system { text }?, # "http" or "sasl"
( attribute * - system { text } )*,
text # e.g. "password-cleartext", "OAuth2"
}
# --- OAuth2 -----------------------------------------------------------------
oAuth2 =
element oAuth2 {
anyAttr*,
( authURL | tokenURL | issuer | scope | clientID | clientSecret
| extensionElement )*
}
authURL = element authURL { anyAttr*, text }
tokenURL = element tokenURL { anyAttr*, text }
issuer = element issuer { anyAttr*, text }
scope = element scope { anyAttr*, text }
clientID = element clientID { anyAttr*, text }
clientSecret = element clientSecret { anyAttr*, text }
# --- Configuration update ---------------------------------------------------
clientConfigUpdate =
element clientConfigUpdate {
attribute url { text },
( attribute * - url { text } )*,
( extensionElement )*
}
¶