This commit is contained in:
djmaze 2021-12-13 14:50:17 +01:00
parent 1d9c772b94
commit 3af8652175
5 changed files with 9 additions and 12 deletions

View file

@ -1273,7 +1273,7 @@ abstract class Utils
return !empty($mFunctionNameOrNames) return !empty($mFunctionNameOrNames)
&& \function_exists($mFunctionNameOrNames) && \function_exists($mFunctionNameOrNames)
&& !\is_callable($mFunctionNameOrNames); && \is_callable($mFunctionNameOrNames);
} }
public static function ClearNullBite($mValue) : string public static function ClearNullBite($mValue) : string

View file

@ -98,8 +98,7 @@ class ImapClient extends \MailSo\Net\NetClient
$this->aCapabilityItems = $this->getResponse('*')->getCapabilityResult(); $this->aCapabilityItems = $this->getResponse('*')->getCapabilityResult();
if (\MailSo\Net\Enumerations\ConnectionSecurityType::UseStartTLS( if ($this->IsSupported('STARTTLS') && \MailSo\Net\Enumerations\ConnectionSecurityType::UseStartTLS($this->iSecurityType))
$this->IsSupported('STARTTLS'), $this->iSecurityType))
{ {
$this->SendRequestGetResponse('STARTTLS'); $this->SendRequestGetResponse('STARTTLS');
$this->EnableCrypto(); $this->EnableCrypto();

View file

@ -47,11 +47,11 @@ abstract class ConnectionSecurityType
return self::SSL === $iResult; 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 && return
(self::STARTTLS === $iSecurityType || (self::STARTTLS === $iSecurityType
(self::AUTO_DETECT === $iSecurityType && (!$bHasSupportedAuth || \MailSo\Config::$PreferStartTlsIfAutoDetect))) && || (self::AUTO_DETECT === $iSecurityType && (!$bHasSupportedAuth || \MailSo\Config::$PreferStartTlsIfAutoDetect)))
\defined('STREAM_CRYPTO_METHOD_TLS_CLIENT') && \MailSo\Base\Utils::FunctionExistsAndEnabled('stream_socket_enable_crypto')); && \defined('STREAM_CRYPTO_METHOD_TLS_CLIENT') && \MailSo\Base\Utils::FunctionExistsAndEnabled('stream_socket_enable_crypto');
} }
} }

View file

@ -72,8 +72,7 @@ class ManageSieveClient extends \MailSo\Net\NetClient
$this->validateResponse($aResponse); $this->validateResponse($aResponse);
$this->parseStartupResponse($aResponse); $this->parseStartupResponse($aResponse);
if (\MailSo\Net\Enumerations\ConnectionSecurityType::UseStartTLS( if ($this->IsSupported('STARTTLS') && \MailSo\Net\Enumerations\ConnectionSecurityType::UseStartTLS($this->iSecurityType))
$this->IsSupported('STARTTLS'), $this->iSecurityType))
{ {
$this->sendRequestWithCheck('STARTTLS'); $this->sendRequestWithCheck('STARTTLS');
$this->EnableCrypto(); $this->EnableCrypto();

View file

@ -432,8 +432,7 @@ class SmtpClient extends \MailSo\Net\NetClient
$this->ehloOrHelo($sEhloHost); $this->ehloOrHelo($sEhloHost);
if (\MailSo\Net\Enumerations\ConnectionSecurityType::UseStartTLS( if ($this->IsSupported('STARTTLS') && \MailSo\Net\Enumerations\ConnectionSecurityType::UseStartTLS($this->iSecurityType, $this->HasSupportedAuth()))
$this->IsSupported('STARTTLS'), $this->iSecurityType, $this->HasSupportedAuth()))
{ {
$this->sendRequestWithCheck('STARTTLS', 220); $this->sendRequestWithCheck('STARTTLS', 220);
$this->EnableCrypto(); $this->EnableCrypto();