diff --git a/data/web/autodiscover.php b/data/web/autodiscover.php index 3f2fd1b4..819dc7ee 100644 --- a/data/web/autodiscover.php +++ b/data/web/autodiscover.php @@ -27,9 +27,18 @@ if(file_exists('inc/vars.local.inc.php')) { error_reporting(0); -if ($config['useEASforOutlook'] == 'no') { - if (strpos($_SERVER['HTTP_USER_AGENT'], 'Outlook')) { - $config['autodiscoverType'] = 'imap'; +$data = trim(file_get_contents("php://input")); + +// Desktop client needs IMAP, unless it's Outlook 2013 or higher on Windows +if (strpos($data, 'autodiscover/outlook/responseschema')) { // desktop client + $config['autodiscoverType'] = 'imap'; + if ($config['useEASforOutlook'] == 'yes' && + strpos($_SERVER['HTTP_USER_AGENT'], 'Outlook') !== FALSE && // Outlook + strpos($_SERVER['HTTP_USER_AGENT'], 'Windows NT') !== FALSE && // Windows + preg_match('/Outlook (1[5-9]\.|[2-9]|1[0-9][0-9])/', $_SERVER['HTTP_USER_AGENT']) && // Outlook 2013 (version 15) or higher + strpos($_SERVER['HTTP_USER_AGENT'], 'MS Connectivity Analyzer') === FALSE // https://testconnectivity.microsoft.com doesn't support EAS for Outlook + ) { + $config['autodiscoverType'] = 'activesync'; } } @@ -53,7 +62,6 @@ if (!isset($_SERVER['PHP_AUTH_USER']) OR $as !== "user") { header("Content-Type: application/xml"); echo ''; - $data = trim(file_get_contents("php://input")); if(!$data) { list($usec, $sec) = explode(' ', microtime()); echo ''; @@ -69,6 +77,9 @@ if (!isset($_SERVER['PHP_AUTH_USER']) OR $as !== "user") { if ($config['autodiscoverType'] == 'imap') { ?> + + + email settings @@ -94,6 +105,18 @@ if (!isset($_SERVER['PHP_AUTH_USER']) OR $as !== "user") { on off + + CalDAV + https:///SOGo/dav//Calendar + off + + + + CardDAV + https:///SOGo/dav//Contacts + off + +