mirror of
https://github.com/moparisthebest/davmail
synced 2025-03-04 19:29:46 -05:00
Yet another MIME header fix (multiline), need a dedicated parser
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@72 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
a91a0e159d
commit
4bad3f5577
@ -1531,7 +1531,16 @@ public class ExchangeSession {
|
||||
// TODO : recode with header parser
|
||||
int filenameIndex = line.indexOf("filename=\"");
|
||||
if (filenameIndex >= 0) {
|
||||
fileName = line.substring(filenameIndex + 10, line.lastIndexOf("\""));
|
||||
// handle multiline header
|
||||
if (line.endsWith("\"")) {
|
||||
fileName = line.substring(filenameIndex + 10, line.lastIndexOf("\""));
|
||||
} else {
|
||||
fileName = line.substring(filenameIndex + 10);
|
||||
// read next file name line
|
||||
line = fixRenamedAttachment(reader.readLine(), currentAttachmentName);
|
||||
writeLine(os, line);
|
||||
fileName += line.substring(1, line.lastIndexOf("\""));
|
||||
}
|
||||
}
|
||||
}
|
||||
line = fixRenamedAttachment(reader.readLine(), currentAttachmentName);
|
||||
|
Loading…
x
Reference in New Issue
Block a user