This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 5c2ab8502e757c6e630c19a5ec215fb8f9fdfda8
Author: Felix Auringer <[email protected]>
AuthorDate: Mon Dec 8 12:54:51 2025 +0100

    feat(managesieve): add additional test for usage of spaces as delimiters in 
SASL PLAIN
---
 .../org/apache/james/managesieveserver/AuthenticateTest.java     | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git 
a/server/protocols/protocols-managesieve/src/test/java/org/apache/james/managesieveserver/AuthenticateTest.java
 
b/server/protocols/protocols-managesieve/src/test/java/org/apache/james/managesieveserver/AuthenticateTest.java
index dc25cc5f64..63f9b86ec0 100644
--- 
a/server/protocols/protocols-managesieve/src/test/java/org/apache/james/managesieveserver/AuthenticateTest.java
+++ 
b/server/protocols/protocols-managesieve/src/test/java/org/apache/james/managesieveserver/AuthenticateTest.java
@@ -94,6 +94,15 @@ public class AuthenticateTest {
     // James is more lenient and also supports a space as the delimiter if the 
message is not base64-encoded.
     @Test
     void plainLoginWithSpaceAsDelimiterShouldSucceed() throws IOException {
+        String initialClientResponse = " " + 
ManageSieveServerTestSystem.USERNAME.asString() + " " + 
ManageSieveServerTestSystem.PASSWORD;
+        this.client.sendCommand("AUTHENTICATE \"PLAIN\" \"" + 
initialClientResponse + "\"");
+        ManageSieveClient.ServerResponse authenticationResponse = 
this.client.readResponse();
+        
Assertions.assertThat(authenticationResponse.responseType()).isEqualTo(ManageSieveClient.ResponseType.OK);
+    }
+
+    // This tests the combination of both lenient behaviors above.
+    @Test
+    void plainLoginWithSpaceAsDelimiterWithoutLeadingSpaceShouldSucceed() 
throws IOException {
         String initialClientResponse = 
ManageSieveServerTestSystem.USERNAME.asString() + " " + 
ManageSieveServerTestSystem.PASSWORD;
         this.client.sendCommand("AUTHENTICATE \"PLAIN\" \"" + 
initialClientResponse + "\"");
         ManageSieveClient.ServerResponse authenticationResponse = 
this.client.readResponse();


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to