From d2e2e5ee3c33f4d35c3884e11ac3876a2f708e8a Mon Sep 17 00:00:00 2001 From: mguessan Date: Wed, 2 Sep 2009 22:24:53 +0000 Subject: [PATCH] IMAP: Send bodystructure with headers for iPhone request (BODYSTRUCTURE BODY.PEEK[HEADER]) git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@693 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/imap/ImapConnection.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/java/davmail/imap/ImapConnection.java b/src/java/davmail/imap/ImapConnection.java index 19eb35c5..35ff0954 100644 --- a/src/java/davmail/imap/ImapConnection.java +++ b/src/java/davmail/imap/ImapConnection.java @@ -520,6 +520,12 @@ public class ImapConnection extends AbstractConnection { PartOutputStream partOutputStream = new PartOutputStream(baos, true, false, 0); message.write(partOutputStream); baos.close(); + + if (bodystructure) { + bodystructure = false; + // Apple Mail: need to build full bodystructure + appendBodyStructure(buffer, baos); + } buffer.append(" RFC822.SIZE ").append(partOutputStream.size); if ("BODY.PEEK[HEADER]".equals(param)) { buffer.append(" BODY[HEADER] {"); @@ -555,6 +561,7 @@ public class ImapConnection extends AbstractConnection { baos.close(); if (bodystructure) { + bodystructure = false; // Apple Mail: need to build full bodystructure appendBodyStructure(buffer, baos); }