cPanel & WHM Version 98 has been released, and brings a slew of great updates. Take a look at what is included, and then upgrade today!

Disable autodiscover on domains set to remote MX servers

Monarobase shared this idea 5 years ago
Already Exists

Currently Outlook and Microsoft Echange autodiscovery doesn't work when the domain's website is hosted on a cPanel server and the e-mails are hosted on an Exchange or other distant server.

We would like cPanel to make this work but disabeling cPanel's autodiscover on domain's that are set to remote MX.


The problem is that for autodiscover, Microsoft Exchange first checks for autodiscover :


https:// + domain.tld + /autodiscover/autodiscover.xml


If this URL doesn't work it then checks https://autodisover. + domain.tld + /autodiscover/autodiscover.xml

And if that doesnt' work it checks the SRV record.


Both https://autodisover. + domain.tld + /autodiscover/autodiscover.xml and the SRV record are configurable by the end user but there is currently no way for end users to disable


https://autodisover. + domain.tld + /autodiscover/autodiscover.xml


I would make sense if autodiscover was simply disabled for remote domains as it obviously should not be used in that case.


More information here :

https://social.technet.microsoft.com/Forums/exchange/en-US/4099e289-55bf-476b-a9c4-ee1377046df7/cpanel-autodiscover-conflict-with-exchange?forum=exchangesvrgeneral

Best Answer
photo

When accessing an autodiscover url with a remote domain, the system is designed to return a 400 error with the message

“XXX is a remote domain and cannot be configured with autodiscovery."

If this isn’t the behavior you are seeing please open a support request at https://tickets.cpanel.net/submit/ and reference this post

A live example of this behavior is below:


  1. $ curl -i -X POST -d "any@remotedomain.koston.org" http://autodiscover.koston.org/
  2. [any@remotedomain.koston.org]: /usr/local/cpanel/cgi-sys/autodiscover.cgi
  3. HTTP/1.1 400 Bad Request
  4. Date: Wed, 01 Mar 2017 06:21:24 GMT
  5. Server: Apache/2.4.25 (cPanel) OpenSSL/1.0.1e-fips mod_bwlimited/1.4
  6. Content-Length: 87
  7. Content-Type: text/plain; charset="UTF-8"
  8. Connection: close
  9. remotedomain.koston.org is a remote domain and cannot be configured with autodiscovery.
  10. $ curl -i -X POST -d "any@remotedomain.koston.org" http://koston.org/autodiscover/autodiscover.xml
  11. HTTP/1.1 400 Bad Request
  12. Date: Wed, 01 Mar 2017 06:20:43 GMT
  13. Server: Apache/2.4.25 (cPanel) OpenSSL/1.0.1e-fips mod_bwlimited/1.4
  14. Content-Length: 87
  15. Connection: close
  16. Content-Type: text/plain; charset="UTF-8"
  17. remotedomain.koston.org is a remote domain and cannot be configured with autodiscovery
  18. $ curl -i -X POST -d "any@remotedomain.koston.org" http://autodiscover.koston.org/autodiscover/autodiscover.xml
  19. HTTP/1.1 400 Bad Request
  20. Date: Wed, 01 Mar 2017 06:21:51 GMT
  21. Server: Apache/2.4.25 (cPanel) OpenSSL/1.0.1e-fips mod_bwlimited/1.4
  22. Content-Length: 87
  23. Content-Type: text/plain; charset="UTF-8"
  24. Connection: close
  25. remotedomain.koston.org is a remote domain and cannot be configured with autodiscovery.

Replies (7)

photo
1

We have users who are unable to autodiscover their office 365 accounts from outlook because of this behaviour.


cPanel support have advised that autodiscover is an all or nothing setting. I definitely feel that we should be able to disable this per account or at the very least have it disabled for remote domains.

photo
2

Same issue as Alex here as well, this is a need and a logical feature when hosting multiple accounts, the only real current solution is to have two cpanel servers, one for accounts using exchange with their domain, and one for everyone else, which kind of negates the "remote mail exchange" feature.

photo
2

My office365 tech people are screaming at us. what an unfortunate default, please allow an easy remedy

photo
3

