From 824d3b3b3f8304ebca1e47018847e61b8a1b03b7 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 3 Feb 2021 18:02:07 +0100 Subject: [PATCH] Added S/MIME fallback --- app/src/main/java/eu/faircode/email/MessageHelper.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/MessageHelper.java b/app/src/main/java/eu/faircode/email/MessageHelper.java index d902359f3f..d21d512c62 100644 --- a/app/src/main/java/eu/faircode/email/MessageHelper.java +++ b/app/src/main/java/eu/faircode/email/MessageHelper.java @@ -2370,13 +2370,16 @@ public class MessageHelper { part.isMimeType("application/x-pkcs7-mime")) { ContentType ct = new ContentType(part.getContentType()); String smimeType = ct.getParameter("smime-type"); - if ("enveloped-data".equals(smimeType)) { + if ("enveloped-data".equalsIgnoreCase(smimeType) || + "smime.p7m".equalsIgnoreCase(ct.getParameter("name"))) { getMessageParts(part, parts, EntityAttachment.SMIME_MESSAGE); return parts; - } else if ("signed-data".equals(smimeType)) { + } else if ("signed-data".equalsIgnoreCase(smimeType) || + "smime.p7s".equalsIgnoreCase(ct.getParameter("name"))) { getMessageParts(part, parts, EntityAttachment.SMIME_SIGNED_DATA); return parts; - } + } else + Log.e(ct.toString()); } } catch (ParseException ex) { Log.w(ex);