Q: Is there a tool that can tell a domain's IMAP or POP3 address? I'm building a web email client and I'm interested in easy ways to figure out imap or pop3 emails.  Is there a tool to help figure this out?  
I'm assuming if not, my best bet would be 
try { imap.domain.com } 
catch{ 
        try { mail.domain.com } 
        catch { ...etc ... }
} 


A: There is no way. Your best bet is to try the domain of the e-mail, plus the usual prefixes, as you suggest. Even then, an IMAP server may be running in a non-standard port; then you have no way of knowing.

A: You could try a DNS look up with a command line exec or something to look up their MX records and then parse it for the appropriate server.  Not sure how well it would work though.
On a linux OS, you can use dig or host, on Windows you can use nslookup.
Example use of each tool:
dig www.domain.com mx
host -t mx www.domain.com
nslookup -type=MX www.domain.com

