IMAP: NO [ALERT] Too many simultaneous connections. (Failure)
The server limits concurrent IMAP sessions per account and your clients (phone, laptop, scripts) opened more than allowed.
Too many simultaneous connectionsNO [ALERT] Too many simultaneous connections. (Failure)IMAP too many connections[ALERT] Too many simultaneous connectionsmaximum number of connections from user+IP exceeded Meaning
Gmail allows about 15 simultaneous IMAP connections; hosts often allow far fewer. Scripts that connect without logging out, or clients that reconnect rapidly, leak sessions until the limit is hit. Close connections properly, reuse one session, and reduce the number of devices polling the mailbox.
Common causes
- Script not calling
logout()so sessions stay open until timeout - Many devices/clients on one mailbox
- Reconnect loop after errors
- IMAP IDLE sessions never closed
- Low per-IP limit on shared hosting
⚡ Quick fix
- Always
logout()in afinallyblock - Reuse one connection for several operations
- Wait a few minutes for old sessions to time out and reduce clients
Detailed fix by platform
Python
try: ... finally: m.close(); m.logout()withimaplib.IMAP4_SSL
How to diagnose
- Clients — How many devices/scripts?
- Cleanup — logout called?
- Limit — Provider's cap?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- 421 4.7.0 Try again later (rate limited) SMTP: 421 4.7.0 Our system has detected an unusual rate of unsolicited mail originating from your IP address. Mail sent from your IP address has been temporarily rate limited
- 452 4.5.3 Too many recipients SMTP: 452 4.5.3 Your message has too many recipients / 452 Too many recipients received this hour
- 550 5.4.5 Daily user sending quota exceeded SMTP: 550 5.4.5 Daily user sending quota exceeded (Gmail)
Most viewed in Email / SMTP
Other ways to find it
Where this error sits
Origin: Network. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 4 Nov 2026