Check multiparts

pull/196/head
M66B 5 years ago
parent f3cc91fb65
commit 41ef956695

@ -2372,7 +2372,9 @@ public class MessageHelper {
if ("application/pgp-signature".equals(protocol) ||
"application/pkcs7-signature".equals(protocol) ||
"application/x-pkcs7-signature".equals(protocol)) {
Multipart multipart = (Multipart) part.getContent();
Object content = part.getContent();
if (content instanceof Multipart) {
Multipart multipart = (Multipart) content;
if (multipart.getCount() == 2) {
getMessageParts(multipart.getBodyPart(0), parts, null);
getMessageParts(multipart.getBodyPart(1), parts,
@ -2405,13 +2407,17 @@ public class MessageHelper {
sb.append(' ').append(i).append('=').append(multipart.getBodyPart(i).getContentType());
Log.e(sb.toString());
}
} else
throw new MessagingException("Multipart=" + (content == null ? null : content.getClass().getName()));
} else
Log.e(ct.toString());
} else if (part.isMimeType("multipart/encrypted")) {
ContentType ct = new ContentType(part.getContentType());
String protocol = ct.getParameter("protocol");
if ("application/pgp-encrypted".equals(protocol) || protocol == null) {
Multipart multipart = (Multipart) part.getContent();
Object content = part.getContent();
if (content instanceof Multipart) {
Multipart multipart = (Multipart) content;
if (multipart.getCount() == 2) {
// Ignore header
getMessageParts(multipart.getBodyPart(1), parts, EntityAttachment.PGP_MESSAGE);
@ -2423,6 +2429,8 @@ public class MessageHelper {
sb.append(' ').append(i).append('=').append(multipart.getBodyPart(i).getContentType());
Log.e(sb.toString());
}
} else
throw new MessagingException("Multipart=" + (content == null ? null : content.getClass().getName()));
} else
Log.e(ct.toString());
} else if (part.isMimeType("application/pkcs7-mime") ||

Loading…
Cancel
Save