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 79c6c8ebb245f73e9fd4f1190ab7ee3744427a85
Author: Felix Auringer <[email protected]>
AuthorDate: Mon Nov 24 09:29:32 2025 +0100

    feat(managesieve): add test for old SASL PLAIN parsing behavior
---
 .../org/apache/james/managesieveserver/AuthenticateTest.java   | 10 ++++++++++
 1 file changed, 10 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 dfdce97777..05b3a83862 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
@@ -90,6 +90,16 @@ public class AuthenticateTest {
         
Assertions.assertThat(authenticationResponse.responseType()).isEqualTo(ManageSieveClient.ResponseType.OK);
     }
 
+    // The SASL PLAIN standard defines UTF8NUL as separator. To stay 
compatible with older versions of James,
+    // 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);
+    }
+
     @Test
     void plainLoginWithoutMechanismQuotesShouldNotSucceed() throws IOException 
{
         String initialClientResponse = "\0" + 
ManageSieveServerTestSystem.USERNAME.asString() + "\0" + 
ManageSieveServerTestSystem.PASSWORD;


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

Reply via email to