mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 16:37:02 +03:00
Resolve #171
This commit is contained in:
parent
1d9c772b94
commit
3af8652175
5 changed files with 9 additions and 12 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
|
|
|
||||||
|
|
@ -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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue