Client auto-configuration
Mail clients can find Kantoor's servers from an email address. This page says what Kantoor answers, on which paths, and which settings decide the answer. What a user does with it is in Mail clients; the DNS records that lead a client here are in DNS records.
What was tried. Thunderbird's and DAVx5's discovery requests were replayed by script against the authors' live installation on 13 November 2026 (33 checks, all passed), and GNOME Evolution's own discovery library found the collections there. No real Thunderbird, Outlook, iOS or macOS device has been pointed at these answers; see Status and roadmap.
Kantoor answers the Thunderbird-style autoconfig document at
/.well-known/autoconfig/mail/config-v1.1.xml and /mail/config-v1.1.xml
(Thunderbird, GNOME Evolution, KMail, K-9). The names and ports it tells clients are the
PUBLIC ones (what your proxy exposes), so they are configuration, never guessed from the
container's listener ports. The user name it advertises is always the full email address.
Without a configured mail server the path answers 404.
The same servers (Kantoor.Autoconfig is the single source) are also served as:
- Outlook Autodiscover (POX,
outlook/responseschema/2006a):POST(andGET) on/autodiscover/autodiscover.xml,/Autodiscover/Autodiscover.xmland/AutoDiscover/AutoDiscover.xml; IMAP, POP3 (when configured) and SMTP entries, user name the full address.GET /autodiscover/autodiscover.json?Email=..&Protocol=AutodiscoverV1(also in the other two capitalisations) answers the v2 redirect to the XML document; any other v2 protocol is400, because v2 cannot describe IMAP. The request body is limited to 8 KiB and is never run through an XML parser (no DTD, no entities). - Apple configuration profile:
GET /.well-known/apple/mail.mobileconfig?emailaddress=...(public; only the shape of the address is checked, it never says whether an account exists) andGET /settings/apple-profile.mobileconfig(signed in; linked from Settings, App passwords). The profile is unsigned, holds no password, and its CalDAV/CardDAV host is the web host (PHX_HOST,PHX_SCHEME/port as the endpoint URL says).
These answer 404 when no mail server is configured, and are limited per client IP
(120 requests a minute; config :kantoor, :rate_limits, %{discovery: {n, seconds}}).
| Variable | Default | Meaning |
|---|---|---|
KANTOOR_AUTOCONFIG_IMAP_HOST | PHX_HOST | public IMAP host name |
KANTOOR_AUTOCONFIG_IMAP_PORT | 993 when the IMAP listener is enabled | public IMAP port; setting it also turns the IMAP entry on |
KANTOOR_AUTOCONFIG_IMAP_SOCKET | ssl | ssl (implicit TLS) or starttls |
KANTOOR_AUTOCONFIG_POP3_HOST / _PORT / _SOCKET | off | POP3 entry; offered only when the port is set |
KANTOOR_AUTOCONFIG_SMTP_HOST / _PORT / _SOCKET | from config :kantoor, :smtp | submission entry; without these and without :smtp keys (host, tls_port, port) the entry is left out |
DNS and TLS for the discovery names are listed in DNS records.
Admin, Domains, DNS records shows exactly those records per domain, built from the settings
above (no new environment variable; Kantoor writes no DNS). It looks them up with the
server's resolver; config :kantoor, :dns_records, ttl: 3600, nameservers: [{{1, 1, 1, 1}, 53}]
changes the TTL shown or the name servers asked. The autoconfig. and autodiscover.
names also need a proxy route and a certificate per mail domain, which DNS does not give.