-
-
Notifications
You must be signed in to change notification settings - Fork 828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NOOP after CLOSE: Message counter not updated #1509
Comments
It's a bug, but it's a bug in the server for not sending an untagged |
Where would you expect the untagged https://www.rfc-editor.org/rfc/rfc3501#section-7.4.1
|
Ah, right, I had the code correct at one point but changed it to mimic (exactly) the events that the server emitted. So the question now is, should ImapFolder emit the CountChanged event as a result of an EXPUNGE notification? And if so, after each EXPUNGE notification? Or only at the end, the way IMAP would normally do it? The tricky part is not doing it on our own and then doing it again if the IMAP server responds with an EXISTS, because then we'd be duplicating events. |
…ions ...and queue up a CountChanged event to emit only if the server does not explicitly send us an untagged EXISTS response. In other words, treat the following 2 cases as identical: C: A00000009 NOOP S: * 1 EXPUNGE S: A00000009 NOOP OK success and C: A00000009 NOOP S: * 1 EXPUNGE S: * 0 EXISTS S: A00000009 NOOP OK success In both cases, there should be 2 events: 1. MessageExpunged event should be emitted for index 0 and folder.Count should be 0 if checked within the MessageExpunged event handler. 2. CountChanged event should be emitted Fixes issue #1509
Turns out it wasn't that tricky... Please try the above fix when it finishes building (it will upload a new nuget package to https://www.myget.org/feed/mimekit/package/nuget/MailKit). I suspect the build number will be 586. |
Actually, my fix wasn't quite right but build 587 should work. |
Build 586 and 587 both work correctly - thanks a lot. |
Hi Jeffrey
Thanks for providing your great library. I'm not sure if what I write below is a bug. As it may help, I report it anyway.
Best regards,
Thomas
Description of potential bug
Now I would expect the message counter of client 2 (folder.Count) to be
0
:0
(with MailKit 2.15.0, 3.0.0-preview1)1
(with MailKit 3.0.0, 3.5.0)Log file of client 2
Code to reproduce
The text was updated successfully, but these errors were encountered: