diff --git a/mailnews/imap/src/nsImapIncomingServer.cpp b/mailnews/imap/src/nsImapIncomingServer.cpp
index 046b55f487cfb0a9715c880be2b719dd50d8f28b..54494d8f38e9d6b7293ba2441cc7b1cf604d53d9 100644
--- a/mailnews/imap/src/nsImapIncomingServer.cpp
+++ b/mailnews/imap/src/nsImapIncomingServer.cpp
@@ -833,6 +833,10 @@ nsImapIncomingServer::GetImapConnection(nsIEventQueue *aEventQueue,
   }
   nsImapState requiredState;
   aImapUrl->GetRequiredImapState(&requiredState);
+  // refresh cnt in case we killed one or more dead connections. This
+  // will prevent us from not spinning up a new connection when all
+  // connections were dead.
+  (void) m_connectionCache->Count(&cnt);
   // if we got here and we have a connection, then we should return it!
   if (canRunUrlImmediately && connection)
   {