Skip to content
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

CountChanged not triggered in this scenario #521

Closed
ekalchev opened this issue Jun 12, 2017 · 5 comments
Closed

CountChanged not triggered in this scenario #521

ekalchev opened this issue Jun 12, 2017 · 5 comments
Labels
bug Something isn't working

Comments

@ekalchev
Copy link
Contributor

ekalchev commented Jun 12, 2017

Hi Jeffrey,

My app client uses mailkit and it is running Imap idle with QResync enabled. I am moving an email using other email client out of Inbox and then moving back the same email again in Inbox. My App with Mailkit detects "move out of inbox" correctly but not "move in into inbox".

This is the log

C: A00000023 SELECT INBOX (CONDSTORE)
S: * OK [CLOSED] Previous mailbox closed.
S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
S: * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft *)] Flags permitted.
S: * 355 EXISTS
S: * 0 RECENT
S: * OK [UIDVALIDITY 1491227400] UIDs valid
S: * OK [UIDNEXT 925] Predicted next UID
S: * OK [HIGHESTMODSEQ 1824] Highest
S: A00000023 OK [READ-WRITE] Select completed (0.001 + 0.000 secs).
C: A00000024 IDLE
S: + idling
S: * VANISHED 924
S: * OK [HIGHESTMODSEQ 1826] Highest
S: * 355 EXISTS
S: * OK [HIGHESTMODSEQ 1827] Highest

I think this happens because there is no "* 354 EXISTS" after vanished event. Not sure if this is server issue or Mailkit should decrease IMailFolder.Count with 1 when it sees VANISHED response.

Thanks.

@jstedfast
Copy link
Owner

Yea, it's because there's no * 354 EXISTS. I'll have to re-read the specs to see how this should be handled.

@ekalchev
Copy link
Contributor Author

ekalchev commented Jun 12, 2017

https://tools.ietf.org/html/rfc5162#page-12
A VANISHED response sent because of an EXPUNGE or UID EXPUNGE command
or because messages were expunged in other connections (i.e., the
VANISHED response without the EARLIER tag) also decrements the number
of messages in the mailbox; it is not necessary for the server to
send an EXISTS response with the new value.

@jstedfast jstedfast added the bug Something isn't working label Jun 12, 2017
@jstedfast
Copy link
Owner

Yep, I saw that too. Thanks.

@jstedfast
Copy link
Owner

FWIW you should now get 2 CountChanged events - one as a result of the VANISHED and one as a result of the EXISTS.

@jstedfast
Copy link
Owner

I'll try to make a new release this week or no later than this weekend. Depends on how much free time I have to get my new PC setup for making releases (my old PC just died 2 weeks ago).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants