-
-
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
Syntax error in FLAGS. Unexpected token: '[' #390
Comments
The problem is that Here is the definition of the flag syntax:
So technically, MailKit should allow the "[" character, but the "]" is still illegal to use in flag names. What client created those flag names? Or did you create them yourself? |
I've got the user in question investigating. We think it's Thunderbird and favouriting searches, but hopefully he'll work it out so I can give a bit more information. |
He's not found out yet, but it can only be Thunderbird that has put them there as he only uses that. I've asked him to carry on trying an thinking about it because it must be something he's done relatively recently in Thunderbird that put them there. |
…tokens Fixes the MailKit part of the bug in issue #390
I've been trying to figure out how a client could have created those custom flags because I cannot get Dovecot to accept them:
|
I can get it to accept "[", but not "]":
|
We've got it. |
Thanks, that seems to create the custom tag on dovecot for me, but only if the tag name I type in doesn't contain "]". Perhaps your installed version of dovecot is accepting "]"? Anyway... I've fixed MailKit to allow "[" like the specification calls for, but it won't accept "]". The version of dovecot that I have installed is 2.2.24 (2.2.25 seems to be the latest). |
OK, I've discovered that our version of dovecot is on Linux RHEL 5.4, and.... wait for it.... it's version 1.0.7.9. |
I would recommend not using ]'s at least. This documentation looks promising for how to delete custom created flag names: http://wiki2.dovecot.org/Tools/Doveadm/Flags, but it requires admin rights on the server. Without that, I'm not sure how to remove flag names with "]"'s. You could customize MailKit to allow "]" by modifying https://github.com/jstedfast/MailKit/blob/master/MailKit/Net/Imap/ImapUtils.cs#L1137 By setting |
I've released MailKit 1.6.0 with this fix |
Thanks! |
Getting this error logging onto one account on a server. Other accounts seem fine. Mailkit 1.4.2.1.
Account.Client = new ImapClient(new ProtocolLogger(Console.OpenStandardOutput()));
try
{
Account.Client.Connect(new Uri(account.address));
}
S: * OK Dovecot ready.
C: A00000000 CAPABILITY
S: * CAPABILITY IMAP4rev1 SASL-IR SORT THREAD=REFERENCES MULTIAPPEND UNSELECT LITERAL+ IDLE CHILDREN NAMESPACE LOGIN-REFERRALS STARTTLS AUTH=PLAIN
S: A00000000 OK Capability completed.
C: A00000001 STARTTLS
S: A00000001 OK Begin TLS negotiation now.
C: A00000002 CAPABILITY
S: * CAPABILITY IMAP4rev1 SASL-IR SORT THREAD=REFERENCES MULTIAPPEND UNSELECT LITERAL+ IDLE CHILDREN NAMESPACE LOGIN-REFERRALS AUTH=PLAIN
S: A00000002 OK Capability completed.
C: A00000003 AUTHENTICATE PLAIN ********************
S: A00000003 OK Logged in.
C: A00000004 CAPABILITY
S: * CAPABILITY IMAP4rev1 SASL-IR SORT THREAD=REFERENCES MULTIAPPEND UNSELECT LITERAL+ IDLE CHILDREN NAMESPACE LOGIN-REFERRALS
S: A00000004 OK Capability completed.
C: A00000005 NAMESPACE
S: * NAMESPACE (("" "/")) NIL NIL
S: A00000005 OK Namespace completed.
C: A00000006 LIST "" "INBOX"
S: * LIST (\NoInferiors \UnMarked) "/" "INBOX"
S: A00000006 OK List completed.
The thread 0x43e8 has exited with code 0 (0x0).
The thread 0x42a0 has exited with code 0 (0x0).
The thread 0x2230 has exited with code 0 (0x0).
Exception thrown: 'MailKit.Net.Imap.ImapProtocolException' in MailKit.dll
C: A00000007 EXAMINE INBOX
S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft NonJunk $Forwarded $MDNSent Junk $label4 $label1 $has_cal $label2 $label3 $label5 [all_2071] [asl_107] [dhl_150] [pds_2666])
S: * OK [PERMANENTFLAGS ()] Read-only mailbox.
S: * 971 EXISTS
S: * 0 RECENT
S: * OK [UIDVALIDITY 1266935373] UIDs valid
S: * OK [UIDNEXT 126629] Predicted next UID
S: A00000007 OK [READ-ONLY] Select completed.
The thread 0x5df4 has exited with code 0 (0x0).
The thread 0x52dc has exited with code 0 (0x0).
The thread 0x5b70 has exited with code 0 (0x0).
Exception Message:
Syntax error in FLAGS. Unexpected token: '['
Exception Stacktrace:
at MailKit.Net.Imap.ImapUtils.ParseFlagsList(ImapEngine engine, String name, HashSet`1 userFlags, CancellationToken cancellationToken)
at MailKit.Net.Imap.ImapEngine.ProcessUntaggedResponse(CancellationToken cancellationToken)
at MailKit.Net.Imap.ImapCommand.Step()
at MailKit.Net.Imap.ImapEngine.Iterate()
at MailKit.Net.Imap.ImapEngine.Wait(ImapCommand ic)
at MailKit.Net.Imap.ImapFolder.Open(FolderAccess access, CancellationToken cancellationToken)
at FCL.ForwardOffice.Hub.ModuleCore.EmailListViewModel.FillFolders(UserDataEmailAccountsXpo account) in E:\Documents\Visual Studio 2015\Projects\74B\ForwardOfficeHub\ForwardOfficeHub\Hub\ModuleCore\EmailListViewModel.cs:line 402
The text was updated successfully, but these errors were encountered: