mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-10-06 11:45:48 +08:00
Bugfix: undefined SASLMechanisms
This commit is contained in:
parent
b3476818ee
commit
4583616ea6
1 changed files with 14 additions and 1 deletions
|
@ -285,9 +285,22 @@ class ActionsAdmin extends Actions
|
||||||
|
|
||||||
$sUsername = $this->GetActionParam('username', '');
|
$sUsername = $this->GetActionParam('username', '');
|
||||||
if ($sUsername) {
|
if ($sUsername) {
|
||||||
|
$aSASLMechanisms = [];
|
||||||
|
$oConfig = $this->Config();
|
||||||
|
if ($oConfig->Get('labs', 'sasl_allow_scram_sha', false)) {
|
||||||
|
// https://github.com/the-djmaze/snappymail/issues/182
|
||||||
|
\array_push($aSASLMechanisms, 'SCRAM-SHA3-512', 'SCRAM-SHA-512', 'SCRAM-SHA-256', 'SCRAM-SHA-1');
|
||||||
|
}
|
||||||
|
if ($oConfig->Get('labs', 'sasl_allow_cram_md5', false)) {
|
||||||
|
$aSASLMechanisms[] = 'CRAM-MD5';
|
||||||
|
}
|
||||||
|
if ($oConfig->Get('labs', 'sasl_allow_plain', true)) {
|
||||||
|
$aSASLMechanisms[] = 'PLAIN';
|
||||||
|
}
|
||||||
$oImapClient->Login([
|
$oImapClient->Login([
|
||||||
'Login' => $sUsername,
|
'Login' => $sUsername,
|
||||||
'Password' => $this->GetActionParam('password', '')
|
'Password' => $this->GetActionParam('password', ''),
|
||||||
|
'SASLMechanisms' => $aSASLMechanisms
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue