mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-25 10:09:20 +03:00
Code refactoring
This commit is contained in:
parent
4a95dd6195
commit
36329110e5
81 changed files with 3474 additions and 2124 deletions
|
|
@ -195,15 +195,63 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
|
||||
try
|
||||
{
|
||||
if ($bUseAuthPlainIfSupported && $this->IsSupported('AUTH=PLAIN'))
|
||||
// TODO
|
||||
if (false && $this->IsSupported('AUTH=CRAM-MD5'))
|
||||
{
|
||||
$this->SendRequest('AUTHENTICATE', array('CRAM-MD5'));
|
||||
|
||||
$aResponse = $this->parseResponseWithValidation();
|
||||
if ($aResponse && \is_array($aResponse) && 0 < \count($aResponse) &&
|
||||
\MailSo\Imap\Enumerations\ResponseType::CONTINUATION === $aResponse[\count($aResponse) - 1]->ResponseType)
|
||||
{
|
||||
$oContinuationResponse = null;
|
||||
foreach ($aResponse as $oResponse)
|
||||
{
|
||||
if ($oResponse && \MailSo\Imap\Enumerations\ResponseType::CONTINUATION === $oResponse->ResponseType)
|
||||
{
|
||||
$oContinuationResponse = $oResponse;
|
||||
}
|
||||
}
|
||||
|
||||
if ($oContinuationResponse)
|
||||
{
|
||||
$sToken = \base64_encode("\0".$sLogin."\0".$sPassword);
|
||||
if ($this->oLogger)
|
||||
{
|
||||
$this->oLogger->AddSecret($sToken);
|
||||
}
|
||||
|
||||
$this->Logger()->WriteDump($aResponse);
|
||||
|
||||
$this->sendRaw($sToken, true, '*******');
|
||||
$this->parseResponseWithValidation();
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ($bUseAuthPlainIfSupported && $this->IsSupported('AUTH=PLAIN'))
|
||||
{
|
||||
$sToken = \base64_encode("\0".$sLogin."\0".$sPassword);
|
||||
if ($this->oLogger)
|
||||
{
|
||||
$this->oLogger->AddSecret(\base64_encode("\0".$sLogin."\0".$sPassword));
|
||||
$this->oLogger->AddSecret($sToken);
|
||||
}
|
||||
|
||||
$this->SendRequestWithCheck('AUTHENTICATE',
|
||||
array('PLAIN', \base64_encode("\0".$sLogin."\0".$sPassword)));
|
||||
if ($this->IsSupported('AUTH=SASL-IR') && false)
|
||||
{
|
||||
$this->SendRequestWithCheck('AUTHENTICATE', array('PLAIN', $sToken));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->SendRequest('AUTHENTICATE', array('PLAIN'));
|
||||
$this->parseResponseWithValidation();
|
||||
|
||||
$this->sendRaw($sToken, true, '*******');
|
||||
$this->parseResponseWithValidation();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue