From 504c80211589c5adfc68cba0efe1d581289619f2 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 14 Sep 2024 18:01:30 +0200 Subject: [PATCH] Revert "Decode rfc822 body structure" This reverts commit 8f2aeb2b3c6c9325788b44184ec27da97a3b6258. --- .../com/sun/mail/imap/protocol/BODYSTRUCTURE.java | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/com/sun/mail/imap/protocol/BODYSTRUCTURE.java b/app/src/main/java/com/sun/mail/imap/protocol/BODYSTRUCTURE.java index 139caf35e1..279582c4da 100644 --- a/app/src/main/java/com/sun/mail/imap/protocol/BODYSTRUCTURE.java +++ b/app/src/main/java/com/sun/mail/imap/protocol/BODYSTRUCTURE.java @@ -271,9 +271,9 @@ public class BODYSTRUCTURE implements Item { throw new ParsingException( "BODYSTRUCTURE parse error: bad ``lines'' element"); } else if (type.equalsIgnoreCase("message") && - subtype.equalsIgnoreCase("rfc822")) { + subtype.equalsIgnoreCase("rfc822") && false) { // Nested message - //processedType = NESTED; + processedType = NESTED; // The envelope comes next, but sadly Gmail handles nested // messages just like simple body parts and fails to return // the envelope and body structure of the message (sort of @@ -285,19 +285,13 @@ public class BODYSTRUCTURE implements Item { System.out.println( "DEBUG IMAP: got envelope of nested message"); BODYSTRUCTURE[] bs = { new BODYSTRUCTURE(r) }; - //bodies = bs; - int l = r.readNumber(); - eu.faircode.email.Log.w("message/rfc822" + - " " + type + "/" + subtype + " " + encoding + - " bs=" + bs[0].type + "/"+ bs[0].subtype + " " + bs[0].encoding + - " lines=" + l); + bodies = bs; + lines = r.readNumber(); if (parseDebug) System.out.println("DEBUG IMAP: lines " + lines); -/* if (lines < 0) throw new ParsingException( "BODYSTRUCTURE parse error: bad ``lines'' element"); - */ } else { if (parseDebug) System.out.println("DEBUG IMAP: " +