mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-02-25 07:16:21 +08:00
Sieve support login with OAUTHBEARER/XOAUTH2
This commit is contained in:
parent
ed109740cd
commit
89f0e81194
1 changed files with 5 additions and 3 deletions
|
@ -115,6 +115,8 @@ class ManageSieveClient extends \MailSo\Net\NetClient
|
|||
// 'SCRAM-SHA-256' => 1, // !$encrypted
|
||||
// 'SCRAM-SHA-1' => 1, // !$encrypted
|
||||
// 'CRAM-MD5' => 1, // $encrypted
|
||||
'OAUTHBEARER' => $aCredentials['UseAuthOAuth2IfSupported'],
|
||||
'XOAUTH2' => $aCredentials['UseAuthOAuth2IfSupported'],
|
||||
'PLAIN' => 1, // $encrypted
|
||||
'LOGIN' => 1 // $encrypted
|
||||
];
|
||||
|
@ -131,17 +133,17 @@ class ManageSieveClient extends \MailSo\Net\NetClient
|
|||
$bAuth = false;
|
||||
try
|
||||
{
|
||||
if ('PLAIN' === $type)
|
||||
if ('PLAIN' === $type || 'OAUTHBEARER' === $type || 'XOAUTH2' === $type)
|
||||
{
|
||||
$sAuth = $SASL->authenticate($sLogin, $sPassword, $sLoginAuthKey);
|
||||
|
||||
if ($aCredentials['InitialAuthPlain'])
|
||||
{
|
||||
$this->sendRequest('AUTHENTICATE "PLAIN" "'.$sAuth.'"');
|
||||
$this->sendRequest("AUTHENTICATE \"{$type}\" \"{$sAuth}\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->sendRequest('AUTHENTICATE "PLAIN" {'.\strlen($sAuth).'+}');
|
||||
$this->sendRequest("AUTHENTICATE \"{$type}\" {".\strlen($sAuth).'+}');
|
||||
$this->sendRequest($sAuth);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue