diff --git a/app/src/main/java/javax/mail/internet/InternetHeaders.java b/app/src/main/java/javax/mail/internet/InternetHeaders.java index 305e97968f..96b0e5d31e 100644 --- a/app/src/main/java/javax/mail/internet/InternetHeaders.java +++ b/app/src/main/java/javax/mail/internet/InternetHeaders.java @@ -434,7 +434,7 @@ public class InternetHeaders { } prevline = line; } - if (first && android.text.TextUtils.isEmpty(line) && is instanceof ByteArrayInputStream) { + if (false && first && android.text.TextUtils.isEmpty(line) && is instanceof ByteArrayInputStream) { // RFC1341 section 7.2.1 // Note that the encapsulation boundary must occur at the beginning of a line, i.e., following a CRLF, // and that that initial CRLF is considered to be part of the encapsulation boundary rather than part of the preceding part. diff --git a/app/src/main/java/javax/mail/internet/MimeMultipart.java b/app/src/main/java/javax/mail/internet/MimeMultipart.java index e71fc91d50..adadd93402 100644 --- a/app/src/main/java/javax/mail/internet/MimeMultipart.java +++ b/app/src/main/java/javax/mail/internet/MimeMultipart.java @@ -873,6 +873,14 @@ public class MimeMultipart extends Multipart { buf.write(inbuf, 0, inSize); part = createMimeBodyPart(headers, buf.toByteArray()); } + try { + ContentType ct = new ContentType(getContentType()); + eu.faircode.email.Log.i("MMM ct="+ ct.getBaseType()); + if ("multipart/digest".equals(ct.getBaseType())) + part.setHeader("Content-Type", "message/rfc822"); + } catch (Throwable ex) { + eu.faircode.email.Log.e(ex); + } super.addBodyPart(part); } } catch (IOException ioex) {