From 0beff4cdb8f51e1a53911a95b70d3a12823713aa Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Tue, 6 Dec 2016 23:27:13 +0100 Subject: [PATCH] use message/rfc822 as default content type for multipart/digest subparts --- .../java/com/fsck/k9/mail/internet/MimeBodyPart.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/k9mail-library/src/main/java/com/fsck/k9/mail/internet/MimeBodyPart.java b/k9mail-library/src/main/java/com/fsck/k9/mail/internet/MimeBodyPart.java index 5a784cb14..f5e5725ec 100644 --- a/k9mail-library/src/main/java/com/fsck/k9/mail/internet/MimeBodyPart.java +++ b/k9mail-library/src/main/java/com/fsck/k9/mail/internet/MimeBodyPart.java @@ -4,6 +4,7 @@ package com.fsck.k9.mail.internet; import com.fsck.k9.mail.Body; import com.fsck.k9.mail.BodyPart; import com.fsck.k9.mail.MessagingException; +import com.fsck.k9.mail.Multipart; import java.io.BufferedWriter; import java.io.IOException; @@ -93,7 +94,14 @@ public class MimeBodyPart extends BodyPart { @Override public String getContentType() { String contentType = getFirstHeader(MimeHeader.HEADER_CONTENT_TYPE); - return (contentType == null) ? "text/plain" : MimeUtility.unfoldAndDecode(contentType); + if (contentType != null) { + return MimeUtility.unfoldAndDecode(contentType); + } + Multipart parent = getParent(); + if (parent != null && "multipart/digest".equals(parent.getMimeType())) { + return "message/rfc822"; + } + return "text/plain"; } @Override