#590 new
Menza Dudley

Too many connections error

Reported by Menza Dudley | January 17th, 2014 @ 12:52 AM

I have a gmail (Google Apps) account. Every so often i receive the error shown on the screenshot. Clicking OK does not do anything. Clicking cancel results in the email account being taken offline. Sometimes I can get it back online immediately and sometimes it is a few minutes before I can bring it back online.

Comments and changes to this ticket

  • benny

    benny January 17th, 2014 @ 06:23 PM

    • State changed from “new” to “closed”

    Google (and many other IMAP providers) enforce a maximum number of open connections by a Gmail user. The current maximum is documented to be 15.

    By default, MailMate uses at most 3 connections. You might be using other email clients or MailMate on multiple machines (or anything else talking to Gmail via IMAP for some reason). Any mobile devices configured for your account also counts. (I don't know if Google also counts SMTP connections. They don't mention that on the page linked above).

    Some times connections are not properly closed by email clients (for various reasons) and then it won't be available before it “times out” on the server. This can make it tricky to stay under the limit.

    You can see the connections MailMate make to the server in the Activity Viewer (⌥⌘0).

  • Robert Waltman

    Robert Waltman January 21st, 2014 @ 01:51 PM

    I was about to open a new ticket when I saw this one. I have the same exact problem. And I know exactly what devices I'm online with and I can safely say that I never have more than 3 devices connected at any one time.

    I have 4 email clients installed (Trying to figure out which to go with permanently) and MailMate and the default Mail.app are the only two this happens with. When it does happen if I open Postbox, Airmail or Sparrow they connect without a problem.
    It only happens with one account and it's always the same account. Between work and personal I have 7 email accounts. 4 Google Apps and 3 Gmail accounts. This happens to a Gmail account and no amount of coaxing will take the account back online.

    My only option is to wait a few hours or close MailMate use a different client for a while, then go back to MailMate.

    I'm in my 30 day trial period and so far I love everything about MailMate and will more than likely purchase a license at the end of the trial period. But this issue is troubling. Here's the exact error message:

    Server response: “D3 NO [ALERT] Too many simultaneous connections. (Failure)”. Command attempted: “D3 AUTHENTICATE PLAIN ••••••••••

    Any help or advice will be appreciated.

  • benny

    benny January 21st, 2014 @ 02:47 PM

    @Robert:

    First, it's not only the number of devices but also the number of email clients. If you run 5 email clients and they use 3 connections each then 15 is reached.

    There is nothing MailMate can do with respect to getting a connection if “Too many simultaneous connections” is reported. I don't know how other email clients can obtain a connection if MailMate cannot. Some thoughts:

    1. MailMate uses at most 3 connections and the error is reported even if 2/3 works and the third one fails. This is because there is no safe way for MailMate to determine what the problem is (the only standard part of the error is [ALERT] which tells MailMate to inform the user).

    2. MailMate releases the connections shortly after they are not needed anymore. This might make it more likely that there are no free connections when MailMate needs to reconnect (because they are then taken by other email clients).

    Note that you can use the Terminal command lsof to review the connections used by MailMate and other applications. Do it like this:

    lsof -i":imaps" | grep "1e100.net"
    

    The 1e100.net hostname belongs to Google. A live view can be obtained using the nettop command, but this is a bit harder to use.

    I'll consider if I should try to improve item 1 above. I guess that no matter the reason then I could let MailMate quietly use fewer connections as long as at least 1 connection works. (This is not quite as trivial as it sounds :-) ).

  • Robert Waltman

    Robert Waltman January 21st, 2014 @ 03:02 PM

    Thanks for the quick reply. I think you misunderstood me a bit. I don't use more than 1 email client at any one time. This happens when I'm sitting at my desk and not using my iPhone, iPad or PC.

    Again...this happens when no other clients are open on any device. Granted that my iPhone and iPad get push notifications but neither are open.

    And while it may sound odd I assure you that when this does happen and MailMate refuses to connect I do successfully connect using Airmail or Postbox. I close MailMate first.

    Thanks!!

    Here;s the Terminal output:

    Notes      244  bob   20u  IPv4 0x60bc3ad703cadc31      0t0  TCP roberts-mbp.home:59615->qa-in-f109.1e100.net:imaps (CLOSE_WAIT)  
    Notes      244  bob   22u  IPv4 0x60bc3ad6fe644c31      0t0  TCP roberts-mbp.home:59616->qa-in-f109.1e100.net:imaps (CLOSE_WAIT)  
    Notes      244  bob   27u  IPv4 0x60bc3ad703cadc31      0t0  TCP roberts-mbp.home:59615->qa-in-f109.1e100.net:imaps (CLOSE_WAIT)  
    Notes      244  bob   29u  IPv4 0x60bc3ad6fe644c31      0t0  TCP roberts-mbp.home:59616->qa-in-f109.1e100.net:imaps (CLOSE_WAIT)  
    MailMate 90503  bob   13u  IPv4 0x60bc3ad6fc032c31      0t0  TCP roberts-mbp.home:56366->qa-in-f109.1e100.net:imaps (ESTABLISHED)  
    MailMate 90503  bob   14u  IPv4 0x60bc3ad702abec31      0t0  TCP roberts-mbp.home:63917->qa-in-f108.1e100.net:imaps (ESTABLISHED)  
    MailMate 90503  bob   17u  IPv4 0x60bc3ad6fd0f6c31      0t0  TCP roberts-mbp.home:56367->qa-in-f109.1e100.net:imaps (ESTABLISHED)  
    MailMate 90503  bob   26u  IPv4 0x60bc3ad703325c31      0t0  TCP roberts-mbp.home:63920->qa-in-f108.1e100.net:imaps (ESTABLISHED)  
    MailMate 90503  bob   57u  IPv4 0x60bc3ad70349c419      0t0  TCP roberts-mbp.home:56397->qa-in-f109.1e100.net:imaps (ESTABLISHED)  
    MailMate 90503  bob   92u  IPv4 0x60bc3ad703c63419      0t0  TCP roberts-mbp.home:63928->qa-in-f108.1e100.net:imaps (ESTABLISHED)  
    MailMate 90503  bob  105u  IPv4 0x60bc3ad7033cfc31      0t0  TCP roberts-mbp.home:63931->qa-in-f108.1e100.net:imaps (ESTABLISHED)  
    MailMate 90503  bob  111u  IPv4 0x60bc3ad703ca7419      0t0  TCP roberts-mbp.home:63933->qa-in-f108.1e100.net:imaps (ESTABLISHED)
    
  • benny

    benny January 21st, 2014 @ 03:08 PM

    • State changed from “closed” to “accepted”

    As noted MailMate complains even if it's 1 out of 3 connections that fail. When closing MailMate then 2 of 3 connections are released and that might be enough for the other applications. As noted I'll look into improving how MailMate behaves when it's not the first connection that fails. I've put the ticket back in “accepted” state to track progress on this.

    The output is interesting. There is a Notes application using 4 connections. Do you know what that is about? Maybe it uses the problematic Gmail account?

    There is a lot of MailMate connections, but you had multiple accounts which makes it hard to see if any of them use more than 3 connections. You could perhaps take all other than the problematic account offline?

  • Robert Waltman

    Robert Waltman January 22nd, 2014 @ 12:14 AM

    The notes connection must be the defaults OS X notes app. What I'll do is rerun the Terminal command when I get the error message in MailMate. That should be more telling than when MailMate is working fine.

    I'll update this thread the next time it happens. I've also just removed the Gmail account from syncing any notes as I primary rely on iCloud for that.

  • benny

    benny January 22nd, 2014 @ 12:34 AM

    I'm not sure, but the fact that Notes has the connections in a CLOSE_WAIT state might indicate that the Notes app is “leaking” connections. When you have this problem then try quitting Notes and see if it helps.

    I've just implemented a kind of balancer for the number of connections to a given server. When authentication fails and it's not the primary connection then the password requester is not shown. Instead I decrease the maximum number of connections used and setup a timer to increase it again later on. I've tested it with a Gmail account with an initial maximum of 16 connections (to trigger the limitation) and it seems to work fine. I expect to have a test version for you at the end of the week. Note that this does not solve the problem if not even 1 connection can be made to the server.

    Thanks for the feedback.

  • benny

    benny January 23rd, 2014 @ 10:55 AM

    Hold down ⌥ when clicking “Check Now” in the Software Update preferences pane to fetch the latest test release (r3962). I've introduced an IMAP “balancer” which should automatically try to reduce the number of connections used by MailMate until the last one fails. It doesn't solve the problem if no connections can be made, but it might reduce the number of requesters shown.

  • Robert Waltman

    Robert Waltman January 23rd, 2014 @ 02:33 PM

    I'll give it a go and see what happens. More than likely though I'm going to buy MM once my trial runs out. The search function is brilliant.

  • Robert Waltman

    Robert Waltman January 24th, 2014 @ 03:21 AM

    Here's the terminal output while I'm getting the connection error:

    MailMate 51541  bob   39u  IPv4 0x60bc3ad6fbb7ec31      0t0  TCP roberts-mbp.home:50017->qa-in-f108.1e100.net:imaps (ESTABLISHED)  
    MailMate 51541  bob   43u  IPv4 0x60bc3ad725972419      0t0  TCP roberts-mbp.home:49709->qa-in-f109.1e100.net:imaps (ESTABLISHED)  
    MailMate 51541  bob   44u  IPv4 0x60bc3ad70ab7cc31      0t0  TCP roberts-mbp.home:50018->qa-in-f108.1e100.net:imaps (ESTABLISHED)  
    MailMate 51541  bob   45u  IPv4 0x60bc3ad70d65e419      0t0  TCP roberts-mbp.home:49853->qa-in-f109.1e100.net:imaps (ESTABLISHED)  
    MailMate 51541  bob   48u  IPv4 0x60bc3ad725a03419      0t0  TCP roberts-mbp.home:65282->qa-in-f109.1e100.net:imaps (ESTABLISHED)  
    MailMate 51541  bob   65u  IPv4 0x60bc3ad7049b8419      0t0  TCP roberts-mbp.home:50366->qa-in-f108.1e100.net:imaps (ESTABLISHED)  
    MailMate 51541  bob  132u  IPv4 0x60bc3ad725954c31      0t0  TCP roberts-mbp.home:50367->qa-in-f108.1e100.net:imaps (ESTABLISHED)  
    MailMate 51541  bob  135u  IPv4 0x60bc3ad71f172c31      0t0  TCP roberts-mbp.home:50368->qa-in-f108.1e100.net:imaps (ESTABLISHED)  
    MailMate 51541  bob  138u  IPv4 0x60bc3ad704c97c31      0t0  TCP roberts-mbp.home:49271->qa-in-f108.1e100.net:imaps (ESTABLISHED)  
    MailMate 51541  bob  144u  IPv4 0x60bc3ad7001d9c31      0t0  TCP roberts-mbp.home:50369->qa-in-f108.1e100.net:imaps (ESTABLISHED)  
    MailMate 51541  bob  145u  IPv4 0x60bc3ad707cf2c31      0t0  TCP roberts-mbp.home:50371->qa-in-f108.1e100.net:imaps (ESTABLISHED)  
    MailMate 51541  bob  153u  IPv4 0x60bc3ad708475419      0t0  TCP roberts-mbp.home:49696->qa-in-f109.1e100.net:imaps (ESTABLISHED)  
    MailMate 51541  bob  162u  IPv4 0x60bc3ad71ee24419      0t0  TCP roberts-mbp.home:65295->qa-in-f109.1e100.net:imaps (ESTABLISHED)  
    MailMate 51541  bob  166u  IPv4 0x60bc3ad6ff114c31      0t0  TCP roberts-mbp.home:64631->qa-in-f108.1e100.net:imaps (ESTABLISHED)
    
  • benny

    benny January 24th, 2014 @ 09:55 AM

    How many Gmail accounts do you have online with this output?

    And you are running r3962 now? (See the About window.)

    You can watch whether or not the new IMAP balancer is doing anything. Write this in the Terminal:

    defaults write com.freron.MailMate MmMonitorIMAPBalancer -bool YES
    

    Then launch MailMate like this:

    /Applications/MailMate.app/Contents/MacOS/MailMate
    

    MailMate outputs whenever it increases/decreases the number of connections for an account.

  • Robert Waltman

    Robert Waltman January 24th, 2014 @ 02:07 PM

    Output after first Terminal command:

    roberts-mbp:~ bob$ defaults write com.freron.MailMate MmMonitorIMAPBalancer -bool YES
    

    Output after Terminal launch command:

    2014-01-24 09:04:01.991 MailMate[77513:507] Bartender: Loaded BartenderHelperSixtySeven
    

    And yes I'm running the build you sent me instructons for Version 1.7.2 (3962)

  • Robert Waltman

    Robert Waltman January 24th, 2014 @ 02:09 PM

    Sorry I forgot this output too. I launched a new terminal window and got this:

    roberts-mbp:~ bob$ lsof -i":imaps" | grep "1e100.net"
    MailMate 77513  bob   25u  IPv4 0x60bc3ad703512c31      0t0  TCP roberts-mbp.home:58539->qa-in-f109.1e100.net:imaps (ESTABLISHED)
    MailMate 77513  bob   26u  IPv4 0x60bc3ad72660b419      0t0  TCP roberts-mbp.home:58540->qa-in-f109.1e100.net:imaps (ESTABLISHED)
    MailMate 77513  bob   27u  IPv4 0x60bc3ad72655e419      0t0  TCP roberts-mbp.home:58541->qa-in-f109.1e100.net:imaps (ESTABLISHED)
    MailMate 77513  bob   62u  IPv4 0x60bc3ad701da2419      0t0  TCP roberts-mbp.home:58567->qa-in-f109.1e100.net:imaps (ESTABLISHED)
    MailMate 77513  bob   77u  IPv4 0x60bc3ad6fcfe8419      0t0  TCP roberts-mbp.home:58572->qa-in-f109.1e100.net:imaps (ESTABLISHED)
    MailMate 77513  bob   86u  IPv4 0x60bc3ad70cdf6c31      0t0  TCP roberts-mbp.home:58575->qa-in-f109.1e100.net:imaps (ESTABLISHED)
    MailMate 77513  bob   98u  IPv4 0x60bc3ad70ad9ec31      0t0  TCP roberts-mbp.home:58579->qa-in-f109.1e100.net:imaps (ESTABLISHED)
    MailMate 77513  bob  107u  IPv4 0x60bc3ad70b073419      0t0  TCP roberts-mbp.home:58582->qa-in-f109.1e100.net:imaps (ESTABLISHED)
    
  • benny

    benny January 24th, 2014 @ 02:12 PM

    How many Gmail accounts are online?

    Also relaunch MailMate if you didn't do so.

  • Jon Phipps

    Jon Phipps April 5th, 2014 @ 03:01 PM

    • Tag set to authentication, gmail, imap

    I note that this is still open and I'd like to add something...

    I recently tested several email apps, along with the official Gmail app, on my iPad and iPhone, both running iOS7.1. Three of these apps use the 'background update' feature of ios7 that leaves them running, and connecting, in the background. Shortly after this I started getting the “[ALERT] Too many simultaneous connections. (Failure)” error. It took me a bit of thinking to figure out what was likely happening because the apps had been installed over several days, and they weren't apparently running on my devices.

    Since MailMate was the only app that displayed an error and failed to reconnect, I naturally assumed that it was a MailMate problem. I now assume that the other apps failed silently and used some other strategy for recovering -- none of them failed to continue to download messages in the background.

    Given that they likely failed and also recovered silently, perhaps there's another strategy MailMate could use to try to recover from this rather than requesting a re-login?

    note: one Gmail account, IMAP access, 2-factor auth enabled

  • benny

    benny April 7th, 2014 @ 11:41 AM

    @Jon: Thanks for the feedback. You might be right that this is just a question about MailMate being better at ignoring these errors for a while, but I'm not quite convinced about that yet. As an experiment, it could be interesting to detect this specific Gmail error and then retry repeatedly after a fixed number of seconds until it can reconnect. Just to see if it's a very short-lived problem.

    Do you still have this problem or was it only while experimenting with iOS apps?

  • Patrick

    Patrick April 22nd, 2014 @ 12:10 AM

    I am having this same problem as well now. This wasn't happening before I recently upgraded the client. Benny, let me know if you need anything from me.

  • benny

    benny April 22nd, 2014 @ 12:55 PM

    @Patrick: You can keep the Activity Viewer open and then use “Help ▸ Send Server Logs” when it happens. I have another report about this, but it is still unresolved (so far I cannot see that MailMate does anything wrong).

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Mac OS X email client.

Shared Ticket Bins

People watching this ticket

Pages