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

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

commit 47731771a16a7eaeda2f04e48187c32cfdc07973
Author: Benoit Tellier <[email protected]>
AuthorDate: Wed Jul 7 16:33:03 2021 +0700

    JAMES-3610 Add back a test for SMTP max line length
---
 .../java/org/apache/james/smtp/SmtpSizeLimitationTest.java  | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git 
a/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/SmtpSizeLimitationTest.java
 
b/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/SmtpSizeLimitationTest.java
index 1e2d712..339ff92 100644
--- 
a/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/SmtpSizeLimitationTest.java
+++ 
b/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/SmtpSizeLimitationTest.java
@@ -81,6 +81,19 @@ class SmtpSizeLimitationTest {
     }
 
     @Test
+    void messageShouldNotBeAcceptedWhenExceedLineLength(@TempDir File 
temporaryFolder) throws Exception {
+        createJamesServer(temporaryFolder, SmtpConfiguration.builder()
+            .doNotVerifyIdentity()
+            .withMaxMessageSize("10M"));
+
+        assertThatThrownBy(() ->
+            messageSender.connect(LOCALHOST_IP, 
jamesServer.getProbe(SmtpGuiceProbe.class).getSmtpPort())
+                .authenticate(USER, PASSWORD)
+                .sendMessageWithHeaders(USER, USER, Strings.repeat("A long 
line-", 1024)))
+            .isEqualTo(new SMTPSendingException(SmtpSendingStep.Data, "500 
Line length exceeded. See RFC 2821 #4.5.3.1.\n"));
+    }
+
+    @Test
     void messageShouldBeAcceptedWhenNotOverSized(@TempDir File 
temporaryFolder) throws Exception {
         createJamesServer(temporaryFolder, SmtpConfiguration.builder()
             .doNotVerifyIdentity()

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

Reply via email to