You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by GitBox <gi...@apache.org> on 2022/01/04 03:06:23 UTC
[GitHub] [james-project] chibenwa commented on a change in pull request #813: solve the problem when sending messages with Chinese subjects by some clients, subject displayed are as garbled codes
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: notifications-unsubscribe@james.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org