mirror of
https://github.com/chatmail/relay.git
synced 2026-05-15 02:14:36 +00:00
remove filtermail split and LMTP backend
This commit is contained in:
@@ -7,9 +7,8 @@ from email.parser import BytesParser
|
||||
from email import policy
|
||||
from email.utils import parseaddr
|
||||
|
||||
from aiosmtpd.lmtp import LMTP
|
||||
from aiosmtpd.smtp import SMTP
|
||||
from aiosmtpd.controller import UnixSocketController, Controller
|
||||
from aiosmtpd.lmtp import SMTP
|
||||
from aiosmtpd.controller import Controller
|
||||
from smtplib import SMTP as SMTPClient
|
||||
|
||||
|
||||
@@ -112,21 +111,16 @@ class SMTPController(Controller):
|
||||
return SMTP(self.handler, **self.SMTP_kwargs)
|
||||
|
||||
|
||||
async def asyncmain_beforequeue(loop, port):
|
||||
async def asyncmain_beforequeue(port):
|
||||
Controller(BeforeQueueHandler(), hostname="127.0.0.1", port=port).start()
|
||||
|
||||
|
||||
def main():
|
||||
args = sys.argv[1:]
|
||||
assert len(args) == 2
|
||||
assert len(args) == 1
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
loop = asyncio.new_event_loop()
|
||||
asyncio.set_event_loop(loop)
|
||||
if args[0] == "afterqueue":
|
||||
task = asyncmain_afterqueue(loop, args[1])
|
||||
elif args[0] == "beforequeue":
|
||||
task = asyncmain_beforequeue(loop, port=int(args[1]))
|
||||
else:
|
||||
raise SystemExit(1)
|
||||
task = asyncmain_beforequeue(port=int(args[1]))
|
||||
loop.create_task(task)
|
||||
loop.run_forever()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Description=Chatmail Postfix BeforeQeue filter
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/local/bin/filtermail beforequeue 10080
|
||||
ExecStart=/usr/local/bin/filtermail 10080
|
||||
Restart=always
|
||||
RestartSec=30
|
||||
|
||||
Reference in New Issue
Block a user