is it possible to disable autoconfig of mail some domains only

hi some of my customers have their own mailserver, like an local exchange og maybe exchange online or what ever. the problem is that when the mail server isnt hosted om my webserver, my webserver still answer to request to http(s)://domainname.tld/autoconfig/autoconfig.xml?mailaddress=someone@domain.tld

for some reason it seams that this is queried first before http(s)://autoconfigure.domainname.tld. and there is the problem outlook cant connect to exchange because autoconfig tells it to connet to a my mailserver server on imap and smtp, not the exchange server on mapi as it should.

so is there an easy way to make virtualmin not responding to this autoconfig request to domains without mail.

Status: 
Active

Comments

You can turn it off for a domain by SSHing in as root and running :

virtualmin modify-mail --domain yourdomain.com --no-autoconfig

Status: Active » Fixed

when I run this command i get

None of the selected domains have email enabled

should I enable email, run this comamnd and disable email ?

I also tried to enable mail, and run this command, and then it say Disabling mail client auto-configuration for ....

but still the server replies with the auto config script, it even replies after disabling mail again.

Status: Fixed » Active

when I run this command i get None of the selected domains have email enabled should I enable email, run this comamnd and disable email ?

I also tried to enable mail, and run this command, and then it say Disabling mail client auto-configuration for ....

but still the server replies with the auto config script, it even replies after disabling mail again.

Status: Fixed » Active

when I run this command i get None of the selected domains have email enabled should I enable email, run this comamnd and disable email ?

I also tried to enable mail, and run this command, and then it say Disabling mail client auto-configuration for ....

but still the server replies with the auto config script, it even replies after disabling mail again.

the easy fix is to turn off autoconfig for mail, then all users tha thas mail elsewhere works, but everyone that has mail on my server has a problem.

do I have to have one virtualmin server for users that has mail elsewhere and one for users that has mail with me.

it seems like its not only virtualmin that has this issue, I foun a lot of references to cpanel and other control panel systems that has this error

I also digging aroud in the system found a global setting that points anu request to autodiscover to a proxy request pointing to balancer://autodiscover

Do the domains that you're seeing this problem for have a website enabled? If not, requests to them could be falling through to another domain on the system (which still has autoconfig enabled).

website is enabled, and ig its relevant, I see a logentry that points to webmin at the same time [06/Feb/2017:22:25:02 +0100] "HEAD / HTTP/1.0" 200 - "-" "Webmin"

but it migth only be a coincidence.

also checked under directives, there is autodiscover still there

ScriptAlias /autodiscover/autodiscover.xml ..............

when I remove this scripaliases from http and https its ok and it works

That's odd - I just tested this API command, and it successfully removed that line on our test servers.

I have tested on 2 different servers, one with virtualmin pro and 1 gpl both have centos 6.8, and latest patches.

same result on both., only difference was that on gpl it still replied to autodiscover even if it was globally turned off

is there anything else i can test

So did it remove that ScriptAlias line on any of your systems?

no, had to manually remove on both also founf that one of the websites didnt have ssl enabled so that was redirected to my "default" website, which is a "domain hosted by" page this website also didnt have mail enabled but still it had autodiscover turned on.

so I could maybe suggest a little change to have autodiscovery off for all domains unless it has email enabled, and then turn i t on

You can turn it off for new domains on the Virtualmin Configuration page, and then turn it on selectively with the modify-mail API command.