The whole auto discovery process is documented on Microsoft TechNet, but I will give a summary, in a EWS context (it looks like the process for Active Directory/Outlook on Windows process in a bit different). This process applies both to MS Exchange and Kerio Connect.
As with CalDAV, the auto discovery process will take the domain from email address of the client, and it will try to make a HTTP POST to either:
- https://autodiscover.mydomain.com/autodiscover/autodiscover.xml
- http://autodiscover.mydomain.com/autodiscover/autodiscover.xml
For example, if your email address is probert@conatus.lan, it will try to do the POST request at https://autodiscover.conatus.lan/autodiscover/autodiscover.xml, and if it didn't get a valid response, it will try the non-secure port.
If the autodiscover.mydomain.com DNS entry is not find, the client will try to do the POST request to https://mydomain.com/autodiscover/autodiscover.xml.
The POST request that is made by the client looks like this:
<Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/requestschema/2006"> <Request> <EMailAddress>probert@conatus.lan</EMailAddress> <AcceptableResponseSchema>http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a</AcceptableResponseSchema> </Request> </Autodiscover>
One important note: this POST request is authenticated by sending the user's credentials with the Authorization header. It will use either Basic or NTLM authentication.
The response will send the details of where the different services (SMTP, EWS, POP3, IMAP, etc.) are located.
<Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006"> <Response xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a"> <User> <DisplayName>Administrator</DisplayName> <EMailAddress>probert@conatus.lan</EMailAddress> </User> <Account> <AccountType>email</AccountType> <Action>settings</Action> <Protocol> <Type>EXCH</Type> <Server>myserver.conatus.lan</Server> <AD>myserver.conatus.lan</AD> <ASUrl>https://myserver.conatus.lan/EWS/Exchange.asmx</ASUrl> <EwsUrl>https://myserver.conatus.lan/EWS/Exchange.asmx</EwsUrl> <OOFUrl>https://myserver.conatus.lan/EWS/Exchange.asmx</OOFUrl> </Protocol> <Protocol> <Type>SMTP</Type> <Server>myserver.conatus.lan</Server> <LoginName>probert@conatus.lan</LoginName> <Port>25</Port> <DomainRequired>off</DomainRequired> <SPA>off</SPA> <SSL>off</SSL> </Protocol> <Protocol> <Type>SMTP</Type> <Server>myserver.conatus.lan</Server> <LoginName>probert@conatus.lan</LoginName> <Port>465</Port> <DomainRequired>off</DomainRequired> <SPA>off</SPA> <SSL>on</SSL> </Protocol> <Protocol> <Type>IMAP</Type> <Server>myserver.conatus.lan</Server> <LoginName>probert@conatus.lan</LoginName> <Port>143</Port> <DomainRequired>off</DomainRequired> <SPA>off</SPA> <SSL>off</SSL> </Protocol> <Protocol> <Type>IMAP</Type> <Server>myserver.conatus.lan</Server> <LoginName>probert@conatus.lan</LoginName> <Port>993</Port> <DomainRequired>off</DomainRequired> <SPA>off</SPA> <SSL>on</SSL> </Protocol> <Protocol> <Type>POP3</Type> <Server>myserver.conatus.lan</Server> <LoginName>probert@conatus.lan</LoginName> <Port>110</Port> <DomainRequired>off</DomainRequired> <SPA>off</SPA> <SSL>off</SSL> </Protocol> <Protocol> <Type>POP3</Type> <Server>myserver.conatus.lan</Server> <LoginName>probert@conatus.lan</LoginName> <Port>995</Port> <DomainRequired>off</DomainRequired> <SPA>off</SPA> <SSL>on</SSL> </Protocol> </Account> <Action> <Settings> <Server> <Type>MobileSync</Type> <Url>https://myserver.conatus.lan/Microsoft-Server-ActiveSync/</Url> <Name>https://myserver.conatus.lan/Microsoft-Server-ActiveSync/</Name> </Server> </Settings> </Action> </Response> </Autodiscover>
Once it located the SOAP endpoint for EWS (the value of the EwsUrl attribute in the response above), the client can fetch the folders and everything else.