mirror of
https://github.com/moparisthebest/davmail
synced 2025-02-28 09:21:49 -05:00
support multiline name in attachment header
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@60 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
2658817680
commit
e004248539
@ -609,6 +609,9 @@ public class ExchangeSession {
|
||||
folder.folderUrl = inboxUrl;
|
||||
} else if ("TRASH".equals(folderName)) {
|
||||
folder.folderUrl = deleteditemsUrl;
|
||||
// absolute folder path
|
||||
} else if (folderName != null && folderName.startsWith("/")) {
|
||||
folder.folderUrl = folderName;
|
||||
} else {
|
||||
folder.folderUrl = mailPath + folderName;
|
||||
}
|
||||
@ -1394,6 +1397,7 @@ public class ExchangeSession {
|
||||
}
|
||||
|
||||
public void processHeaders(BufferedReader reader, OutputStream os) throws IOException {
|
||||
// TODO implement a reliable header tokenizer
|
||||
String line;
|
||||
line = reader.readLine();
|
||||
while (line != null && line.length() > 0) {
|
||||
@ -1455,6 +1459,15 @@ public class ExchangeSession {
|
||||
} else if ("name".equalsIgnoreCase(tokenName.toLowerCase())) {
|
||||
name = token.substring(equalsIndex + 1);
|
||||
if (name.startsWith("\"")) {
|
||||
// if name is on more than one line, current line does not end with "
|
||||
if (!name.endsWith("\"")) {
|
||||
// append next lines
|
||||
do {
|
||||
line = reader.readLine();
|
||||
writeLine(os, line);
|
||||
name += line;
|
||||
} while (!line.trim().endsWith("\""));
|
||||
}
|
||||
name = name.substring(1, name.lastIndexOf("\""));
|
||||
}
|
||||
// name can be mime encoded
|
||||
|
Loading…
x
Reference in New Issue
Block a user