def disconnect(self): """Closes the IMAP4 handle""" self.handle.expunge() self.handle.close() self.handle.logout()