mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-09-20 15:45:55 +08:00
Resolve #171
This commit is contained in:
parent
1d9c772b94
commit
3af8652175
|
@ -1273,7 +1273,7 @@ abstract class Utils
|
|||
|
||||
return !empty($mFunctionNameOrNames)
|
||||
&& \function_exists($mFunctionNameOrNames)
|
||||
&& !\is_callable($mFunctionNameOrNames);
|
||||
&& \is_callable($mFunctionNameOrNames);
|
||||
}
|
||||
|
||||
public static function ClearNullBite($mValue) : string
|
||||
|
|
|
@ -98,8 +98,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
|
||||
$this->aCapabilityItems = $this->getResponse('*')->getCapabilityResult();
|
||||
|
||||
if (\MailSo\Net\Enumerations\ConnectionSecurityType::UseStartTLS(
|
||||
$this->IsSupported('STARTTLS'), $this->iSecurityType))
|
||||
if ($this->IsSupported('STARTTLS') && \MailSo\Net\Enumerations\ConnectionSecurityType::UseStartTLS($this->iSecurityType))
|
||||
{
|
||||
$this->SendRequestGetResponse('STARTTLS');
|
||||
$this->EnableCrypto();
|
||||
|
|
|
@ -47,11 +47,11 @@ abstract class ConnectionSecurityType
|
|||
return self::SSL === $iResult;
|
||||
}
|
||||
|
||||
public static function UseStartTLS(bool $bSupported, int $iSecurityType, bool $bHasSupportedAuth = true) : bool
|
||||
public static function UseStartTLS(int $iSecurityType, bool $bHasSupportedAuth = true) : bool
|
||||
{
|
||||
return ($bSupported &&
|
||||
(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'));
|
||||
return
|
||||
(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');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,8 +72,7 @@ class ManageSieveClient extends \MailSo\Net\NetClient
|
|||
$this->validateResponse($aResponse);
|
||||
$this->parseStartupResponse($aResponse);
|
||||
|
||||
if (\MailSo\Net\Enumerations\ConnectionSecurityType::UseStartTLS(
|
||||
$this->IsSupported('STARTTLS'), $this->iSecurityType))
|
||||
if ($this->IsSupported('STARTTLS') && \MailSo\Net\Enumerations\ConnectionSecurityType::UseStartTLS($this->iSecurityType))
|
||||
{
|
||||
$this->sendRequestWithCheck('STARTTLS');
|
||||
$this->EnableCrypto();
|
||||
|
|
|
@ -432,8 +432,7 @@ class SmtpClient extends \MailSo\Net\NetClient
|
|||
|
||||
$this->ehloOrHelo($sEhloHost);
|
||||
|
||||
if (\MailSo\Net\Enumerations\ConnectionSecurityType::UseStartTLS(
|
||||
$this->IsSupported('STARTTLS'), $this->iSecurityType, $this->HasSupportedAuth()))
|
||||
if ($this->IsSupported('STARTTLS') && \MailSo\Net\Enumerations\ConnectionSecurityType::UseStartTLS($this->iSecurityType, $this->HasSupportedAuth()))
|
||||
{
|
||||
$this->sendRequestWithCheck('STARTTLS', 220);
|
||||
$this->EnableCrypto();
|
||||
|
|
Loading…
Reference in a new issue