Arsnael commented on code in PR #1501:
URL: https://github.com/apache/james-project/pull/1501#discussion_r1161402686


##########
server/apps/distributed-app/docs/modules/ROOT/pages/extending/smtp-hooks.adoc:
##########
@@ -1,7 +1,7 @@
 = Distributed James Server — Custom SMTP hooks
 :navtitle: Custom SMTP hooks
 
-SMTP hooks enable extending capabilities of the SMTP server and are run 
synchronously upon email reception, before the email is
+SMTP hooks enable extening capabilities of the SMTP server and are run 
synchronously upon email reception, before the email is

Review Comment:
   Previous version was the correct one, put back `extending` please :)



##########
mailet/api/src/main/java/org/apache/mailet/DsnParameters.java:
##########
@@ -44,10 +44,9 @@
 
 /**
  * Represents DSN parameters attached to the envelope of an Email transiting 
over SMTP
- *
  * See https://tools.ietf.org/html/rfc3461
  */
-public class DsnParameters {
+public class    DsnParameters {

Review Comment:
   Unnecessary spaces 



##########
server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/FutureReleaseEHLOHookTest.java:
##########
@@ -198,4 +199,47 @@ private void authenticate(SMTPClient smtpProtocol) throws 
IOException {
             .isEqualTo(235);
     }
 
+    @Test
+    void ehloShouldContainMaxFutureReleaseIntervalAndDateTime() throws 
Exception {
+        smtpServer.configure(FileConfigurationProvider.getConfig(
+            
ClassLoader.getSystemResourceAsStream("smtpserver-futurerelease.xml")));
+        smtpServer.init();
+
+        SMTPClient smtpProtocol = new SMTPClient();
+        InetSocketAddress bindedAddress = new 
ProtocolServerUtils(smtpServer).retrieveBindedAddress();
+        smtpProtocol.connect(bindedAddress.getAddress().getHostAddress(), 
bindedAddress.getPort());
+        authenticate(smtpProtocol);
+        smtpProtocol.sendCommand("EHLO localhost");
+
+        String[] listReplyString = smtpProtocol.getReplyString().split(" ");
+        int length = listReplyString.length;
+        System.out.println("listReplyString[-2]: " + listReplyString[length-2] 
+ "listReplyString[-1]: " + listReplyString[length-1]);
+        SoftAssertions.assertSoftly(softly -> {
+            
softly.assertThat(getMaxFurtureReleaseInterval(listReplyString[length-2])).isGreaterThan(0);
+            softly.assertThat(validDateTime(listReplyString[length-1]));
+        });
+    }
+
+    private int getMaxFurtureReleaseInterval(String interval) {
+        try {
+            return Integer.parseInt(interval);
+        } catch (NumberFormatException e) {
+            return -1;
+        }
+    }
+
+    private boolean validDateTime(String dateTime) {
+        try {
+            LocalDateTime.parse(dateTime, dateTimeFormatter);
+            return true;
+        } catch (Exception e) {
+            return false;
+        }
+    }
+
+    @Test
+    void test1() throws Exception {

Review Comment:
   Don't forget this :)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to