mirror of
https://github.com/chatmail/relay.git
synced 2026-05-20 04:48:06 +00:00
Revert "open a persistent client between the BeforeQueueHandler and postfix smtpd without content filter"
This reverts commit fb2ea27477.
This commit is contained in:
@@ -42,7 +42,6 @@ class SMTPController(Controller):
|
|||||||
class BeforeQueueHandler:
|
class BeforeQueueHandler:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.send_rate_limiter = SendRateLimiter()
|
self.send_rate_limiter = SendRateLimiter()
|
||||||
self.smtp = SMTPClient("localhost", "10025")
|
|
||||||
|
|
||||||
async def handle_MAIL(self, server, session, envelope, address, mail_options):
|
async def handle_MAIL(self, server, session, envelope, address, mail_options):
|
||||||
logging.info(f"handle_MAIL from {address}")
|
logging.info(f"handle_MAIL from {address}")
|
||||||
@@ -62,7 +61,8 @@ class BeforeQueueHandler:
|
|||||||
if error:
|
if error:
|
||||||
return error
|
return error
|
||||||
logging.info("re-injecting the mail that passed checks")
|
logging.info("re-injecting the mail that passed checks")
|
||||||
self.smtp.sendmail(envelope.mail_from, envelope.rcpt_tos, envelope.content)
|
client = SMTPClient("localhost", "10025")
|
||||||
|
client.sendmail(envelope.mail_from, envelope.rcpt_tos, envelope.content)
|
||||||
return "250 OK"
|
return "250 OK"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user