From b6dd407aa72d48372cc30582b8202c3b9735a084 Mon Sep 17 00:00:00 2001 From: Joshua Tauberer Date: Tue, 19 Aug 2014 11:49:20 +0000 Subject: [PATCH] z-push autodiscover should use the primary hostname for the mail server and not the domain part of the email address (both may work, but the primary hostname is more likely to have a signed SSL cert) --- conf/zpush/autodiscover_config.php | 4 ++-- setup/zpush.sh | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/conf/zpush/autodiscover_config.php b/conf/zpush/autodiscover_config.php index e26feeb1..df6faa1e 100644 --- a/conf/zpush/autodiscover_config.php +++ b/conf/zpush/autodiscover_config.php @@ -9,7 +9,7 @@ define('BASE_PATH', dirname($_SERVER['SCRIPT_FILENAME']). '/'); // The Z-Push server location for the autodiscover response -define('SERVERURL', 'https://' . $_SERVER['SERVER_NAME'] . '/Microsoft-Server-ActiveSync'); +define('SERVERURL', 'https://PRIMARY_HOSTNAME/Microsoft-Server-ActiveSync'); define('USE_FULLEMAIL_FOR_LOGIN', true); @@ -21,4 +21,4 @@ define('LOGUSERLEVEL', LOGLEVEL); // the backend data provider define('BACKEND_PROVIDER', 'BackendCombined'); -?> \ No newline at end of file +?> diff --git a/setup/zpush.sh b/setup/zpush.sh index 22e57e92..a220b138 100755 --- a/setup/zpush.sh +++ b/setup/zpush.sh @@ -63,6 +63,7 @@ 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 +sed -i "s/PRIMARY_HOSTNAME/$PRIMARY_HOSTNAME/" /usr/local/lib/z-push/autodiscover/config.php # Some directories it will use.