I can’t seem to get my Autodiscover configuration to please the official Microsoft Outlook Autodiscover tester. It locates Autodiscover.xml ok, but then throws an xml error that I’m not sure what to do with:
Message: <clientConfig xmlns=''> was not expected.
Type: System.InvalidOperationException
Anybody know what this might mean? I’ve tested it with my custom Autodiscover.xml as well as the Virtualmin default and it does the same thing.
Full error follows:
[code] Attempting to send an Autodiscover POST request to potential Autodiscover URLs.
Autodiscover settings weren’t obtained when the Autodiscover POST request was sent.
Additional Details
Elapsed Time: 824 ms.
Test Steps
The Microsoft Connectivity Analyzer is attempting to retrieve an XML Autodiscover response from URL https://my.domain.com:443/Autodiscover/Autodiscover.xml for user user@domain.com.
The Microsoft Connectivity Analyzer failed to obtain an Autodiscover XML response.
Additional Details
The Autodiscover XML response received by the Microsoft Connectivity Analyzer was invalid. Exception: Exception details:
Message: There is an error in XML document (3, 2).
Type: System.InvalidOperationException
Stack trace:
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)
at Microsoft.Exchange.Tools.ExRca.Tests.AutoDiscover.AutoDiscoverGetXMLBase`2.Discover()
Exception details:
Message: <clientConfig xmlns=''> was not expected.
Type: System.InvalidOperationException
Stack trace:
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderOutlookAutoDiscoverResponse XML.Read11_Autodiscover()
HTTP Response Headers:
Vary: Accept-Encoding
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/xml
Date: Sun, 27 Jul 2014 20:35:51 GMT
Server: Apache/2.2.22 (Debian)
Elapsed Time: 823 ms. [/code]
I don’t directly pass the URL. Using the Microsoft Remote Connectivity Analyzer, I select Outlook Autodiscover from a bank of available tests, input an email address and a password and it attempts autodiscovery. See here: https://testconnectivity.microsoft.com
I wouldn’t complain about its failure since Outlook is currently working, but I understand many other devices use Autodiscover as well, and currently neither Mac Mail or iOS Mail receive settings, so I thought perhaps Outlook was just being extra helpful.
Can you check what pages the autodiscovery test accesses when you use it? They should appear in the domain’s web log, under the /var/log/virtualmin directory.
I’m interested to know if it is accessing anything other than the path Virtualmin expects, and if so with what HTTP request type.
Ok, I see the issue here - the tester uses a URL in which “discover” has a lower-case D, but Virtualmin expects it to be like AutoDiscover. I guess this works on Windows webservers, as their filesystem is case-insensitive!
I don’t know if this affects your idea or not, but I did notice originally that the tester (and I think Outlook 2010 as well) were searching for Autodiscover/Autodiscover.xml and I added a third ScriptAlias in the apache directives to handle that case:
Several months later…I’ve encountered this problem again, but it suddenly makes sense to me!
I believe the issue is in the cgi-bin/autoconfig.cgi script with dynamically produces an xml file suitable for Outlook or for Thunderbird depending on the client query (see the “Output the XML” section of autoconfig.cgi)
It says basically “If client requests autodiscover.xml, return the Outlook-flavored XML, beginning with <Autodiscover xmlns etc etc, otherwise return the Thunderbird-flavored XML, beginning with <clientConfig version etc etc”
I think this conditional doesn’t take into account the possibility that autodiscover.xml may be spelled several different ways depending on the client, e.g. Autodiscover.xml and AutoDiscover.xml and when we see was not expected, it’s because the script is feeding Thunderbird xml to Outlook.
When I changed the line
if ($ENV{‘SCRIPT_NAME’} =~ /autodiscover.xml/) {
to
if ($ENV{‘SCRIPT_NAME’} =~ /Autodiscover.xml/) {
then Outlook autodiscovered properly…but Thunderbird no longer could. So it seems we need a more sophisticated conditional to handle all possible spellings.
So … after having spent hours chasing my tail from the standpoint of a Windows and Exchange Server admin trying to figure out why one of my Exchange domains was no longer keeping settings for traveling users I stumbled on this page.
The whole idea, from a Windows perspective, behind using VIrtualMin for us is to NOT have to spend hours looking at code with which we only have a nodding relationship.
Could there be a way to disable this by default for new sites, without having to dig through Apache Directives? I use a point and click interface so as to NOT have to dig through pages of Apache, et. al., config files looking for arcane settings.