mirror of
https://github.com/moparisthebest/davmail
synced 2025-02-28 09:21:49 -05:00
IMAP: Detect invalid content in message header field
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2140 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
af70807bf7
commit
0f65595a7f
@ -1946,10 +1946,15 @@ public abstract class ExchangeSession {
|
||||
// message not loaded, try to get headers only
|
||||
InputStream headers = getMimeHeaders();
|
||||
if (headers != null) {
|
||||
InternetHeaders internetHeaders = new InternetHeaders(headers);
|
||||
if (internetHeaders.getHeader("Subject") == null) {
|
||||
// invalid header content
|
||||
return null;
|
||||
}
|
||||
if (headerNames == null) {
|
||||
result = new InternetHeaders(headers).getAllHeaderLines();
|
||||
result = internetHeaders.getAllHeaderLines();
|
||||
} else {
|
||||
result = new InternetHeaders(headers).getMatchingHeaderLines(headerNames);
|
||||
result = internetHeaders.getMatchingHeaderLines(headerNames);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user