mirror of
https://github.com/moparisthebest/davmail
synced 2025-01-05 18:58:02 -05:00
IMAP: workaround for broken message headers on Exchange 2010
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2014 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
e0db84a369
commit
1122214601
@ -377,11 +377,13 @@ public class EwsExchangeSession extends ExchangeSession {
|
||||
EWSMethod.Item item = getItemMethod.getResponseItem();
|
||||
|
||||
String messageHeaders = item.get(Field.get("messageheaders").getResponseName());
|
||||
if (messageHeaders != null) {
|
||||
if (messageHeaders != null
|
||||
// workaround for broken message headers on Exchange 2010
|
||||
&& messageHeaders.toLowerCase().contains("message-id:")) {
|
||||
// workaround for messages in Sent folder
|
||||
if (messageHeaders.indexOf("From:") < 0) {
|
||||
String from = item.get(Field.get("from").getResponseName());
|
||||
messageHeaders = "From: "+from+"\n"+messageHeaders;
|
||||
messageHeaders = "From: " + from + "\n" + messageHeaders;
|
||||
}
|
||||
|
||||
result = new ByteArrayInputStream(messageHeaders.getBytes("UTF-8"));
|
||||
@ -541,7 +543,7 @@ public class EwsExchangeSession extends ExchangeSession {
|
||||
LOGGER.warn("GetItem with MimeContent failed: " + e.getMessage());
|
||||
}
|
||||
if (getItemMethod.getStatusCode() == HttpStatus.SC_NOT_FOUND) {
|
||||
throw new HttpNotFoundException("Item "+itemId+" not found");
|
||||
throw new HttpNotFoundException("Item " + itemId + " not found");
|
||||
}
|
||||
if (mimeContent == null) {
|
||||
LOGGER.warn("MimeContent not available, trying to rebuild from properties");
|
||||
|
Loading…
Reference in New Issue
Block a user