From e643ce77221a794b8fba250f0f629b3ae9b75659 Mon Sep 17 00:00:00 2001 From: "Piotr F. Mieszkowski" Date: Fri, 12 Jul 2024 20:30:11 +0200 Subject: [PATCH] Do not touch original payload in KeepIntact mode --- lacre/mailop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lacre/mailop.py b/lacre/mailop.py index 9187335..2465f90 100644 --- a/lacre/mailop.py +++ b/lacre/mailop.py @@ -134,7 +134,7 @@ class KeepIntact(MailOperation): def perform(self, message: Message, lmessage: LazyMessage) -> bytes: """Return MESSAGE unmodified.""" try: - return message.as_bytes(policy=SMTPUTF8) + return lmessage.get_original_content() except (IndexError, UnicodeEncodeError, ValueError) as e: raise MailSerialisationException(e)