WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

imapclient.exceptions.ProtocolError: Server replied with a response that violates the IMAP protocol #464

@dkozinn

Description

@dkozinn

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.

#!/usr/bin/env python
  
from imapclient import IMAPClient
import logging

HOST = 'mail.example.com'
USER = 'david'
PASSWORD = 'Password1'

logging.basicConfig(
    format='%(asctime)s - %(levelname)s: %(message)s',
    level=logging.DEBUG
)

try:
    server = IMAPClient(HOST)
    server.login(USER, PASSWORD)
    server.select_folder("INBOX")

    # Start IDLE mode
    server.idle()
    while True:
        responses = server.idle_check(timeout=30)

        if responses:
            server.idle_done()
            messages = server.search(["UNSEEN"])
            server.idle()
except KeyboardInterrupt:
    server.idle_done()
    server.logout
except Exception as error:
    logging.exception("Unexpected error")

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions