From 1196e332ee935cdd280cd006be8d9653b801e688 Mon Sep 17 00:00:00 2001 From: Hodu Mayo Date: Thu, 15 Feb 2024 05:18:56 +0900 Subject: [PATCH] feat(transport-smtp): Support to SASL draft login challenge (#911) --- src/transport/smtp/authentication.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/transport/smtp/authentication.rs b/src/transport/smtp/authentication.rs index 83ea26f..7562686 100644 --- a/src/transport/smtp/authentication.rs +++ b/src/transport/smtp/authentication.rs @@ -98,11 +98,13 @@ impl Mechanism { let decoded_challenge = 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()); } - if ["Password", "Password:"].contains(&decoded_challenge) { + if ["Password", "Password:", "Password\0"].contains(&decoded_challenge) { return Ok(credentials.secret.clone()); }