-
Notifications
You must be signed in to change notification settings - Fork 86
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
imapclient.exceptions.ProtocolError: Server replied with a response that violates the IMAP protocol #464
Comments
I've found something else that may be related: I connected with tls=FALSE and ran a network capture to see what was actually on the wire. I'm seeing these errors now:
In the network capture, there are two packets which are re-assembled to form the message seen in the error. The only thing in the second packet is |
Interesting. Thanks for the excellent sleuthing so far. It looks like the way idle_check is consuming the socket needs to be improved. There may be an assumption that complete lines will be seen in one socket read but that's not always true. |
So there's 2 issues going on here. The first is the ProtocolError. Looking at the pastebin, this part seems to be the key:
The client starts idling and the server responds with I'm not sure what IMAPClient could better here. It seems the server sent an invalid response. IMAPClient could ignore the response but that could result in getting out of sync with the server. |
I've created #519 to track the "unterminated line" issue. |
This seems like a duplicate of the now-closed #351. I've been able to reproduce this connected to a Dovecot server using a minimal example based on my actual code. In this case, I marked an item read then unread in an Outlook session, but I've seen this happen under other circumstances (which are hard to reproduce reliably). I've uploaded a log file at https://pastebin.com/CqEZhaKx.
If it will help, I can create an account for you to test with on this server, contact me privately and I'll set it up for you.
The text was updated successfully, but these errors were encountered: