-
Notifications
You must be signed in to change notification settings - Fork 88
Open
Description
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")