diff --git a/snappymail/v/0.0.0/app/libraries/snappymail/sasl/login.php b/snappymail/v/0.0.0/app/libraries/snappymail/sasl/login.php index 4a84b4835..9dcbd446d 100644 --- a/snappymail/v/0.0.0/app/libraries/snappymail/sasl/login.php +++ b/snappymail/v/0.0.0/app/libraries/snappymail/sasl/login.php @@ -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}"); }