mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 04:29:21 +03:00
Resolve #1245
This commit is contained in:
parent
57c000908f
commit
b5552c1408
2 changed files with 5 additions and 3 deletions
|
|
@ -131,6 +131,9 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
}
|
||||
|
||||
$type = '';
|
||||
if ($this->Encrypted()) {
|
||||
\array_unshift($oSettings->SASLMechanisms, 'PLAIN', 'LOGIN');
|
||||
}
|
||||
foreach ($oSettings->SASLMechanisms as $sasl_type) {
|
||||
if ($this->hasCapability("AUTH={$sasl_type}") && \SnappyMail\SASL::isSupported($sasl_type)) {
|
||||
$type = $sasl_type;
|
||||
|
|
@ -159,8 +162,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
{
|
||||
if (\str_starts_with($type, 'SCRAM-'))
|
||||
{
|
||||
$sAuthzid = $this->getResponseValue($this->SendRequestGetResponse('AUTHENTICATE', array($type)), Enumerations\ResponseType::CONTINUATION);
|
||||
$this->sendRaw($SASL->authenticate($sLogin, $sPassword/*, $sAuthzid*/), true);
|
||||
$this->sendRaw($this->SendRequestGetResponse('AUTHENTICATE', array($type, $SASL->authenticate($sLogin, $sPassword))));
|
||||
$sChallenge = $SASL->challenge($this->getResponseValue($this->getResponse(), Enumerations\ResponseType::CONTINUATION));
|
||||
$this->logMask($sChallenge);
|
||||
$this->sendRaw($sChallenge);
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ class ConnectSettings implements \JsonSerializable
|
|||
}
|
||||
$object->shortLogin = !empty($aSettings['shortLogin']);
|
||||
$object->ssl = SSLContext::fromArray($aSettings['ssl'] ?? []);
|
||||
if (isset($aSettings['sasl'])) {
|
||||
if (!empty($aSettings['sasl']) && \is_array($aSettings['sasl'])) {
|
||||
$object->SASLMechanisms = $aSettings['sasl'];
|
||||
}
|
||||
// $object->tls_weak = !empty($aSettings['tls_weak']);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue