Page MenuHomePhorge

D44.1775746568.diff
No OneTemporary

Authored By
Unknown
Size
3 KB
Referenced Files
None
Subscribers
None

D44.1775746568.diff

diff --git a/docs/README b/docs/README
--- a/docs/README
+++ b/docs/README
@@ -23,12 +23,12 @@
1. Apache
# for https://domain.tld (and https://autodiscover.domain.tld)
-Alias /autodiscover/autodiscover.xml /usr/share/kolab-autodiscover/public_html
-Alias /Autodiscover/Autodiscover.xml /usr/share/kolab-autodiscover/public_html
-Alias /AutoDiscover/AutoDiscover.xml /usr/share/kolab-autodiscover/public_html
+Alias /autodiscover/autodiscover.xml /usr/share/kolab-autodiscover/public_html/index.php
+Alias /Autodiscover/Autodiscover.xml /usr/share/kolab-autodiscover/public_html/index.php
+Alias /AutoDiscover/AutoDiscover.xml /usr/share/kolab-autodiscover/public_html/index.php
# for http://autoconfig.domain.tld
-Alias /mail/config-v1.1.xml /usr/share/kolab-autodiscover/public_html
+Alias /mail/config-v1.1.xml /usr/share/kolab-autodiscover/public_html/index.php
# for http://domain.tld
-Alias /.well-known/autoconfig/mail/config-v1.1.xml /usr/share/kolab-autodiscover/public_html
+Alias /.well-known/autoconfig/mail/config-v1.1.xml /usr/share/kolab-autodiscover/public_html/index.php
2. Add [autodiscover] section in /etc/kolab/kolab.conf (see sample kolab.conf.sample)
diff --git a/docs/kolab-autoconf.conf b/docs/kolab-autoconf.conf
--- a/docs/kolab-autoconf.conf
+++ b/docs/kolab-autoconf.conf
@@ -1,11 +1,19 @@
+# Force all requests to lowercase. Different MUAs, mobile devices etc
+# request the Autodiscover URL in different cases.
+RewriteEngine On
+RewriteMap lc int:tolower
+RewriteCond %{REQUEST_URI} !^/Microsoft
+RewriteCond %{REQUEST_URI} [A-Z]
+RewriteRule (.*) ${lc:$1} [R=301,L]
+
# for https://domain.tld (and https://autodiscover.domain.tld)
-Alias /autodiscover/autodiscover.xml /usr/share/kolab-autoconf/public_html
-Alias /Autodiscover/Autodiscover.xml /usr/share/kolab-autoconf/public_html
-Alias /AutoDiscover/AutoDiscover.xml /usr/share/kolab-autoconf/public_html
+Alias /autodiscover/autodiscover.xml /usr/share/kolab-autoconf/public_html/index.php
+
# for http://autoconfig.domain.tld
-Alias /mail/config-v1.1.xml /usr/share/kolab-autoconf/public_html
+Alias /mail/config-v1.1.xml /usr/share/kolab-autoconf/public_html/index.php
+
# for http://domain.tld
-Alias /.well-known/autoconfig/mail/config-v1.1.xml /usr/share/kolab-autoconf/public_html
+Alias /.well-known/autoconfig/mail/config-v1.1.xml /usr/share/kolab-autoconf/public_html/index.php
<Directory "/usr/share/kolab-autoconf/public_html">
AllowOverride None
diff --git a/lib/AutodiscoverMicrosoft.php b/lib/AutodiscoverMicrosoft.php
--- a/lib/AutodiscoverMicrosoft.php
+++ b/lib/AutodiscoverMicrosoft.php
@@ -52,12 +52,22 @@
// parse XML
try {
$xml = new SimpleXMLElement($post);
+ Log::debug(print_r($xml, true));
- if ($email = $xml->xpath('/Autodiscover/Request/EMailAddress')) {
+ foreach($xml->getDocNamespaces() as $strPrefix => $strNamespace) {
+ if(strlen($strPrefix)==0) {
+ $strPrefix="a"; //Assign an arbitrary namespace prefix.
+ }
+ $xml->registerXPathNamespace($strPrefix,$strNamespace);
+ }
+
+
+
+ if ($email = $xml->xpath('//a:EMailAddress')) {
$this->email = (string) array_shift($email);
}
- if ($schema = $xml->xpath('/Autodiscover/Request/AcceptableResponseSchema')) {
+ if ($schema = $xml->xpath('//a:AcceptableResponseSchema')) {
$schema = (string) array_shift($schema);
if (strpos($schema, 'mobilesync')) {

File Metadata

Mime Type
text/plain
Expires
Thu, Apr 9, 2:56 PM (2 d, 1 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18850972
Default Alt Text
D44.1775746568.diff (3 KB)

Event Timeline