How to use the aiosmtpd.smtp.syntax 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 johnnykv / heralding / heralding / capabilities / smtp.py View on Github external
  @syntax("AUTH mechanism [initial-response]")
  async def smtp_AUTH(self, arg):
    if not arg:
      await self.push('500 Not enough values')
      return
    args = arg.split()
    if len(args) > 2:
      await self.push('500 Too many values')
      return
    mechanism = args[0]
    if mechanism == 'PLAIN':
      if len(args) == 1:
        await self.push('334 ')  # wait for client login/password
        line = await self.readline()
        if not line:
          return
        blob = line.strip()
github aio-libs / aiosmtpd / aiosmtpd / lmtp.py View on Github external
    @syntax('LHLO hostname')
    async def smtp_LHLO(self, arg):
        """The LMTP greeting, used instead of HELO/EHLO."""
        await super().smtp_HELO(arg)
        self.show_smtp_greeting = False
github johnnykv / heralding / heralding / capabilities / smtp.py View on Github external
  @syntax('QUIT')
  async def smtp_QUIT(self, arg):
    if arg:
      await self.push('501 Syntax: QUIT')
    else:
      status = await self._call_handler_hook('QUIT')
      await self.push('221 Bye' if status is MISSING else status)
      self.stop()
github johnnykv / heralding / heralding / capabilities / smtp.py View on Github external
  @syntax('EHLO hostname')
  async def smtp_EHLO(self, hostname):
    if not hostname:
      await self.push('501 Syntax: EHLO hostname')
      return
    self._set_rset_state()
    await self.push('250-{0} Hello {1}'.format(self.hostname, hostname))
    await self.push('250-AUTH PLAIN LOGIN CRAM-MD5')
    await self.push('250 EHLO')