[Web] Revert some autodiscover changes, fix json_api for Postfix logs

master
andryyy 2017-10-03 16:48:33 +02:00
parent c59d03fcb3
commit 6287a395b5
2 changed files with 10 additions and 14 deletions

View File

@ -17,20 +17,15 @@ $data = trim(file_get_contents("php://input"));
file_put_contents('/tmp/dsa', json_encode($_SERVER), FILE_APPEND); file_put_contents('/tmp/dsa', json_encode($_SERVER), FILE_APPEND);
if ($autodiscover_config['autodiscoverType'] == 'activesync') { if (strpos($data, 'autodiscover/outlook/responseschema') !== false) {
if (preg_match("/(Outlook|Office)/i", $_SERVER['HTTP_USER_AGENT'])) { $autodiscover_config['autodiscoverType'] = 'imap';
if ($autodiscover_config['useEASforOutlook'] == 'yes') { if ($autodiscover_config['useEASforOutlook'] == 'yes' &&
preg_match("/^((?!.*Mac).)*(Outlook|Office).+1[5-9].*/i", $_SERVER['HTTP_USER_AGENT'], $supported_outlook); // Office for macOS does not support EAS
if (empty($supported_outlook)) { strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') === false &&
$autodiscover_config['autodiscoverType'] = 'imap'; // Outlook 2013 (version 15) or higher
} preg_match('/(Outlook|Office).+15\./', $_SERVER['HTTP_USER_AGENT'])
} ) {
else { $autodiscover_config['autodiscoverType'] = 'activesync';
$autodiscover_config['autodiscoverType'] = 'imap';
}
}
if (preg_match("/eM Client/i", $_SERVER['HTTP_USER_AGENT']) || !isset($_SERVER['HTTP_USER_AGENT'])) {
$autodiscover_config['autodiscoverType'] = 'imap';
} }
} }

View File

@ -768,6 +768,7 @@ if (isset($_SESSION['mailcow_cc_role']) || isset($_SESSION['pending_mailcow_cc_u
else { else {
echo '{}'; echo '{}';
} }
break;
case "autodiscover": case "autodiscover":
if (isset($extra) && !empty($extra)) { if (isset($extra) && !empty($extra)) {
$extra = intval($extra); $extra = intval($extra);