From 8fa03fb247e3b56c33200ed874a1bd287e5c8efd Mon Sep 17 00:00:00 2001 From: mguessan Date: Wed, 2 Sep 2009 21:57:35 +0000 Subject: [PATCH] IMAP: send BODY[TEXT] for BODY.PEEK[TEXT] request, may improve iPhone support git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@692 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/imap/ImapConnection.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/java/davmail/imap/ImapConnection.java b/src/java/davmail/imap/ImapConnection.java index adea2271..19eb35c5 100644 --- a/src/java/davmail/imap/ImapConnection.java +++ b/src/java/davmail/imap/ImapConnection.java @@ -558,7 +558,12 @@ public class ImapConnection extends AbstractConnection { // Apple Mail: need to build full bodystructure appendBodyStructure(buffer, baos); } - buffer.append(" RFC822.SIZE ").append(rfc822size).append(' ').append("BODY[]"); + buffer.append(" RFC822.SIZE ").append(rfc822size).append(' '); + if ("BODY.PEEK[TEXT]".equals(param)) { + buffer.append("BODY[TEXT]"); + } else { + buffer.append("BODY[]"); + } // partial if (startIndex > 0) { buffer.append('<').append(startIndex).append('>'); @@ -779,7 +784,7 @@ public class ImapConnection extends AbstractConnection { if (token.startsWith("SENT")) { searchAttribute = "urn:schemas:httpmail:date"; } else { - searchAttribute = "DAV:getlastmodified"; + searchAttribute = "DAV:getlastmodified"; } if (token.endsWith("ON")) {