MailCore / mailcore2

MailCore 2 provide a simple and asynchronous API to work with e-mail protocols IMAP, POP and SMTP. The API has been redesigned from ground up.
Other
2.6k stars 624 forks source link

MCOIMAPFolderInfo and MCOIMAPFolderStatus are giving different messagecounts. #1628

Closed rasithaak closed 5 years ago

rasithaak commented 7 years ago

I have a function which is fetching the mails from IMAP using fetchMessagesByNumberOperationWithFolder ( MCOIMAPFetchMessagesOperation). I am using MCOIMAPFolderInfo to get the folder message count. But it seems to be wrong while checking the emails count in my Gmail folder (when Conversation mode is off). I tried MCOIMAPFolderStatus to get the message count and it was proper. There is a difference of 153 emails between MCOIMAPFolderInfo and MCOIMAPFolderStatus results, 153 emails less in MCOIMAPFolderInfo result. If I am fetching less than or equal to 153 number of latest emails from the same folder, I am getting zero results and if the count is more than 153, it will fetch the correct number of emails. And this is happening for the accounts were the total number of emails are quite large(for me 12000 emails are there). Why is this happening?

wwwang89 commented 7 years ago

oh ,what's the difference between class MCOIMAPFolderInfo and MCOIMAPFolderStatus ? and I find they are really the same when I see the mailcore2 API,I'm a little confused,who could help me ?thanks~

dinhvh commented 7 years ago

MCOIMAPFolderInfo / IMAP SELECT is the more reliable way to get information about a folder. MCOIMAPFolderStatus / AIMP STATUS is unreliable with lots of servers.

That's a behavior of the server.