Determine POP/IMAP server from email address

raghu picture raghu · Jan 22, 2010 · Viewed 15.5k times · Source

Is there a way to determine POP or IMAP server given the email address? I am building an application for non-technical users and I dont really want to bother them with asking their IMAP/POP servers. mail2web.com does this, but I am not sure how.

Answer

Midhat picture Midhat · Sep 25, 2012

This is how Thunderbird does it

/**
18  * Try to guess the config, by:
19  * - guessing hostnames (pop3.<domain>, pop.<domain>, imap.<domain>,
20  *                       mail.<domain> etc.)
21  * - probing known ports (for IMAP, POP3 etc., with SSL, STARTTLS etc.)
22  * - opening a connection via the right protocol and checking the
23  *   protocol-specific CAPABILITIES like that the server returns.
24  */

http://mxr.mozilla.org/comm-central/source/mailnews/base/prefs/content/accountcreation/guessConfig.js