STARTTLS detection fix

This commit is contained in:
RainLoop Team 2014-09-19 11:35:33 +04:00
parent 260874d789
commit 48dc9859c2
2 changed files with 8 additions and 2 deletions

View file

@ -44,10 +44,15 @@ class Config
public static $MessageListDateFilter = 0;
/**
* @var int
* @var bool
*/
public static $LogSimpleLiterals = false;
/**
* @var bool
*/
public static $PreferStartTlsIfAutoDetect = true;
/**
* @var \MailSo\Log\Logger|null
*/

View file

@ -54,7 +54,8 @@ class ConnectionSecurityType
public static function UseStartTLS($bSupported, $iSecurityType, $bHasSupportedAuth = true)
{
return ($bSupported &&
(self::STARTTLS === $iSecurityType || (self::AUTO_DETECT === $iSecurityType && !$bHasSupportedAuth)) &&
(self::STARTTLS === $iSecurityType ||
(self::AUTO_DETECT === $iSecurityType && (!$bHasSupportedAuth || \MailSo\Config::$PreferStartTlsIfAutoDetect))) &&
\defined('STREAM_CRYPTO_METHOD_TLS_CLIENT') && \MailSo\Base\Utils::FunctionExistsAndEnabled('stream_socket_enable_crypto'));
}
}