Reputation: 203
I have been using the IDLE mode with IMAPclient for several years now and it has always worked.
About 2 days ago, there's been a weird change where it no longer detects incoming emails.
I tried updating my IMAPclient but I'm already on the latest version (3.0.1). I have not changed any settings on my GMail account.
I have not changed my code at all - so I'm pretty stumped. I'm assuming it's a GMail server issue, but I can't find any recent press releases documenting any changes. I also can still login just fine and read existing emails, I just can't see new ones come in via IDLE.
Does anyone know the cause and solution?
from imapclient import IMAPClient
import ssl
import certifi
HOST = "imap.gmail.com"
USERNAME = file_lines[0]
PASSWORD = file_lines[1]
ssl_context = ssl.create_default_context(cafile=certifi.where())
with IMAPClient(HOST, ssl_context=ssl_context) as server:
server.login(USERNAME, PASSWORD)
print("Logged in!")
try:
server.idle()
print("Connection is now in IDLE mode, send yourself an email or quit with ^c")
responses = server.idle_check(timeout=30)
print(responses)
if responses:
print("Server sent:" + str(responses))
else:
print("Nothing was found in the last 10 mins. Will retry")
finally:
print(server.idle_done())
server.logout()
Upvotes: 0
Views: 77