c3lf-system-3/core/mail/socket.py

32 lines
795 B
Python
Raw Permalink Normal View History

2023-11-23 23:17:20 +01:00
from abc import ABCMeta
from aiosmtpd.controller import BaseController, UnixSocketMixin
from aiosmtpd.lmtp import LMTP
class BaseAsyncController(BaseController, metaclass=ABCMeta):
def __init__(
self,
handler,
loop,
**SMTP_parameters,
):
super().__init__(
handler,
loop,
**SMTP_parameters,
)
def serve(self):
return self._create_server()
class UnixSocketLMTPController(UnixSocketMixin, BaseAsyncController):
def factory(self):
return LMTP(self.handler)
2024-12-05 01:31:06 +01:00
# def _trigger_server(self): # pragma: no-unixsock
# # Prevent confusion on which _trigger_server() to invoke.
# # Or so LGTM.com claimed
# UnixSocketMixin._trigger_server(self)