chibenwa commented on a change in pull request #813:
URL: https://github.com/apache/james-project/pull/813#discussion_r777800959



##########
File path: 
server/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/SendMailHandler.java
##########
@@ -70,6 +70,8 @@ public HookResult onMessage(SMTPSession session, Mail mail) {
         LOGGER.debug("sending mail");
 
         try {
+            Message message = mail.getMessage();
+            message.setSubject(mail.getMessage().getSubject());

Review comment:
       Given the change to load headers using UTF-8 is this necessary?

##########
File path: 
server/container/core/src/main/java/org/apache/james/server/core/MailHeaders.java
##########
@@ -67,7 +66,7 @@ public MailHeaders() {
      */
     public MailHeaders(InputStream in) throws MessagingException {
         super();
-        load(in);
+        load(in, true);

Review comment:
       I think we would benefit from having a `private static boolean 
ALLOW_UTF_8 = true;` constant to explain what this nagic value means.

##########
File path: 
server/container/core/src/main/java/org/apache/james/server/core/MailHeaders.java
##########
@@ -19,17 +19,16 @@
 
 package org.apache.james.server.core;
 
+import org.apache.mailet.base.RFC2822Headers;
+
+import javax.mail.MessagingException;
+import javax.mail.internet.InternetHeaders;
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.Serializable;
 import java.util.Enumeration;
 
-import javax.mail.MessagingException;
-import javax.mail.internet.InternetHeaders;
-
-import org.apache.mailet.base.RFC2822Headers;
-

Review comment:
       This import reorder is likely not checkstyle friendly... Do you succeed 
to compile using maven after your changes?




-- 
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