From 1d22372265eab4b89f724f9d66d1cbdfb4920881 Mon Sep 17 00:00:00 2001 From: Michael J Rubinsky Date: Sun, 24 Oct 2021 22:17:07 -0400 Subject: [PATCH] Return 503 if auth server is unavailable Note this will only happen in EAS < 14.0. Newer versions will respond with appropriate global status code. --- lib/Horde/Rpc/ActiveSync.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Horde/Rpc/ActiveSync.php b/lib/Horde/Rpc/ActiveSync.php index 06ec37d..41f8bba 100644 --- a/lib/Horde/Rpc/ActiveSync.php +++ b/lib/Horde/Rpc/ActiveSync.php @@ -238,6 +238,10 @@ protected function _handleError($e) protected function _sendAuthenticationFailedHeaders($e) { switch ($e->getCode()) { + case constant('Horde_ActiveSync_Status::SERVER_ERROR_RETRY'): + $this->_logger->warn('Authentication server unavailable, sending 503 response.'); + header('HTTP/1.1 503 Unavailable'); + break; case Horde_ActiveSync_Status::SYNC_NOT_ALLOWED: case Horde_ActiveSync_Status::DEVICE_BLOCKED_FOR_USER: $this->_logger->notice('Sending HTTP 403 Forbidden header response.');