Client settings discovery (autoconfig/autodiscovery)

Your question

Hey folks,

We’ve recently deployed Stalwart Enterprise 0.16.7 and during early testing, we found that our devices / email clients were not able to reliably detect the correct settings via autoconfig or autodiscover.

It’s not clear which method iOS uses, but we couldn’t see any attempt to reach any automated setup protocols. Outlook on iOS oddly detected Stalwart as Exchange instead of IMAP. Mail on macOS is also unable to detect any settings automatically.

No doubt our faithful Mozilla Thunderbird would have no problem, but sadly this isn’t heavily adopted by our user base.

Looking at the logs when adding an account to Outlook, it makes a request to /autodiscover/autodiscover.json/v1.0/[email protected]?Protocol=AutodiscoverV1&RedirectCount=1 and Stalwart responds with {"type":"about:blank","status":400,"title":"Invalid parameters","detail":"Missing domain in email address"}. Is Stalwart’s autodiscover implementation not quite there yet?

poldice.co.uk is our test domain and all Stalwart-supplied records should be in place in the zone.

Before we go can live with the solution, we would like to ensure that emails clients stand the best possible chance of discovering the settings manually (simply to ease the associated support burden of running an email service).

I feel like we’ve missed something here, so if anyone is able to check & advise, I’d really appreciate it.

Thank you for your time, let me know if you need any further details.

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.

on

Let me look into the autodiscover/autoconfig implementation in Stalwart.

The specific error is clear from the source code. The Autodiscover v2 (JSON) endpoint at /autodiscover/autodiscover.json/v1.0/... expects the email address to contain a domain. The URL format Outlook is using – /autodiscover/autodiscover.json/v1.0/[email protected]?Protocol=AutodiscoverV1&RedirectCount=1 – should include a domain, so this is a bit odd. Let me look at how that endpoint parses the path.

I dug a bit to find out the deal with iOS Mail.

Does not support typical autoconfig or SRV as far as I can tell. Only the Exchange Autodiscover and other providers already shown.

However, it has a method called email.mobileconfig that can be used to configure a new email account, similar to the Thunderbird method.

The concept is you provide a link (or QR) to a user that has to be opened in Safari.

It will pop up and say “This website is trying to download a configuration profile. Do you want to allow this”?" Ignore/Allow

That is before even attempting to download it, so it recognizes it as a supported profile URL.

The schema of the URL is https://autoconfig.example.com/[email protected]

It does not appear that Stalwart currently generates this profile as I received a 404 when trying it. So this may be a feature request.

It appears Mailcow has a similar function where you can login as the user and generate a .mobileconfig file that you can download and then open, so this functionality does exist.

Ref: GitHub - smartlyway/email-autoconfig-php: Allows to configure an email service automatically in some email clients by configuring autodiscover / autoconfig protocols (with PHP) · GitHub

Thank you for taking a look, definitely sounds like there’s a feature request here. We know of email.mobileconfig, but the UX is a bit rough, still worth considering for those who are used to that method though.

Hopefully the Stalwart team can advise on the Outlook autodiscover behaviour.

Email is a massive drain on customer service / support, especially when setting up new devices. Stalwart have already made great progress in building in as much auto-configuration support as possible into their product, it’s just a shame the devices/clients are so hit & miss.

It’s mad that we’ve not yet arrived at a standard yet, hopefully PACC is the answer; although that brings along the challenge of ensuring /.well-known/user-agent-configuration.json lands at Stalwart.

Unfortunately the Apple expectation is “We gave you MDM, why aren’t you using that to provision everything?”. They’ll never adopt PACC unless forced somehow.

And yes, with PACC being on the apex of the domain, if you aren’t controlling the whole show …

The autodiscover v2 endpoint has been fixed. The fix will be included in v0.16.9.

That’s good news for Outlook on iOS. Can you comment on if there will be support for .mobileconfig for iOS Mail, or should we go for something like Mailtemi instead?

Thank you, that’s great. Do you have an estimate as to when v0.16.9 will be released?