Mail clients which "discover" these things contain a list of probable values. The list will often contain specific values for certain commonly-used domains, and otherwise guess subdomains like mail
, imap
, smtp
, and pop
, and then attempt the standard ports for each service. It basically repeatedly tries various settings until it finds a combination which allow it to connect. It is entirely client-side and there is no way at all to influence this from the server side (except providing sufficiently default services).
That said, thunderbird and possibly some other clients support querying a subdomain (via http) for an XML configuration file. The subdomain is autoconfig
. For example, for [email protected]
, thunderbird will query http://autoconfig.example.int/mail/config-v1.1.xml
. The format of the file is described at the mozilla developer network and a description of exactly how to set it up is available there also.
There was once talk of using TXT
and SRV
records for this, but it's unclear if this has ever been implemented. Thunderbird in particular also has the ability to query a preinstalled XML config file and a config file at https://live.mozillamessaging.com/autoconfig/<email-address-domain>
.