diff --git a/k9mail/src/main/java/com/fsck/k9/crypto/MessageCryptoStructureDetector.java b/k9mail/src/main/java/com/fsck/k9/crypto/MessageCryptoStructureDetector.java index 974811957..cd8bd7034 100644 --- a/k9mail/src/main/java/com/fsck/k9/crypto/MessageCryptoStructureDetector.java +++ b/k9mail/src/main/java/com/fsck/k9/crypto/MessageCryptoStructureDetector.java @@ -233,7 +233,7 @@ public class MessageCryptoStructureDetector { return dataUnavailable || protocolMatches; } - private static boolean isPartMultipartEncrypted(Part part) { + public static boolean isPartMultipartEncrypted(Part part) { if (!isSameMimeType(part.getMimeType(), MULTIPART_ENCRYPTED)) { return false; } diff --git a/k9mail/src/main/java/com/fsck/k9/mailstore/MessageViewInfoExtractor.java b/k9mail/src/main/java/com/fsck/k9/mailstore/MessageViewInfoExtractor.java index a51ddff2d..feeb06946 100644 --- a/k9mail/src/main/java/com/fsck/k9/mailstore/MessageViewInfoExtractor.java +++ b/k9mail/src/main/java/com/fsck/k9/mailstore/MessageViewInfoExtractor.java @@ -83,10 +83,9 @@ public class MessageViewInfoExtractor { return extractSimpleMessageForView(message, message); } - boolean isOpenPgpEncrypted = - MimeUtility.isSameMimeType(cryptoContentPart.getMimeType(), "multipart/encrypted") && - MimeUtility.isSameMimeType(getHeaderParameter(cryptoContentPart.getContentType(), "protocol"), - "application/pgp-encrypted"); + boolean isOpenPgpEncrypted = (MessageCryptoStructureDetector.isPartMultipartEncrypted(cryptoContentPart) && + MessageCryptoStructureDetector.isMultipartEncryptedOpenPgpProtocol(cryptoContentPart)) || + MessageCryptoStructureDetector.isPartPgpInlineEncrypted(cryptoContentPart); if (!K9.isOpenPgpProviderConfigured() && isOpenPgpEncrypted) { CryptoResultAnnotation noProviderAnnotation = CryptoResultAnnotation.createErrorAnnotation( CryptoError.OPENPGP_ENCRYPTED_NO_PROVIDER, null);