Inbound Email Errors with Exchange IMAP

I found a solution just before giving up. I know this isn’t right, but it worked, the constant CRON emails stopped on every check, Inbound Mail check works.

Changed this:

    protected function getImapConnection($mailbox, $username, $password, $options = 0)
{
    $connection = null;
    $authenticators = ['', 'GSSAPI', 'NTLM'];

    while (!$connection && ($authenticator = array_shift($authenticators)) !== null) {
        if ($authenticator) {
            $params = [
                'DISABLE_AUTHENTICATOR' => $authenticator,
            ];
        } else {
            $params = [];
        }

        $connection = $this->getImap()->open($mailbox, $username, $password, $options, 0, $params);
    }

    return $connection;
}

To this:

    protected function getImapConnection($mailbox, $username, $password, $options = 0)
{
    $connection = null;
    $authenticators = ['', 'GSSAPI', 'NTLM'];

    while (!$connection && ($authenticator = array_shift($authenticators)) !== null) {
        if ($authenticator) {
            $params = [
                'DISABLE_AUTHENTICATOR' => 'GSSAPI', 'NTLM',
            ];
        } else {
            $params = ['DISABLE_AUTHENTICATOR' => 'GSSAPI', 'NTLM'];
        }

        $connection = $this->getImap()->open($mailbox, $username, $password, $options, 0, $params);
    }

    return $connection;
}