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

Syntax error in FLAGS. Unexpected token: NIL #1042

Closed
johanncampbell opened this issue Jun 27, 2020 · 3 comments
Closed

Syntax error in FLAGS. Unexpected token: NIL #1042

johanncampbell opened this issue Jun 27, 2020 · 3 comments
Labels
compatibility Compatibility with existing software server-bug The bug appears to be in the server

Comments

@johanncampbell
Copy link

Hi. I suffered an internet outage when trying to set keywords on a mailbox. Upon reconnecting, I am now getting an exception as below:

Exception:

Syntax error in FLAGS. Unexpected token: NIL

Stack Trace:
at MailKit.Net.Imap.ImapUtils.d__42.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at MailKit.Net.Imap.ImapEngine.d__173.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at MailKit.Net.Imap.ImapCommand.d__83.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MailKit.Net.Imap.ImapEngine.d__174.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MailKit.Net.Imap.ImapEngine.d__175.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MailKit.Net.Imap.ImapFolder.d__26.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at WorkStation.Services.WorkStationsLabRequestEmailService.d__77.MoveNext() in ....

Steps To Reproduce:

Not easily reproducible in a test environment as it only occurred after an internet outage while saving keywords to server.

Protol Log:

S: * OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
C: A00000000 AUTHENTICATE PLAIN AHRlc3QucmVxdWVzdHNAbWljcm9sYWJzLmNsb3VkACM1NEhpZGRlblZhbGxleQ==
S: A00000000 OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY PREVIEW=FUZZY XDOVECOT LITERAL+ NOTIFY METADATA QUOTA] Logged in
C: A00000001 NAMESPACE
S: * NAMESPACE (("" "/")) NIL NIL
S: A00000001 OK Namespace completed (0.001 + 0.000 secs).
C: A00000002 LIST "" "INBOX" RETURN (SUBSCRIBED CHILDREN)
S: * LIST (\HasNoChildren) "/" INBOX
S: A00000002 OK List completed (0.012 + 0.000 + 0.011 secs).
C: A00000003 EXAMINE INBOX (CONDSTORE)
S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft FacilitySeen NIL) <-- issue seems to be here
S: * OK [PERMANENTFLAGS ()] Read-only mailbox.
S: * 25 EXISTS
S: * 0 RECENT
S: * OK [UNSEEN 1] First unseen.
S: * OK [UIDVALIDITY 1593265559] UIDs valid
S: * OK [UIDNEXT 27] Predicted next UID
S: * OK [HIGHESTMODSEQ 34] Highest
S: A00000003 OK [READ-ONLY] Examine completed (0.035 + 0.000 + 0.034 secs).

@jstedfast
Copy link
Owner

A NIL flag is invalid syntax. I'm not sure how you created that flag, but it shouldn't be there.

@jstedfast jstedfast added compatibility Compatibility with existing software server-bug The bug appears to be in the server labels Jun 27, 2020
@jstedfast
Copy link
Owner

Added a work-around since it's pretty trivial to do so. Surprised that Dovecot of all IMAP servers has this bug (Dovecot is one of the better IMAP servers out there).

@johanncampbell
Copy link
Author

Much gratitude for this quick fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Compatibility with existing software server-bug The bug appears to be in the server
Projects
None yet
Development

No branches or pull requests

2 participants