Autodiscover / Autoconfig

Hello,

when creating a new mail account in K9 mail, it only asks for the E-Mail address and finds the corresponding IMAP, POP3, and SMTP servers on its own.
Is it documented somewhere how K9 resolves those servers? Is it done via the official autodiscover/autoconfig mechanisms or is it simply attaching imap, pop, or smtp to the mail domain or is there some kind of K9 lookup table?
I am asking, because the mechanism does not resolve the correct servers on my private setup and I would like to understand what I have to reconfigure.

Thanks a lot in advance,

Thomas

K-9 Mail up to version 6.708 only supports automatic setup with the providers/domains listed in providers.xml.

The new account setup supports Thunderbird’s autoconfig mechanism. K-9 Mail 6.709 is the first beta version that includes the new account setup.

1 Like

Thanks for the information.
Will K-9 Mail support the whole Thunderbird autoconfig or only the ISPDB (because the README.me file in your link mainly focuses on ISPDB)?
How exactly does K-9 Mail behave in the older versions (<= 6.708) if the domain is not found in the providers.xml? Will it simply attach imap, pop, or smtp to the domain?

It will ask you to enter the details.

Yes, the app will suggest a server name based on the email domain and protocol the user has selected. The subdomains are imap, pop3, and smtp. But you’ll always end up in the manual setup flow. The best you can do is to use those exact server names (and ports). That way manual setup can be reduced to tapping the “Next” button.

1 Like

That’s because there’s currently no good documentation for autoconfig :frowning_face:

The beta supports fetching the config from https://autoconfig.{domain}/mail/config-v1.1.xml or https://{domain}/.well-known/autoconfig/mail/config-v1.1.xml. It does not support the server name guessing step that is included in Thunderbird.

The autoconfig is awesome.

However it seems like K9 does not like a redirect response (status 302 in my case) when requesting the .well-known URL. My webspace does issue this redirect when this URL is requested, and the result is in fact a valid XML provided by them instead of me (overriding my own version). Thunderbird works with this setup, i.e. they seem to follow the redirect.

I tried adding the autoconfig.domain variant, and that works with K9, apparently because that isn’t redirected.

Using K9 6.711.

K-9 Mail should follow redirects just fine. For what domain are you seeing this behavior?

I have this autoconfig URL
https://rtbg.kaltschrank.de/.well-known/autoconfig/mail/config-v1.1.xml

It is redirected to
https://webhosting-autoconfig.manitu.de/.well-known/autoconfig/mail/config-v1.1.xml

(working around the 2 link limit, I hope)

When I try to add a new account with any email address “mail@rtbg.kaltschrank.de”, I get the info that the configuration could not be loaded.

CURRENTLY I worked around this by providing
https://autoconfig.rtbg.kaltschrank.de/mail/config-v1.1.xml

This isn’t redirected, and then K9 had a green icon and was displaying the config. If you want to reproduce locally, you have to block the second autoconfig location. The second location is serving exactly the same file.

Edit:
Just confirmed it again: Renaming the file will lead to 404 at the autoconfig domain, and the redirect still works. K9 states it cannot load the config.

Restoring the correct name, and it immediately works.

Am I missing something here?

Thunderbird requires a <domain> element with a valid hostname value. We also implemented that check in K-9 Mail (even though neither Thunderbird nor K-9 Mail use this value for anything). The problem is that Thunderbird’s check allows placeholder values like %EMAILDOMAIN%, while K-9 Mail currently doesn’t.

Thank you for looking - I will bring this to the Manitu Support, we’ll see if they can fix it. Autoconfig is way too undocumented on their part.

We’ll fix the issue in K-9 Mail.

2 Likes