mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-06-27 00:36:44 +03:00
Resolve #693
This commit is contained in:
parent
77ab2fddf5
commit
288e1c8742
1 changed files with 5 additions and 1 deletions
|
|
@ -9,7 +9,10 @@ class Login extends \SnappyMail\SASL
|
|||
|
||||
public function authenticate(string $username, string $passphrase, ?string $challenge = null) : string
|
||||
{
|
||||
if ($challenge && 'Username:' !== $this->decode($challenge)) {
|
||||
// $challenge should be 'VXNlcm5hbWU6', but broken on some systems
|
||||
// See https://github.com/the-djmaze/snappymail/issues/693
|
||||
if ($challenge && \str_starts_with($this->decode($challenge), 'Username:')) {
|
||||
// if ($challenge && 'Username:' !== $this->decode($challenge)) {
|
||||
throw new \Exception("Invalid response: {$challenge}");
|
||||
}
|
||||
$this->passphrase = $passphrase;
|
||||
|
|
@ -18,6 +21,7 @@ class Login extends \SnappyMail\SASL
|
|||
|
||||
public function challenge(string $challenge) : ?string
|
||||
{
|
||||
// $challenge should be 'UGFzc3dvcmQ6'
|
||||
if ($challenge && 'Password:' !== $this->decode($challenge)) {
|
||||
throw new \Exception("invalid response: {$challenge}");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue