Autodetect imap smtp settings


First of all, thanks a lot for this awesome app! This app is free software and just works very well and is super userfriendly! I could install it on phones of non technical people :wink:
But I noticed one issue. For one domain I manage, the imap and smtp settings are automatically detected on Thunderbird but not in K9-Mail. While this isn’t a big issue, could this be improved in some way?

I will explain more the issue I had :slight_smile:
To connect to the email address Thunderbird automatically detects that imap and smtp are locate at the domain while K9-Mail sets the imap and smtp subdomains. When doing the automatic parameter detection nothing is changed. I know some dns entry could maybe help K9-Mail to work, but Thunderbird managed to configure it successfully without more dns entries, so it would be cool if K9 did it as simply!

Thanks for your comments!

1 Like

Should I rather ask/open an issue on github?

MUAs like Thunderbird and Outlook check DNS for setup information first. If they don’t find the information, they’ll ask the user. These manual settings are then transferred to servers operated by Mozilla/M$/… (potentially illegally in Europe as users are not made aware of this)

When sufficiently many users have manually set the same settings, Thunderbird and Outlook will start “automatically detecting” the settings by retrieving them from the Mozilla/M$/… servers.

I do not think K-9 operates such “settings servers,” nor should the project do so. As mentioned, there is a liability issue with user data from Europe.

I recommend that you write MS or Microsoft instead. Bashing companies can be done in other places. Or not at all. :slight_smile:

Well thanks @tchara for your comment, but as I explained in my first post, my email server is on a “new” custom domain, so Mozilla can’t be aware of the settings as nobody had entered manually the settings of this domain already.
So Thunderbird has probably, as you said, checked the dns, to retrieve information and it would be cool if K9 could do the same :slight_smile:

Thunderbird might also just “brute force” common settings such as subdomains (mail, smtp, imap, pop, pop3, …) as well as ports and security settings (993/StartTLS, 993/SSL, …).

Personally, I think this should not be done, even though it’s convenient. It can trigger overly strict firewalls and lead to false IP reports if combines with OWASP and badip.

Well I’m not an expert on this topic, so I don’t have a strong opinion.
But if Thunderbird is doing like this, they might have good reasons and have thought about possible drawbacks.

The standards-based way to do this is with the DNS “SRV” record (see: Any other approach is basically brute force, and should really be discouraged.

I found that gmail publishes SRV records:

dig +short srv
5 0 587

dig +short srv
5 0 993

dig +short srv
20 0 995

but didn’t find them for any other major mail service provider (MSP). If your MSP has SRV records, then it might be reasonable to put in a K-9 enhancement request. If it doesn’t, start by asking them to add SRV records. [I haven’t looked at the K-9 code to see if it already does SRV record discovery,]