mirror of
https://github.com/moparisthebest/davmail
synced 2025-01-07 03:38:05 -05:00
IMAP: Fix 3534801, workaround for missing From header
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1969 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
b00d441b68
commit
3c2a5ec9cb
@ -1085,6 +1085,11 @@ public class DavExchangeSession extends ExchangeSession {
|
||||
try {
|
||||
String messageHeaders = getItemProperty(permanentUrl, "messageheaders");
|
||||
if (messageHeaders != null) {
|
||||
// workaround for messages in Sent folder
|
||||
if (messageHeaders.indexOf("From:") < 0) {
|
||||
String from = getItemProperty(permanentUrl, "from");
|
||||
messageHeaders = "From: "+from+"\n"+messageHeaders;
|
||||
}
|
||||
result = new ByteArrayInputStream(messageHeaders.getBytes("UTF-8"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
@ -372,11 +372,18 @@ public class EwsExchangeSession extends ExchangeSession {
|
||||
try {
|
||||
GetItemMethod getItemMethod = new GetItemMethod(BaseShape.ID_ONLY, itemId, false);
|
||||
getItemMethod.addAdditionalProperty(Field.get("messageheaders"));
|
||||
getItemMethod.addAdditionalProperty(Field.get("from"));
|
||||
executeMethod(getItemMethod);
|
||||
EWSMethod.Item item = getItemMethod.getResponseItem();
|
||||
|
||||
String messageHeaders = item.get(Field.get("messageheaders").getResponseName());
|
||||
if (messageHeaders != null) {
|
||||
// workaround for messages in Sent folder
|
||||
if (messageHeaders.indexOf("From:") < 0) {
|
||||
String from = item.get(Field.get("from").getResponseName());
|
||||
messageHeaders = "From: "+from+"\n"+messageHeaders;
|
||||
}
|
||||
|
||||
result = new ByteArrayInputStream(messageHeaders.getBytes("UTF-8"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
Loading…
Reference in New Issue
Block a user