From 7402ad9b1f5c5967b76380b4c65970935111f499 Mon Sep 17 00:00:00 2001 From: Thomas Oettli Date: Wed, 10 Jun 2020 10:33:15 +0200 Subject: [PATCH] imporove disclaimer placement and change version to 1.0.5 --- pymodmilter/actions.py | 4 +++- pymodmilter/version.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pymodmilter/actions.py b/pymodmilter/actions.py index ab87f96..ea17304 100644 --- a/pymodmilter/actions.py +++ b/pymodmilter/actions.py @@ -185,6 +185,8 @@ def _patch_message_body(msg, action, text, html, logger): body = soup.find('body') if not body: body = soup + elif body.text != soup.text: + body = soup if action == "prepend": body.insert(0, copy(html)) @@ -192,7 +194,7 @@ def _patch_message_body(msg, action, text, html, logger): body.append(html) html_body.set_content( - str(body).encode(), maintype="text", subtype="html") + str(soup).encode(), maintype="text", subtype="html") html_body.set_param("charset", "UTF-8", header="Content-Type") diff --git a/pymodmilter/version.py b/pymodmilter/version.py index 92192ee..68cdeee 100644 --- a/pymodmilter/version.py +++ b/pymodmilter/version.py @@ -1 +1 @@ -__version__ = "1.0.4" +__version__ = "1.0.5"