File: lmtp.py

package info (click to toggle)
python-aiosmtpd 1.2.2-1%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,704 kB
  • sloc: python: 3,838; makefile: 39
file content (19 lines) | stat: -rw-r--r-- 601 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from aiosmtpd.smtp import SMTP, syntax
from public import public


@public
class LMTP(SMTP):
    @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

    async def smtp_HELO(self, arg):
        """HELO is not a valid LMTP command."""
        await self.push('500 Error: command "HELO" not recognized')

    async def smtp_EHLO(self, arg):
        """EHLO is not a valid LMTP command."""
        await self.push('500 Error: command "EHLO" not recognized')