IMAP: fixes to improve JavaMail support

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@956 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-03-17 21:03:24 +00:00
parent d90b8d68bb
commit 93cf6156cc
1 changed files with 4 additions and 3 deletions

View File

@ -570,7 +570,7 @@ public class ImapConnection extends AbstractConnection {
os.write(baos.toByteArray()); os.write(baos.toByteArray());
os.flush(); os.flush();
buffer.setLength(0); buffer.setLength(0);
} else if (param.startsWith("BODY[]") || param.startsWith("BODY.PEEK[]") || "BODY.PEEK[TEXT]".equals(param)) { } else if (param.startsWith("BODY[]") || param.startsWith("BODY.PEEK[]") || param.startsWith("BODY[TEXT]") || "BODY.PEEK[TEXT]".equals(param)) {
// parse buffer size // parse buffer size
int startIndex = 0; int startIndex = 0;
int ltIndex = param.indexOf('<'); int ltIndex = param.indexOf('<');
@ -820,14 +820,15 @@ public class ImapConnection extends AbstractConnection {
} }
buffer.append(')'); buffer.append(')');
} else { } else {
buffer.append(" ()"); buffer.append(" NIL");
} }
} }
appendBodyStructureValue(buffer, bodyPart.getContentID()); appendBodyStructureValue(buffer, bodyPart.getContentID());
appendBodyStructureValue(buffer, bodyPart.getDescription()); appendBodyStructureValue(buffer, bodyPart.getDescription());
appendBodyStructureValue(buffer, bodyPart.getEncoding()); appendBodyStructureValue(buffer, bodyPart.getEncoding());
appendBodyStructureValue(buffer, bodyPart.getSize()); appendBodyStructureValue(buffer, bodyPart.getSize());
appendBodyStructureValue(buffer, bodyPart.getLineCount()); // line count not implemented in JavaMail, return 0
appendBodyStructureValue(buffer, 0);
buffer.append(')'); buffer.append(')');
} }