IMAP: fix 3353862, long file names encoding in BODYSTRUCTURE

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1812 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2011-10-03 22:18:41 +00:00
parent b1edabf45f
commit c94e881359
1 changed files with 2 additions and 2 deletions

View File

@ -1052,7 +1052,7 @@ public class ImapConnection extends AbstractConnection {
}
protected void appendBodyStructure(StringBuilder buffer, MimePart bodyPart) throws IOException, MessagingException {
String contentType = bodyPart.getContentType();
String contentType = MimeUtility.unfold(bodyPart.getContentType());
int slashIndex = contentType.indexOf('/');
if (slashIndex < 0) {
throw new DavMailException("EXCEPTION_INVALID_CONTENT_TYPE", contentType);
@ -1102,7 +1102,7 @@ public class ImapConnection extends AbstractConnection {
} else {
nameEndIndex = contentType.length();
}
String name = contentType.substring(nameindex + "name=".length(), nameEndIndex);
String name = contentType.substring(nameindex + "name=".length(), nameEndIndex).trim();
if (!name.startsWith("\"")) {
buffer.append('"');
}