K-9 Mail and Thunderbird use a mechanism called Autoconfig to fetch the server settings for a given email address. The documentation is currently sparse, but should give you an idea on how to start. See autoconfig/README.md at master · thunderbird/autoconfig · GitHub
Basically, you create an XML file and make it available under https://autoconfig.{emailDomain}/mail/config-v1.1.xml
(where {emailDomain}
is a placeholder for your actual email domain).
For an example, see https://autoconfig.posteo.de/mail/config-v1.1.xml
Notes:
- You don’t actually have to include all supported domains in
<domain>
tags. Thunderbird and K-9 Mail only check that at least one<domain>
tag is present and contains a valid domain name. - You have to make sure that the web server serves a valid TLS certificate for
autoconfig.{emailDomain}
. And that’s for all of the email domains you support. - K-9 Mail doesn’t send the
emailAddress
query parameter. The reason for this can be found here: Autoconfig url emailaddress not supported
If you have further questions that you don’t want to discuss in public, please feel free to reach out to cketti@thunderbird.net.