Index: pan/gui/gui.cc
===================================================================
RCS file: /cvs/gnome/pan2/pan/gui/gui.cc,v
retrieving revision 1.4
diff -u -r1.4 gui.cc
--- pan/gui/gui.cc	13 Oct 2006 15:42:05 -0000	1.4
+++ pan/gui/gui.cc	30 Oct 2006 15:44:28 -0000
@@ -597,7 +597,7 @@
   if (e.severity & Log::PAN_SEVERITY_ERROR)
     set_bin_child (_event_log_button, _error_image);
 
-  if (e.severity & Log::PAN_SEVERITY_URGENT) {
+  if (_queue.is_online() && (e.severity & Log::PAN_SEVERITY_URGENT)) {
     std::string msg (e.message);
     if (msg.find ("ENOSPC") != e.message.npos) {
       msg.erase (msg.find ("ENOSPC"), 6);
@@ -1560,12 +1560,15 @@
 void
 GUI :: on_queue_error (Queue& q, const StringView& message)
 {
-  toggle_action ("work-online", false);
+  if (_queue.is_online())
+  {
+    toggle_action ("work-online", false);
 
-  std::string s (message);
-  s += "\n \n";
-  s += _("Pan is now offline. Please see \"File|Event Log\" and correct the problem, then use \"File|Work Online\" to continue.");
-  Log::add_urgent_va ("%s", s.c_str());
+    std::string s (message);
+    s += "\n \n";
+    s += _("Pan is now offline. Please see \"File|Event Log\" and correct the problem, then use \"File|Work Online\" to continue.");
+    Log::add_urgent_va ("%s", s.c_str());
+  }
 }
 
 
Index: pan/gui/post-ui.cc
===================================================================
RCS file: /cvs/gnome/pan2/pan/gui/post-ui.cc,v
retrieving revision 1.3
diff -u -r1.3 post-ui.cc
--- pan/gui/post-ui.cc	16 Oct 2006 07:06:59 -0000	1.3
+++ pan/gui/post-ui.cc	30 Oct 2006 15:44:31 -0000
@@ -686,7 +686,7 @@
                            _("There were problems with this post."),
                            msg);
   gtk_dialog_add_button (GTK_DIALOG(d), _("Go Back"), GTK_RESPONSE_CANCEL);
-  const int response = gtk_dialog_run (GTK_DIALOG(d));
+  gtk_dialog_run (GTK_DIALOG(d));
   gtk_widget_destroy (d);
   g_free (tmp);
   g_free (msg);
Index: pan/tasks/nntp-pool.cc
===================================================================
RCS file: /cvs/gnome/pan2/pan/tasks/nntp-pool.cc,v
retrieving revision 1.2
diff -u -r1.2 nntp-pool.cc
--- pan/tasks/nntp-pool.cc	10 Oct 2006 22:19:42 -0000	1.2
+++ pan/tasks/nntp-pool.cc	30 Oct 2006 15:44:34 -0000
@@ -22,6 +22,7 @@
 #include <glib/gi18n.h>
 #include <pan/general/debug.h>
 #include <pan/general/foreach.h>
+#include <pan/general/log.h>
 #include "nntp-pool.h"
 
 using namespace pan;
@@ -34,7 +35,8 @@
   _socket_creator (creator),
   _connection_pending (false),
   _max_connections (_server_info.get_server_limits (_server)),
-  _active_count (0)
+  _active_count (0),
+  _lockout_expire_time (0)
 {
   _server_info.add_listener (this);
 }
@@ -146,16 +148,32 @@
 
    if (health == FAIL) // news server isn't accepting our connection!
    {
-     const std::string addr (_server_info.get_server_address (_server));
-     std::string s;
-     char buf[4096];
-     snprintf (buf, sizeof(buf), _("Unable to connect to \"%s\""), addr.c_str());
-     s = buf;
-     if (!response.empty()) {
-       s += ":\n";
-       s.append (response.str, response.len);
+     std::string s (response.str, response.len);
+     foreach (std::string, s, it) *it = tolower (*it);
+
+     // too many connections...
+     if (   (s.find ("too many") != s.npos)
+         || (s.find ("limit reached") != s.npos)
+         || (s.find ("maximum number of connections") != s.npos))
+     {
+       const std::string addr (_server_info.get_server_address (_server));
+       Log::add_info_va ("No new connections to \"%s\" for %d minutes due to \"%s\"",
+         addr.c_str(), 2, s.c_str());
+       _lockout_expire_time = time(0) + 120;
+     }
+     else
+     {
+       const std::string addr (_server_info.get_server_address (_server));
+       std::string s;
+       char buf[4096];
+       snprintf (buf, sizeof(buf), _("Unable to connect to \"%s\""), addr.c_str());
+       s = buf;
+       if (!response.empty()) {
+         s += ":\n";
+         s.append (response.str, response.len);
+       }
+       fire_pool_error (s.c_str());
      }
-     fire_pool_error (s.c_str());
    }
 
    if (health != OK)
@@ -209,7 +227,7 @@
             << "max: " << max << ' ' << std::endl;
 #endif
 
-  if (!idle && !pending && active<max)
+  if (!idle && !pending && active<max  && _lockout_expire_time<time(0))
   {
     debug ("trying to create a socket");
 
Index: pan/tasks/nntp-pool.h
===================================================================
RCS file: /cvs/gnome/pan2/pan/tasks/nntp-pool.h,v
retrieving revision 1.2
diff -u -r1.2 nntp-pool.h
--- pan/tasks/nntp-pool.h	10 Oct 2006 22:19:42 -0000	1.2
+++ pan/tasks/nntp-pool.h	30 Oct 2006 15:44:34 -0000
@@ -106,6 +106,7 @@
       typedef std::vector<PoolItem> pool_items_t;
       pool_items_t _pool_items;
       int _active_count;
+      time_t _lockout_expire_time;
 
       typedef std::set<Listener*> listeners_t;
       listeners_t _listeners;
