From 023a8412e8b14919aeb5d256d4e5763d4c2c4037 Mon Sep 17 00:00:00 2001 From: Thomas Oettli Date: Mon, 14 Mar 2022 11:49:32 +0100 Subject: [PATCH] fix body injection and exit if no recipients left --- pyquarantine/base.py | 5 +---- pyquarantine/storage.py | 5 +++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pyquarantine/base.py b/pyquarantine/base.py index 6366992..ae2447f 100644 --- a/pyquarantine/base.py +++ b/pyquarantine/base.py @@ -135,12 +135,9 @@ class MilterMessage(MIMEPart): else: parent.make_mixed() maintype, subtype = ("multipart", "mixed") - elif subtype == "related": - parent.make_alternative() - maintype, subtype = ("multipart", "alternative") text_body = parent.get_body(preferencelist=("plain")) - html_body = parent.get_body(preferencelist=("related", "html")) + html_body = parent.get_body(preferencelist=("html")) if text_content is not None: if text_body: diff --git a/pyquarantine/storage.py b/pyquarantine/storage.py index 178f458..6972ca5 100644 --- a/pyquarantine/storage.py +++ b/pyquarantine/storage.py @@ -563,6 +563,7 @@ class Quarantine: if self._milter_action is not None: milter.delrcpt(rcpts) - if self._milter_action in ["ACCEPT", "REJECT"] and \ - not milter.msginfo["rcpts"]: + #if self._milter_action in ["ACCEPT", "REJECT"] and \ + # not milter.msginfo["rcpts"]: + if not milter.msginfo["rcpts"]: return (self._milter_action, self._reason)