Added another Outlook sent messages fallback

This commit is contained in:
M66B 2023-08-27 08:40:24 +02:00
parent 87876cc727
commit 92a34626b8
2 changed files with 13 additions and 1 deletions

View File

@ -2289,7 +2289,8 @@ class Core {
" host=" + account.host +
" outlook=" + account.isOutlook() +
" messages=" + (imessages == null ? null : imessages.length));
imessages = ifolder.search(new HeaderTerm("X-Microsoft-Original-Message-ID", message.msgid));
imessages = ifolder.search(
new HeaderTerm(MessageHelper.HEADER_MICROSOFT_ORIGINAL_MESSAGE_ID, message.msgid));
}
// Searching for random header:
@ -4411,6 +4412,16 @@ class Core {
String msgid = helper.getMessageID();
Log.i(folder.name + " searching for " + msgid);
List<EntityMessage> dups = db.message().getMessagesByMsgId(folder.account, msgid);
if (dups.size() == 0 &&
account.isOutlook() &&
EntityFolder.SENT.equals(folder.type)) {
String originalId = imessage.getHeader(MessageHelper.HEADER_MICROSOFT_ORIGINAL_MESSAGE_ID, null);
if (originalId != null) {
dups = db.message().getMessagesByMsgId(folder.account, originalId);
EntityLog.log(context, folder.name + " found with original ID" +
" msgid=" + msgid + " count=" + dups.size());
}
}
for (EntityMessage dup : dups) {
EntityFolder dfolder = db.folder().getFolder(dup.folder);
Log.i(folder.name + " found as id=" + dup.id + "/" + dup.uid +

View File

@ -177,6 +177,7 @@ public class MessageHelper {
static final int SMALL_MESSAGE_SIZE = 192 * 1024; // bytes
static final int DEFAULT_DOWNLOAD_SIZE = 4 * 1024 * 1024; // bytes
static final String HEADER_CORRELATION_ID = "X-Correlation-ID";
static final String HEADER_MICROSOFT_ORIGINAL_MESSAGE_ID = "X-Microsoft-Original-Message-ID";
static final int MAX_SUBJECT_AGE = 48; // hours
static final int DEFAULT_THREAD_RANGE = 7; // 2^7 = 128 days
static final int MAX_UNZIP_COUNT = 20;