when user add a new email account that not are provided by a big vendor should inseret imap and smtp servers by hand… but there are e way described by some RFCs to guess sever address,
please consider to discover via SRV records begin with:
_imaps._tcp
_pop3s._tcp
_submission._tcp
see RFC 6186, 8314, 8553 and others
HTH
Alessandro Lota