mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 16:37:02 +03: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-256' => 1, // !$encrypted
|
||||||
// 'SCRAM-SHA-1' => 1, // !$encrypted
|
// 'SCRAM-SHA-1' => 1, // !$encrypted
|
||||||
// 'CRAM-MD5' => 1, // $encrypted
|
// 'CRAM-MD5' => 1, // $encrypted
|
||||||
|
'OAUTHBEARER' => $aCredentials['UseAuthOAuth2IfSupported'],
|
||||||
|
'XOAUTH2' => $aCredentials['UseAuthOAuth2IfSupported'],
|
||||||
'PLAIN' => 1, // $encrypted
|
'PLAIN' => 1, // $encrypted
|
||||||
'LOGIN' => 1 // $encrypted
|
'LOGIN' => 1 // $encrypted
|
||||||
];
|
];
|
||||||
|
|
@ -131,17 +133,17 @@ class ManageSieveClient extends \MailSo\Net\NetClient
|
||||||
$bAuth = false;
|
$bAuth = false;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if ('PLAIN' === $type)
|
if ('PLAIN' === $type || 'OAUTHBEARER' === $type || 'XOAUTH2' === $type)
|
||||||
{
|
{
|
||||||
$sAuth = $SASL->authenticate($sLogin, $sPassword, $sLoginAuthKey);
|
$sAuth = $SASL->authenticate($sLogin, $sPassword, $sLoginAuthKey);
|
||||||
|
|
||||||
if ($aCredentials['InitialAuthPlain'])
|
if ($aCredentials['InitialAuthPlain'])
|
||||||
{
|
{
|
||||||
$this->sendRequest('AUTHENTICATE "PLAIN" "'.$sAuth.'"');
|
$this->sendRequest("AUTHENTICATE \"{$type}\" \"{$sAuth}\"");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->sendRequest('AUTHENTICATE "PLAIN" {'.\strlen($sAuth).'+}');
|
$this->sendRequest("AUTHENTICATE \"{$type}\" {".\strlen($sAuth).'+}');
|
||||||
$this->sendRequest($sAuth);
|
$this->sendRequest($sAuth);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue