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

Unexpected token in IMAP response: '(' #166

Closed
jacargentina opened this issue Mar 30, 2015 · 3 comments
Closed

Unexpected token in IMAP response: '(' #166

jacargentina opened this issue Mar 30, 2015 · 3 comments
Labels
bug Something isn't working

Comments

@jacargentina
Copy link

Doing this on a given folder with latest 1.0.13.0

var changes = folder.Search(MailKit.Search.SearchQuery.ChangedSince(this.HighestModSeq));

Logs this:

S: M00000006 OK Completed
C: M00000007 UID SEARCH RETURN () MODSEQ 46538
S: * SEARCH 56753 (MODSEQ 46539)
S: M00000007 OK Completed (1 msgs in 0.004 secs)

And i get an exception like this:

MailKit.Net.Imap.ImapProtocolException: Unexpected token in IMAP response: '('
en MailKit.Net.Imap.ImapFolder.SearchMatches(ImapEngine engine, ImapCommand ic, Int32 index)
en MailKit.Net.Imap.ImapEngine.ProcessUntaggedResponse(CancellationToken cancellationToken)
en MailKit.Net.Imap.ImapCommand.Step()
en MailKit.Net.Imap.ImapEngine.Iterate()
en MailKit.Net.Imap.ImapEngine.Wait(ImapCommand ic)
en MailKit.Net.Imap.ImapFolder.Search(SearchQuery query, CancellationToken cancellationToken)

I think the parser is not expecting the (MODSEQ 46539) part.

Using cyrus-imapd-2.4.17-8.fc21.x86_64

@jacargentina
Copy link
Author

Maybe mailkit is not implementing the protocol as it should?

https://tools.ietf.org/html/rfc4551#section-3.5

If a client specifies a MODSEQ criterion in a SEARCH (or UID SEARCH)
command and the server returns a non-empty SEARCH result, the server
MUST also append (to the end of the untagged SEARCH response) the
highest mod-sequence for all messages being returned. See Section
3.4 for examples.

@jstedfast
Copy link
Owner

Thanks, I've just committed a fix for this.

@jstedfast jstedfast added the bug Something isn't working label Mar 30, 2015
@jstedfast
Copy link
Owner

@jacargentina would you be willing to get me the initial few lines of a log when connecting to Cyrus IMAP? I mostly care about the greeting, but if you could include the CAPABILITIES as well, that would be awesome. Thanks!

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