This is ridiculous. A large number of different threads have discussed this problem, going back many years and many versions of Mail; Apple has not addressed it.
(See e.g.
https://discussions.apple.com/thread/3780892?start=0&tstart=0
https://discussions.apple.com/thread/3037429?start=0&tstart=0
https://discussions.apple.com/thread/2259234?start=0&tstart=0
https://discussions.apple.com/thread/2080985?start=0&tstart=0
https://discussions.apple.com/thread/1953841?start=0&tstart=0
https://discussions.apple.com/thread/448925?start=0&tstart=0
These threads are respectively from 2013, 2011, 2009 (x3), and 2006! And this is not even a complete list. How many more of these threads do you need, Apple?
Meanwhile, the problem (which has affected many mail servers) now affects gmail. If Apple doesn't solve this, I will have to stop using Mail to access my gmail account -- as will many other Mac Mail users who use gmail.
Apple -- please move this "too many simultaneous connections" error to the top of your priority list. It's time to get this one fixed, at long last. All we need is a setting limiting the number of simultaneous connections per a given IMAP account.
Please address this, Apple.