How to use the aiosmtpd.protocol.SmtpProtocol function in aiosmtpd

To help you get started, we’ve selected a few aiosmtpd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aio-libs / aiosmtpd / aiosmtpd / protocol.py View on Github external
self._read_mode = READ_MODE_COMMAND
        self._helo = None
        self._sender = None
        self._recipients = []
        self._allowed_recipients = set()
        self._is_esmtp = False
        self._max_size = None
        self._message_size = None
        self._recipients_truncated = False

        self.COMMANDS = {
            b'HELO': SmtpProtocol.helo,
            b'EHLO': SmtpProtocol.ehlo,
            b'VRFY': SmtpProtocol.vrfy,
            b'EXPN': SmtpProtocol.expn,
            b'RSET': SmtpProtocol.rset,
            b'MAIL': SmtpProtocol.mail,
            b'RCPT': SmtpProtocol.rcpt,
            b'DATA': SmtpProtocol.data,
            b'NOOP': SmtpProtocol.noop,
            b'QUIT': SmtpProtocol.quit,
        }

        self.worker = asyncio.ensure_future(self.run(), loop=loop)

        if self.is_open():
            self.connection_open.set_result(True)
github aio-libs / aiosmtpd / aiosmtpd / protocol.py View on Github external
def connection_lost(self, exc):
        # TODO: Something with exc
        self._state = STATE_CLOSED
        self.connection_closed.set_result(None)
        super(SmtpProtocol, self).connection_lost(exc)
github aio-libs / aiosmtpd / aiosmtpd / protocol.py View on Github external
self._max_size = max_size
        self._state = STATE_CONNECTING
        self._loop = loop

        self._read_mode = READ_MODE_COMMAND
        self._helo = None
        self._sender = None
        self._recipients = []
        self._allowed_recipients = set()
        self._is_esmtp = False
        self._max_size = None
        self._message_size = None
        self._recipients_truncated = False

        self.COMMANDS = {
            b'HELO': SmtpProtocol.helo,
            b'EHLO': SmtpProtocol.ehlo,
            b'VRFY': SmtpProtocol.vrfy,
            b'EXPN': SmtpProtocol.expn,
            b'RSET': SmtpProtocol.rset,
            b'MAIL': SmtpProtocol.mail,
            b'RCPT': SmtpProtocol.rcpt,
            b'DATA': SmtpProtocol.data,
            b'NOOP': SmtpProtocol.noop,
            b'QUIT': SmtpProtocol.quit,
        }

        self.worker = asyncio.ensure_future(self.run(), loop=loop)

        if self.is_open():
            self.connection_open.set_result(True)
github aio-libs / aiosmtpd / aiosmtpd / protocol.py View on Github external
self._recipients = []
        self._allowed_recipients = set()
        self._is_esmtp = False
        self._max_size = None
        self._message_size = None
        self._recipients_truncated = False

        self.COMMANDS = {
            b'HELO': SmtpProtocol.helo,
            b'EHLO': SmtpProtocol.ehlo,
            b'VRFY': SmtpProtocol.vrfy,
            b'EXPN': SmtpProtocol.expn,
            b'RSET': SmtpProtocol.rset,
            b'MAIL': SmtpProtocol.mail,
            b'RCPT': SmtpProtocol.rcpt,
            b'DATA': SmtpProtocol.data,
            b'NOOP': SmtpProtocol.noop,
            b'QUIT': SmtpProtocol.quit,
        }

        self.worker = asyncio.ensure_future(self.run(), loop=loop)

        if self.is_open():
            self.connection_open.set_result(True)
github aio-libs / aiosmtpd / aiosmtpd / protocol.py View on Github external
self._read_mode = READ_MODE_COMMAND
        self._helo = None
        self._sender = None
        self._recipients = []
        self._allowed_recipients = set()
        self._is_esmtp = False
        self._max_size = None
        self._message_size = None
        self._recipients_truncated = False

        self.COMMANDS = {
            b'HELO': SmtpProtocol.helo,
            b'EHLO': SmtpProtocol.ehlo,
            b'VRFY': SmtpProtocol.vrfy,
            b'EXPN': SmtpProtocol.expn,
            b'RSET': SmtpProtocol.rset,
            b'MAIL': SmtpProtocol.mail,
            b'RCPT': SmtpProtocol.rcpt,
            b'DATA': SmtpProtocol.data,
            b'NOOP': SmtpProtocol.noop,
            b'QUIT': SmtpProtocol.quit,
        }

        self.worker = asyncio.ensure_future(self.run(), loop=loop)

        if self.is_open():
            self.connection_open.set_result(True)
