diff --git a/app/src/main/java/eu/faircode/email/MessageHelper.java b/app/src/main/java/eu/faircode/email/MessageHelper.java index f7b0fd4cab..5b9cab4572 100644 --- a/app/src/main/java/eu/faircode/email/MessageHelper.java +++ b/app/src/main/java/eu/faircode/email/MessageHelper.java @@ -31,7 +31,6 @@ import androidx.preference.PreferenceManager; import com.sun.mail.gimap.GmailMessage; import com.sun.mail.iap.ProtocolException; import com.sun.mail.imap.IMAPFolder; -import com.sun.mail.imap.IMAPInputStream; import com.sun.mail.imap.IMAPMessage; import com.sun.mail.imap.protocol.IMAPProtocol; import com.sun.mail.util.ASCIIUtility; @@ -2332,12 +2331,8 @@ public class MessageHelper { break; } } - } else if (content instanceof String) { - String text = (String) content; - String sample = text.substring(0, Math.min(200, text.length())); - Log.e("Mixed string=" + sample); } else - Log.e("Mixed type=" + (content == null ? null : content.getClass().getName())); + throw new IllegalArgumentException("Multipart=" + (content == null ? null : content.getClass().getName())); } if (part.isMimeType("multipart/signed")) { @@ -2452,16 +2447,8 @@ public class MessageHelper { Object content = part.getContent(); // Should always be Multipart if (content instanceof Multipart) multipart = (Multipart) part.getContent(); - else if (content instanceof String) { - String text = (String) content; - String sample = text.substring(0, Math.min(200, text.length())); - throw new ParseException(content.getClass().getName() + ": " + sample); - } else if (content instanceof IMAPInputStream) { - String text = Helper.readStream((IMAPInputStream) content); - String sample = text.substring(0, Math.min(200, text.length())); - throw new ParseException(content.getClass().getName() + ": " + sample); - } else - throw new IllegalArgumentException(content.getClass().getName()); + else + throw new IllegalArgumentException("Multipart=" + (content == null ? null : content.getClass().getName())); boolean other = false; List plain = new ArrayList<>();