                              del data[:2]
                  else:
                      print '(2)Ignoring ', parts
-@@ -3431,7 +3428,16 @@
+@@ -3431,7 +3430,16 @@
                      except ValueError:
                          raise IllegalServerResponse, line
                      else:

         if recent is not None or exists is not None:
             self.newMessages(exists, recent)
 
@@ -3336,6 +3331,8 @@
                             if len(data) < 2:
                                 raise IllegalServerResponse("Not enough arguments", data)
                             flags.setdefault(id, {})[data[0]] = data[1]

             else:
                 unuse.append(L)
         d, self.defer = self.defer, None
@@ -2245,10 +2240,12 @@
                     for f in fetched.get('FLAGS', []):
                         sum.append(f)
                     flags.setdefault(mId, []).extend(sum)
+            elif L.find('BYE LOGOUT') != -1:
+                pass
             else:
                 log.msg('Unhandled unsolicited response: ' + repr(L))
-        if flags:
