Autodiscover.xml redirect behavior

4u123

Well-Known Member
PartnerNOC
Jan 2, 2006
938
21
168
Moved from: Autodiscover.xml redirects

I think I can answer that, since I'm having the same problem...

There is an issue that has been discussed on these forums in some detail - but still seems to be an unresolved problem in many cases. Here is the scenario...

1. Client has website hosted on cpanel server
2. Client is using external DNS
3. Client is using some form of crappy Microsoft Email service- e.g outlook.com or exchange or whatever and has the MX records set up on their external DNS

In the above scenario, the Email clients run into a problem with autodiscover, because the crappy Microsoft servers try to find an autodiscover.xml file via HTTP at the users website, which is hosted on the cpanel server. This redirects to the cgi script on the server which causes the autodiscovery process to fail.

The documented solution is to set the mail routing for the domain in cpanel to "remote" - but this doesn't work.

The second thing to attempt, is to use a vhost override by adding in a config file for the domain at /etc/apache2/conf.d/userdata/std(or ssl)/2_4/user/domain/

...containing a redirect like redirect permanent Autodiscover/Autodiscover.xml http://autodiscover.domain (as long as that has been set up correctly in the external DNS

However, this doesn't work either. It still seems to redirect to the cgi script.

I've gone around in circles looking at the wealth of posts on this subject on these forums and elsewhere and I've still not found an adequate solution to this problem.

In my opinion, it is just not a good idea to make an http request to a website, in order to determine the mail configuration for a domain. It should all be done vis DNS records. Microsoft clearly have made a mistake with this - but cpanel have still not really got on top of the issue and so far there is no solution that works, certainly none that I've found.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,222
463
Hello @4u123,

There is an issue that has been discussed on these forums in some detail - but still seems to be an unresolved problem in many cases. Here is the scenario...

1. Client has website hosted on cpanel server
2. Client is using external DNS
3. Client is using some form of crappy Microsoft Email service- e.g outlook.com or exchange or whatever and has the MX records set up on their external DNS

In the above scenario, the Email clients run into a problem with autodiscover, because the crappy Microsoft servers try to find an autodiscover.xml file via HTTP at the users website, which is hosted on the cpanel server. This redirects to the cgi script on the server which causes the autodiscovery process to fail.

The documented solution is to set the mail routing for the domain in cpanel to "remote" - but this doesn't work.
I just tried reproducing this behavior on cPanel & WHM version 70.0.48, but it looks to correctly return a 400 error when Remote Mail Exchanger is selected under Email Routing for the domain name:

Code:
curl -k -D /dev/stdout --data-binary '<EMailAddress>[email protected]</EMailAddress>' -l http://domain.tld/autodiscover/autodiscover.xml
HTTP/1.1 400 Bad Request
Date: Tue, 05 Jun 2018 16:59:07 GMT
Server: Apache
Upgrade: h2,h2c
Connection: Upgrade, close
Content-Length: 76
Content-Type: text/plain; charset="UTF-8"

domain.tld is a remote domain and cannot be configured with autodiscovery.
If I understand correctly, are you stating that Outlook doesn't properly recognize the "400" error code? Or, that the server is not issuing the 400 error code at all when Remote Mail Exchanger is selected under Email Routing for the domain name?

Thank you.