Is there a .mobileconfig for iOS autoconfiguration?
If there are method to have a listener on port 80, ONLY answering the auto configs? The network listener seems to be an all or nothing, not fine grained for specific stuff like autodicovery/config only?
I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.
Here is what the current docs say about these two questions:
iOS .mobileconfig support
Stalwart does not generate Apple .mobileconfig profiles. The three autoconfiguration protocols it supports are PACC (the modern IETF standard), Mozilla Autoconfig (XML), and Microsoft Autodiscover (XML). None of these produce an Apple configuration profile. iOS’s native Mail app does understand Autodiscover and, more broadly, IMAP/SMTP server settings returned by those protocols, but if you need a signed .mobileconfig file you would have to generate and host one yourself (e.g. with Apple Configurator or a third-party tool) outside of Stalwart.
Port 80 / HTTP-only listener for autoconfig
You can add a dedicated HTTP listener on port 80 by creating an additional NetworkListener object with "protocol": "http" and "bind": ["[::]:80"] (with "useTls": false). All HTTP listeners in Stalwart serve the same set of endpoints, including autoconfig/autodiscover, so there is no way to restrict a listener to only answer autoconfig requests - it is indeed an all-or-nothing binding per listener. What you can do is put a reverse proxy (nginx, HAProxy, Caddy, etc.) in front on port 80 that forwards only the autoconfig paths (/mail/config-v1.1.xml, /.well-known/user-agent-configuration, /autodiscover/autodiscover.xml) to Stalwart and blocks or redirects everything else.
The autoconfig docs note: “Clients that reach the server over HTTPS (port 443) receive the generated PACC, autoconfig, and autodiscover documents automatically.” Mozilla Autoconfig specifically fetches over plain HTTP (http://autoconfig.example.com/...), so a plain HTTP listener (or a reverse proxy on 80) is needed for that legacy format.
Stalwart doesn’t generate an iOS .mobileconfig; it implements PACC, Mozilla Autoconfig (XML) and MS Autodiscover only. And the HTTP listener isn’t path-scoped: one listener serves autoconfig/autodiscover/PACC alongside /admin and /account, which is why you found those answering too. If you want to expose only the discovery URLs, the reverse-proxy/haproxy path filtering you mentioned is the right approach.
The reason iOS still doesn’t autodiscover after adding the DNS records is that iOS Mail doesn’t use Mozilla Autoconfig or Autodiscover for third-party domains at all, so those records won’t drive iPhone setup. For iOS the practical route is a hand-authored (and ideally signed) .mobileconfig profile that you serve yourself. These discovery documents are served over 443 by default, not a dedicated port 80 listener. Docs: Autoconfig | Stalwart .