Fixed Javamail/allow UTF-8

This commit is contained in:
M66B 2022-06-22 19:07:00 +02:00
parent b39e8c468d
commit bf19df9c02
3 changed files with 6 additions and 6 deletions

View File

@ -245,7 +245,7 @@ public class MessageHelper {
System.setProperty("mail.mime.encodefilename", "false");
System.setProperty("mail.mime.decodeparameters", "true");
System.setProperty("mail.mime.encodeparameters", "true");
System.setProperty("mail.mime.allowutf8", "false"); // InternetAddress, MimeBodyPart, MimeUtility
System.setProperty("mail.mime.allowutf8", "false"); // InternetAddress, (MimeBodyPart: session), MimeUtility
System.setProperty("mail.mime.cachemultipart", "false");
// https://docs.oracle.com/javaee/6/api/javax/mail/internet/MimeMultipart.html

View File

@ -78,8 +78,8 @@ public class MimeBodyPart extends BodyPart implements MimePart {
private static final boolean ignoreMultipartEncoding =
PropUtil.getBooleanSystemProperty(
"mail.mime.ignoremultipartencoding", true);
private static final boolean allowutf8 =
PropUtil.getBooleanSystemProperty("mail.mime.allowutf8", true);
//private static final boolean allowutf8 =
//PropUtil.getBooleanSystemProperty("mail.mime.allowutf8", true);
// Paranoia:
// allow this last minute change to be disabled if it causes problems
@ -969,7 +969,7 @@ public class MimeBodyPart extends BodyPart implements MimePart {
@Override
public void writeTo(OutputStream os)
throws IOException, MessagingException {
writeTo(this, os, null);
writeTo(this, os, null, false);
}
/**
@ -1620,7 +1620,7 @@ public class MimeBodyPart extends BodyPart implements MimePart {
part.removeHeader("Content-Transfer-Encoding");
}
static void writeTo(MimePart part, OutputStream os, String[] ignoreList)
static void writeTo(MimePart part, OutputStream os, String[] ignoreList, boolean allowutf8)
throws IOException, MessagingException {
// see if we already have a LOS

View File

@ -1877,7 +1877,7 @@ public class MimeMessage extends Message implements MimePart {
saveChanges();
if (modified) {
MimeBodyPart.writeTo(this, os, ignoreList);
MimeBodyPart.writeTo(this, os, ignoreList, allowutf8);
return;
}