-1

I am looking at users signing up and granting authorisation to my app. My app will have read access to their calendar. But depending on their email address (at least the domain part), I want to know which provider I query. I.e. Microsoft, apple, Google, other. Its obvious if its Gmail.com but many will use a unique domain or may use a smtp provider such as trend to safeguard mail before it it's microsoft etc.

M Haynes
  • 19
  • 3

1 Answers1

0

If you have user's credentials, you can try to retrieve autodiscover XML for the given SMTP address. Start at https://learn.microsoft.com/en-us/exchange/architecture/client-access/autodiscover?view=exchserver-2019 and play with Outlook connectivity analyzer at https://testconnectivity.microsoft.com/tests/Ola/input

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • Thanks for your post. When they first signup I don't have authority/creds. In this approach, are you suggesting I query each provider so MS then Google, then apple? – M Haynes Jul 02 '22 at 21:28
  • I am suggesting that if you get back MS specific autodiscover XML, that means the mailbox is hosted by an Exchange server, be that M365 or on-prem. Some email providers also return POP3/IMAP4 autodiscover responses. – Dmitry Streblechenko Jul 02 '22 at 21:58
  • Understood. I was hoping to have a lookup/query. Not sure mx dns is the best solution either. Will see if anyone else has an answer. – M Haynes Jul 04 '22 at 19:33