def handle(self):
        """Runs through the SMTP session, receiving commands, calling handlers,
        and sending responses.

        :raises: :class:`~slimta.smtp.ConnectionLost` or unhandled exceptions.

        """
        if self.tls and self.tls_immediately:
            if not self._encrypt_session():
                tls_failure.send(self.io, flush=True)
                return

        command, arg = b'BANNER_', None
        while True:
            try:
                try:
                    if command:
                        self._handle_command(command, arg)
                    else:
                        unknown_command.send(self.io)
                except __HOLE__:
                    self._call_custom_handler('CLOSE')
                    break
                except ConnectionLost:
                    raise
                except UnicodeDecodeError:
                    bad_arguments.send(self.io)
                    raise
                except Exception:
                    unhandled_error.send(self.io)
                    raise
                finally:
                    self.io.flush_send()

                command, arg = self._recv_command()
            except Timeout:
                timed_out.send(self.io)
                self.io.flush_send()
                raise ConnectionLost()
dataset/ETHPy150Open slimta/python-slimta/slimta/smtp/server.py/Server.handle