Skip to content

Commit

Permalink
Decode rfc822 body structure
Browse files Browse the repository at this point in the history
  • Loading branch information
M66B committed Sep 14, 2024
1 parent 85c9538 commit 8f2aeb2
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions app/src/main/java/com/sun/mail/imap/protocol/BODYSTRUCTURE.java
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,9 @@ public BODYSTRUCTURE(FetchResponse r) throws ParsingException {
throw new ParsingException(
"BODYSTRUCTURE parse error: bad ``lines'' element");
} else if (type.equalsIgnoreCase("message") &&
subtype.equalsIgnoreCase("rfc822") && false) {
subtype.equalsIgnoreCase("rfc822")) {
// 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
Expand All @@ -285,13 +285,19 @@ public BODYSTRUCTURE(FetchResponse r) throws ParsingException {
System.out.println(
"DEBUG IMAP: got envelope of nested message");
BODYSTRUCTURE[] bs = { new BODYSTRUCTURE(r) };
bodies = bs;
lines = r.readNumber();
//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);
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: " +
Expand Down

0 comments on commit 8f2aeb2

Please sign in to comment.