There are several ways an emailclient can perform autodiscover to detect its settings, however, most clients do not implement all methods. One example is the iPhone, which works as follows:
E-mail address entered: email@example.com
- Connect to https://example.com/Autodiscover/Autodiscover.xml
- Connect to http://example.com/Autodiscover/Autodiscover.xml
This works if the root of your e-mail hosting domain points to an Exchange Client Access Server. However, most of the time it doesn’t. A common case would be that the website is hosted elsewhere on for example an Apache HTTPD server. Of course, when the i
DumbPhone connects to either URL’s above, it fails because the file doesn’t exist.
If both methods fail, the iPhone bugs out and asks the user to manually enter the server address, username, domain, etc… Well they won’t be entering it, as IT guy, you will be. What you can do is redirect the iPhone’s request to your mailserver using a HTTP 302 Temporary Redirect status code. To do so:
Create a file called .htaccess in your DocumentRoot with the following content:
RedirectMatch 302 (?i)^/Autodiscover/(.*)$ https://yourcas.example.com/Autodiscover/$1
Adjust where necessary. If your Client Access Server is mail.example.com:
RedirectMatch 302 (?i)^/Autodiscover/(.*)$ https://mail.example.com/Autodiscover/$1
This will cause all requests to http://example.com/Autodiscover/Autodiscover.xml to be redirected to https://mail.example.com/Autodiscover/Autodiscover.xml, thus allowing iPhones to correctly autodiscover all server information needed to configure the account.
Hint: to make this work, your webhosting provider must support .htaccess files and has not blocked the RedirectMatch directive
Hint2: if autodiscover still fails and you are sure the iPhones are being correctly redirected, set the user’s UPN to firstname.lastname@example.org (example.com being the e-mail domain being used – resolvable on the internet) and have your users enter that as “E-mail Address” when the iPhone asks for it.
- microsoft.com: Autodiscover for Exchange 2013