diff -r 9f9ae5f7c4ae Lib/imaplib.py --- a/Lib/imaplib.py Tue Dec 17 21:27:56 2013 -0500 +++ b/Lib/imaplib.py Wed Dec 18 09:30:16 2013 -0500 @@ -824,6 +824,8 @@ (name, self.state, ', '.join(Commands[name]))) + self._check_bye() + for typ in ('OK', 'NO', 'BAD'): if typ in self.untagged_responses: del self.untagged_responses[typ]