diff --git a/conf/nginx.conf b/conf/nginx.conf
index 0099274e..af28173b 100644
--- a/conf/nginx.conf
+++ b/conf/nginx.conf
@@ -61,7 +61,8 @@ server {
# Microsoft Exchange autodiscover.xml for email
location /autodiscover/autodiscover.xml {
include fastcgi_params;
- fastcgi_param SCRIPT_FILENAME /usr/local/bin/mailinabox-exchange-autodiscover.php;
+ fastcgi_param SCRIPT_FILENAME /usr/local/lib/z-push/autodiscover/autodiscover.php;
+ fastcgi_param PHP_VALUE "short_open_tag=Off";
fastcgi_pass php-fpm;
}
diff --git a/conf/zpush/autodiscover_config.php b/conf/zpush/autodiscover_config.php
new file mode 100644
index 00000000..e26feeb1
--- /dev/null
+++ b/conf/zpush/autodiscover_config.php
@@ -0,0 +1,24 @@
+
\ No newline at end of file
diff --git a/setup/zpush.sh b/setup/zpush.sh
index 74962290..22e57e92 100755
--- a/setup/zpush.sh
+++ b/setup/zpush.sh
@@ -60,6 +60,10 @@ cp conf/zpush/backend_carddav.php /usr/local/lib/z-push/backend/carddav/config.p
rm -f /usr/local/lib/z-push/backend/caldav/config.php
cp conf/zpush/backend_caldav.php /usr/local/lib/z-push/backend/caldav/config.php
+# Configure Autodiscover
+rm -f /usr/local/lib/z-push/autodiscover/config.php
+cp conf/zpush/autodiscover_config.php /usr/local/lib/z-push/autodiscover/config.php
+
# Some directories it will use.
mkdir -p /var/log/z-push
diff --git a/tools/exchange-autodiscover.php b/tools/exchange-autodiscover.php
deleted file mode 100755
index 77b0b966..00000000
--- a/tools/exchange-autodiscover.php
+++ /dev/null
@@ -1,92 +0,0 @@
-(.*?)<\/AcceptableResponseSchema>/', $post_body, $match);
- $AcceptableResponseSchema = $match[1];
-
- if ($AcceptableResponseSchema == "http://schemas.microsoft.com/exchange/autodiscover/mobilesync/responseschema/2006") {
- // There is no way to convey the user's login name with this?
- ?>
-
-
-
-
-
-
- MobileSync
- https://
- https://
-
-
-
-
-
-(.*?)<\/EMailAddress>/', $post_body, $match);
- $LOGIN = $match[1];
-
- header("Content-type: text/xml");
-?>
-
-
-
- https://
-
- email
- settings
-
-
- IMAP
-
- 993
- on
-
-
-
-
- SMTP
-
- 587
- on
-
-
-
-
- DAV
- https://
- on
- on
-
-
-
-
- WEB
- https:///mail
- on
-
-
-
-
-
-
-
diff --git a/tools/webfinger.php b/tools/webfinger.php
index 9fffbca0..91ea03e7 100755
--- a/tools/webfinger.php
+++ b/tools/webfinger.php
@@ -1,5 +1,9 @@