Mail clients can use standardized or provider-specific discovery mechanisms to locate IMAP, POP and submission services.
Standard mechanisms include SRV-based service discovery and email autoconfiguration specifications. Large hosted providers may also expose their own discovery systems.
Discovery should return secure service choices and still requires normal TLS certificate validation.