mirror of
https://github.com/chatmail/relay.git
synced 2026-05-12 09:04: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
|
||||
|
||||
@@ -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"),
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user