'autodiscover' for email clients

Hi guys,

I’m looking for a product or service that allows for automatic mail settings discovery. Basically something (like an XML file or subdomain?) that would simply communicate all server settings (pop/imap/smtp domains and ports) to allow easy configuration for clients.

I take it there’s already a product or service available that empowers this but I’m not sure what terms to search for, so I’m having a hard time finding it.

Do you happen to know a product or service that provides this need?

Additionally, is there a downside in terms of security to a service like this?

I know Mozilla Thunderbird performs some kind of check when configuring a new email account, probably through trial and error (by guessing the pop server + port), but I take it there’s a more professional alternative.

Any help is greatly appreciated.