create autodiscover when mail is on mail01 and sites on web01


Verified User

Some time ago we started managing our VPSen ourselves.
This is all still going pretty well.

Now I was wondering if I could solve the following problem. Namely working with autodiscover.
We have always had our VPSen set up as followed by our previous hosting provider.
We have a VPS for handling the mail and a VPS for the websites.
The address of our mail server is therefore
The websites run on
If there are problems with a web server, customers can continue to use their mail. That was the idea.

But that means that autodiscover will not work for our customers.
Because client softwere like outlook (the most commonly used software by our customers) immediately auto-fill the incoming and outgoing mail server as or and this won't work because we have our for incoming and outgoing mail server address.
so our customers must set up their mail account manually. That works but is not the easiest way to work with.

Now I came across this post last week.
Autodiscover information for mail clients to setup pop / imap / smtp settings automatically
And my thought is can that also work for us?

I've tried it.
I have created a subdirectory:
Made the php and htacces file
And placed an SRV record in the DNS of one of my test domain names. 3600 IN SRV 10 10 443

In my first test the following happened.
The SRV record did not seem to work. (i think)
So I made a different DNS record.
autodiscover CNAME

In my second test the following happened.
I received an error message in Outlook because the SSL was seen from my webserver and not the mailserver.
That makes sense because the autodiscover script is on the webserver and not on the mailserver.

So to continue my test I have to create a subdirectory on my mailserver.
Now this may sound stupid but I am not sure how to handle this.
How do I create a subdirectory on a VPS that is configured for mail only.
Does it necessarily have to be a subdirectory?

Maybe someone has experience with setting up autodicover on 2 separate VPSs.
Or it might not even be possible?

I'm curious about the responses.

Thanks in advance


Super Moderator

Yes, I have experience with it.

If it's not a typo:

Code: 3600 IN SRV 10 10 443
you are missing a final dot, it should be

In this example the name points to a web-server where you host autodiscover XML file, you can replace the name with or, and put your content under a proper location under /var/www/html/

Feel free to ask questions, or contact me privately if you want me to install and configure it for you.


Verified User
Hello there,
Thanks for your quick reply
Yes, that is a typo in my post. And probably also on my first attempt to create the DNS record, because I tried again and then checked it in MXToolbox and it works fine now. So that problem has been solved.

Now the hard part. Creating the subdirectory for the xml files.
Now I don't want to make my post any more difficult with all sorts of synonyms for my domain names, but I have always been told not to post that kind of info across the internet because it will stick on the internet forever. So I will post the real domains by private message to you so that you get a better idea what i'm talking about.

And thanks very much for your offer to fix this issue. I will keep this in mind. But I especially like doing it myself. Because thats the best way for me to learn about these issues.And believe me i have learned a lot these last few weeks.

Posting some more info to you thrue PM now.
Last edited:


Super Moderator
You're welcome.

An autodiscover XML file can be hosted under any domain, it can be or, or

If you need to create a subdomain, you can do it in Directadmin the same way as for other domains/subdomains. There are no restrictions on it.

And a content of a XML file can be automatically generated by a PHP script, with a help of mod_rewrite you make all requests to XML to be processed by your PHP script. This way it can be hosted in one place for all your existing domains, you can even use 3rd party services (paid or free), which will announce your settings.


Verified User

The weekend is near.
I'm going to try to get it working before monday.
I'll keep you informed.

Thanks again.