remove filtermail split and LMTP backend

This commit is contained in:
holger krekel
2023-10-19 01:02:24 +02:00
parent 4358d5fe61
commit 7cf6cc2c91
4 changed files with 11 additions and 15 deletions

View File

@@ -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()

View File

@@ -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

View File

@@ -34,9 +34,12 @@ def _install_chatmaild() -> None:
commands=[f"pip install --break-system-packages {remote_path}"],
)
for fn in ("doveauth-dictproxy", "filtermail-before", ):
for fn in (
"doveauth-dictproxy",
"filtermail",
):
files.put(
name=f"upload {fn}.service",
name=f"Upload {fn}.service",
src=importlib.resources.files("chatmaild")
.joinpath(f"{fn}.service")
.open("rb"),

View File

@@ -33,7 +33,6 @@ submission inet n - y - - smtpd
-o smtpd_relay_restrictions=permit_sasl_authenticated,reject
-o milter_macro_daemon_name=ORIGINATING
-o smtpd_proxy_filter=127.0.0.1:10080
-o content_filter=filter:unix:private/filtermail-afterqueue
smtps inet n - y - - smtpd
-o syslog_name=postfix/smtps
-o smtpd_tls_wrappermode=yes