IMAP: Too many simultaneous connections Email / SMTP Origin: Network OSI layer 7 · Application Last updated 4 Nov 2026

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.

Exact message you may see 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
Seen on: SMTP Python

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

  1. Always logout() in a finally block
  2. Reuse one connection for several operations
  3. Wait a few minutes for old sessions to time out and reduce clients

Detailed fix by platform

Python

  1. try: ... finally: m.close(); m.logout() with imaplib.IMAP4_SSL

How to diagnose

  1. Clients — How many devices/scripts?
  2. Cleanup — logout called?
  3. 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:

Where this error sits

Origin: Network. Errors that are often confused with or caused by this one (click to open):

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 (Email / SMTP)421 4.7.0 Try again l…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 (Email / SMTP)452 4.5.3 Too many re…550 5.4.5 Daily user sending quota exceeded — SMTP: 550 5.4.5 Daily user sending quota exceeded (Gmail) (Email / SMTP)550 5.4.5 Daily user …EMFILE — Too many open files (EMFILE) (Linux)EMFILEfork: retry: Resource temporarily unavailable — fork: retry: Resource temporarily unavailable (process/thread limit) (Linux)fork: retry: Resource…IMAP: [AUTHENTICATIONFAILED] Invalid credentials — IMAP: NO [AUTHENTICATIONFAILED] Invalid credentials (Failure) (Email / SMTP)IMAP: [AUTHENTICATION…Postfix: SASL authentication failed — Postfix: warning: SASL authentication failure: cannot connect to saslauthd server: No such file or directory (Email / SMTP)Postfix: SASL authent…IMAP: Too…

Explore the map of this error Full error map →

🧠 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.