cPanel's support tried to help us with this one creating an apache include but it caused litespeed to crash. We ended up creating a mod security rule per domain that uses office 360.

Here is the rule we use :


  1. ## block specific exchange requests example.org
  2. SecRule REQUEST_URI "autodiscover/autodiscover.xml" "id:9990001,nolog,status:404,chain"
  3. SecRule SERVER_NAME "example\.org" "t:lowercase"

It's very much a hack, but it works (we use litespeed, have not tested on Apache), make sure you use a different rule number for each domain. We will stop using this when cPanel gives us an option to remove the vhost entry for /autodiscover for customers configured with a remote mailexchanger.

photo
2

Legendary, That'll work for the timebeing. Confirmed working with Apache.

photo
1

@Monarobase code also is perfect to resolve this with Apache.

photo
1

When accessing an autodiscover url with a remote domain, the system is designed to return a 400 error with the message

“XXX is a remote domain and cannot be configured with autodiscovery."

If this isn’t the behavior you are seeing please open a support request at https://tickets.cpanel.net/submit/ and reference this post

A live example of this behavior is below:


  1. $ curl -i -X POST -d "any@remotedomain.koston.org" http://autodiscover.koston.org/
  2. [any@remotedomain.koston.org]: /usr/local/cpanel/cgi-sys/autodiscover.cgi
  3. HTTP/1.1 400 Bad Request
  4. Date: Wed, 01 Mar 2017 06:21:24 GMT
  5. Server: Apache/2.4.25 (cPanel) OpenSSL/1.0.1e-fips mod_bwlimited/1.4
  6. Content-Length: 87
  7. Content-Type: text/plain; charset="UTF-8"
  8. Connection: close
  9. remotedomain.koston.org is a remote domain and cannot be configured with autodiscovery.
  10. $ curl -i -X POST -d "any@remotedomain.koston.org" http://koston.org/autodiscover/autodiscover.xml
  11. HTTP/1.1 400 Bad Request
  12. Date: Wed, 01 Mar 2017 06:20:43 GMT
  13. Server: Apache/2.4.25 (cPanel) OpenSSL/1.0.1e-fips mod_bwlimited/1.4
  14. Content-Length: 87
  15. Connection: close
  16. Content-Type: text/plain; charset="UTF-8"
  17. remotedomain.koston.org is a remote domain and cannot be configured with autodiscovery
  18. $ curl -i -X POST -d "any@remotedomain.koston.org" http://autodiscover.koston.org/autodiscover/autodiscover.xml
  19. HTTP/1.1 400 Bad Request
  20. Date: Wed, 01 Mar 2017 06:21:51 GMT
  21. Server: Apache/2.4.25 (cPanel) OpenSSL/1.0.1e-fips mod_bwlimited/1.4
  22. Content-Length: 87
  23. Content-Type: text/plain; charset="UTF-8"
  24. Connection: close
  25. remotedomain.koston.org is a remote domain and cannot be configured with autodiscovery.

photo
2

Hi,


We have already reported the issues in ticket 7699335 and were pointed here.


"The problem is Outlook checks these HTTPS domains first before the http/cname, it then fails because these "autodiscover.xml" that have appeared are for cpanel email."

photo
2

Hi Alex,

I'm seeing the same behavior I posted above for https urls that I am seeing for http urls. I'm testing this with the latest version of EA4. The ticket you referenced has been closed for some time. I have reopened your ticket and escalated it our level 3 support. I'll be sure to follow the progress.


  1. curl -i -X POST -d "any@remotedomain.koston.org" https://autodiscover.koston.org/autodiscover/autodiscover.xml
  2. HTTP/1.1 400 Bad Request

    Date: Wed, 01 Mar 2017 18:30:22 GMT

    Server: Apache/2.4.25 (cPanel) OpenSSL/1.0.1e-fips mod_bwlimited/1.4

    Content-Length: 87

    Content-Type: text/plain; charset="UTF-8"

    Connection: close

    remotedomain.koston.org is a remote domain and cannot be configured with autodiscovery

photo
2

Yes, outlook tries this URL first https://example.org/autodiscover/autodiscover.xml and when this feature request was opened cPanel didn't reply with an error. I will have to check and see if this has been fixed.

Replies have been locked on this page!