feat(transport-smtp): Support to SASL draft login challenge (#911)

This commit is contained in:
Hodu Mayo
2024-02-15 05:18:56 +09:00
committed by GitHub
parent 75770f7bc6
commit 1196e332ee

View File

@@ -98,11 +98,13 @@ impl Mechanism {
let decoded_challenge = challenge let decoded_challenge = challenge
.ok_or_else(|| error::client("This mechanism does expect a challenge"))?; .ok_or_else(|| error::client("This mechanism does expect a challenge"))?;
if ["User Name", "Username:", "Username"].contains(&decoded_challenge) { if ["User Name", "Username:", "Username", "User Name\0"]
.contains(&decoded_challenge)
{
return Ok(credentials.authentication_identity.clone()); return Ok(credentials.authentication_identity.clone());
} }
if ["Password", "Password:"].contains(&decoded_challenge) { if ["Password", "Password:", "Password\0"].contains(&decoded_challenge) {
return Ok(credentials.secret.clone()); return Ok(credentials.secret.clone());
} }