github aio-libs / aiosmtpd / aiosmtpd / protocol.py View on Github external
self._sender = None
        self._recipients = []
        self._allowed_recipients = set()
        self._is_esmtp = False
        self._max_size = None
        self._message_size = None
        self._recipients_truncated = False

        self.COMMANDS = {
            b'HELO': SmtpProtocol.helo,
            b'EHLO': SmtpProtocol.ehlo,
            b'VRFY': SmtpProtocol.vrfy,
            b'EXPN': SmtpProtocol.expn,
            b'RSET': SmtpProtocol.rset,
            b'MAIL': SmtpProtocol.mail,
            b'RCPT': SmtpProtocol.rcpt,
            b'DATA': SmtpProtocol.data,
            b'NOOP': SmtpProtocol.noop,
            b'QUIT': SmtpProtocol.quit,
        }

        self.worker = asyncio.ensure_future(self.run(), loop=loop)

        if self.is_open():
            self.connection_open.set_result(True)
github aio-libs / aiosmtpd / aiosmtpd / protocol.py View on Github external
self._allowed_recipients = set()
        self._is_esmtp = False
        self._max_size = None
        self._message_size = None
        self._recipients_truncated = False

        self.COMMANDS = {
            b'HELO': SmtpProtocol.helo,
            b'EHLO': SmtpProtocol.ehlo,
            b'VRFY': SmtpProtocol.vrfy,
            b'EXPN': SmtpProtocol.expn,
            b'RSET': SmtpProtocol.rset,
            b'MAIL': SmtpProtocol.mail,
            b'RCPT': SmtpProtocol.rcpt,
            b'DATA': SmtpProtocol.data,
            b'NOOP': SmtpProtocol.noop,
            b'QUIT': SmtpProtocol.quit,
        }

        self.worker = asyncio.ensure_future(self.run(), loop=loop)

        if self.is_open():
            self.connection_open.set_result(True)
github aio-libs / aiosmtpd / aiosmtpd / protocol.py View on Github external
self._state = STATE_CONNECTING
        self._loop = loop

        self._read_mode = READ_MODE_COMMAND
        self._helo = None
        self._sender = None
        self._recipients = []
        self._allowed_recipients = set()
        self._is_esmtp = False
        self._max_size = None
        self._message_size = None
        self._recipients_truncated = False

        self.COMMANDS = {
            b'HELO': SmtpProtocol.helo,
            b'EHLO': SmtpProtocol.ehlo,
            b'VRFY': SmtpProtocol.vrfy,
            b'EXPN': SmtpProtocol.expn,
            b'RSET': SmtpProtocol.rset,
            b'MAIL': SmtpProtocol.mail,
            b'RCPT': SmtpProtocol.rcpt,
            b'DATA': SmtpProtocol.data,
            b'NOOP': SmtpProtocol.noop,
            b'QUIT': SmtpProtocol.quit,
        }

        self.worker = asyncio.ensure_future(self.run(), loop=loop)

        if self.is_open():
            self.connection_open.set_result(True)
github aio-libs / aiosmtpd / aiosmtpd / protocol.py View on Github external
self._helo = None
        self._sender = None
        self._recipients = []
        self._allowed_recipients = set()
        self._is_esmtp = False
        self._max_size = None
        self._message_size = None
        self._recipients_truncated = False

        self.COMMANDS = {
            b'HELO': SmtpProtocol.helo,
            b'EHLO': SmtpProtocol.ehlo,
            b'VRFY': SmtpProtocol.vrfy,
            b'EXPN': SmtpProtocol.expn,
            b'RSET': SmtpProtocol.rset,
            b'MAIL': SmtpProtocol.mail,
            b'RCPT': SmtpProtocol.rcpt,
            b'DATA': SmtpProtocol.data,
            b'NOOP': SmtpProtocol.noop,
            b'QUIT': SmtpProtocol.quit,
        }

        self.worker = asyncio.ensure_future(self.run(), loop=loop)

        if self.is_open():
            self.connection_open.set_result(True)
github aio-libs / aiosmtpd / aiosmtpd / protocol.py View on Github external
self._loop = loop

        self._read_mode = READ_MODE_COMMAND
        self._helo = None
        self._sender = None
        self._recipients = []
        self._allowed_recipients = set()
        self._is_esmtp = False
        self._max_size = None
        self._message_size = None
        self._recipients_truncated = False

        self.COMMANDS = {
            b'HELO': SmtpProtocol.helo,
            b'EHLO': SmtpProtocol.ehlo,
            b'VRFY': SmtpProtocol.vrfy,
            b'EXPN': SmtpProtocol.expn,
            b'RSET': SmtpProtocol.rset,
            b'MAIL': SmtpProtocol.mail,
            b'RCPT': SmtpProtocol.rcpt,
            b'DATA': SmtpProtocol.data,
            b'NOOP': SmtpProtocol.noop,
            b'QUIT': SmtpProtocol.quit,
        }

        self.worker = asyncio.ensure_future(self.run(), loop=loop)

        if self.is_open():
            self.connection_open.set_result(True)