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:
parent
7bb58be0c2
commit
42954d1bde
1 changed files with 7 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue