I need help / direction to write a script that will find the type of a mailbox by it's address. (such as: POP, IMAP or Exchange) For example I'll type: 'xxx@gmail.com' and the response will be 'pop/imap'.
开发者_如何学运维I believe it is possible because I know blackberry systems for example can do it when you configure email accounts, or even smart phones can..
I tought trying to communicate with the server by known ports like 110 and so using telnet, but it won't work because exchange is able to use any port.
I prefer using javascript for this job.
Thanks, Rotem
One option would be to implement the Exchange Autodiscover protocol, this is designed for ActiveSync clients to automatically detect settings based on an email address. However, this requires further setup on the Exchange server and not all systems will support this.
Another option would be to do an MX lookup on the domain, connect to SMTP port, and make some assumptions based on what the server claims to be (Microsoft ESMTP MAIL
is what Windows will answer with, but that doesn't necessarily indicate an Exchange server).
BlackBerry devices do not support Exchange ActiveSync without third party software or server-side BES. Windows Mobile devices will use the Autodiscover protocol for Exchange servers, or ask the user to enter Exchange details manually it the server does not support it.
精彩评论