1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-22 07:42:52 +00:00

Check for out of range sequence numbers

This commit is contained in:
M66B 2024-12-03 08:05:02 +01:00
parent 7bb58be0c2
commit 42954d1bde

View file

@ -4072,18 +4072,21 @@ public class IMAPFolder extends Folder implements UIDFolder, ResponseHandler {
eu.faircode.email.Log.w("Sequence=" + seqnum);
return null;
}
if (seqnum > messageCache.size()) {
if (seqnum > realTotal) {
// Microsoft Exchange will sometimes return message
// numbers that it has not yet notified the client
// about via EXISTS; ignore those messages here.
// GoDaddy IMAP does this too.
// Mailfence
// Yahoo when > 10,000 messages
if (logger.isLoggable(Level.FINE))
logger.fine("ignoring message number " +
seqnum + " outside range " + messageCache.size());
int count = seqnum - messageCache.size();
eu.faircode.email.Log.w("Adding sequence=" + seqnum + " count=" + count);
messageCache.addMessages(count, seqnum - count + 1);
int count = seqnum - realTotal;
eu.faircode.email.Log.w("Adding sequence=" + seqnum + " count=" + count + " total=" + realTotal);
messageCache.addMessages(count, realTotal + 1);
realTotal += count;
total += count;
//return null;
}
return messageCache.getMessageBySeqnum(seqnum);