-
-
Notifications
You must be signed in to change notification settings - Fork 818
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
Work around ENVELOPE mailboxes that have too many tokens by merging earlier tokens #1369
Comments
According to LINQPad That said... if I generate the server response using koi8-u, it "parses" correctly (but the mailbox name is corrupted because the IMAP code doesn't know to use koi8-u when converting raw bytes into a string). If I generate it using UTF-8, stepping thru in the debugger reveals that it parses:
When it gets to "facility", it throws the exact same exception you are seeing because it is expecting a What might happening is that the server is calculating the name length based on the unicode string that it uses internally ( If you can verify that the length of that string is 69 (instead off 38), that would confirm my suspicion. A hex editor might be a good way to do that. I wonder what Thunderbird is doing to make this work. Maybe I can keep reading tokens until I get to a |
Those are actual bytes from engine.Stream.input from the process memory
bytes converted to ANSI by visual studio debugger
You are right, the server miscalculated the bytes. I can count 38 bytes in this segment |
I think what they actually did was Hopefully they don't do that in other places where this would be more difficult to work around (e.g. just combining tokens until we find what we are looking for). |
I am not convinced that a workaround for this bug should be implemented in the client library. So far I know Thunderbird was able to deal with that but may be this is just lucky coincidence with their implementation. I just tried Windows Mail and Outlook both don't work. I'll try tomorrow Em client and will let you know. |
Yea, I'd definitely prefer to see it fixed in the server, but since this work-around (which is mostly just "lucky" to work) wasn't too complicated, I didn't mind writing it up. |
Thunderbird and Em Client both was able to synchronize the mail account. Em Client showed this Thunderbird this It seems Em client had problem with this email but still manage to complete the synchronization. Outlook and Windows Mail both failed, but I believe this is not related to this email because they show no emails at all in inbox. As potential fix, it would be enough to be able to go past this email so the synchronization can be completed. It is not necessary parsed value to be 100% correct |
I think I can close this now |
I am getting this exception
when trying to parse imap server response
This is the IMAP log
Note I replaced the actual domain with xxxxxxxxxxx.com if this is somehow relevant to the bytes count
I can synchronize this mailbox successfully with Thunderbird
I am using Mailkit version 3.2.0
The text was updated successfully, but these errors were encountered: