mirror of
https://github.com/moparisthebest/davmail
synced 2024-12-13 11:12:22 -05:00
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:
parent
b1edabf45f
commit
c94e881359
@ -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('"');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user