mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2026-01-23 02:14:26 +00:00
Merge 3aeb4f8c04 into e727620bd3
This commit is contained in:
commit
56a596b4ed
1 changed files with 7 additions and 4 deletions
|
|
@ -8,12 +8,15 @@ if(file_exists('inc/vars.local.inc.php')) {
|
|||
$autodiscover_config = array_merge($default_autodiscover_config, $autodiscover_config);
|
||||
|
||||
header('Content-type: application/json');
|
||||
if (strtolower($_GET['Protocol']) == 'activesync' && getenv('SKIP_SOGO') != "y") {
|
||||
echo '{"Protocol":"ActiveSync","Url":"' . $autodiscover_config['activesync']['url'] . '"}';
|
||||
}
|
||||
elseif (strtolower($_GET['Protocol']) == 'autodiscoverv1') {
|
||||
if (strtolower($_GET['Protocol']) == 'autodiscoverv1') {
|
||||
echo '{"Protocol":"AutodiscoverV1","Url":"https://' . $_SERVER['HTTP_HOST'] . '/Autodiscover/Autodiscover.xml"}';
|
||||
}
|
||||
elseif (stripos($_SERVER['HTTP_USER_AGENT'], 'Autodetect') !== false) {
|
||||
http_response_code(404);
|
||||
}
|
||||
elseif (strtolower($_GET['Protocol']) == 'activesync' && getenv('SKIP_SOGO') != "y") {
|
||||
echo '{"Protocol":"ActiveSync","Url":"' . $autodiscover_config['activesync']['url'] . '"}';
|
||||
}
|
||||
else {
|
||||
http_response_code(400);
|
||||
echo '{"ErrorCode":"InvalidProtocol","ErrorMessage":"The given protocol value \u0027' . preg_replace("/[^\da-z]/i", '', $_GET['Protocol']) . '\u0027 is invalid. Supported values are \u0027ActiveSync,AutodiscoverV1\u0027"}';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue