From 35fe189be757e4ea2472ecd3328107a60313c504 Mon Sep 17 00:00:00 2001 From: link2xt Date: Sat, 8 Mar 2025 01:50:56 +0000 Subject: [PATCH] Pass through `original_content` instead of `content` in filtermail This avoids unnecessary UTF-8 recoding and passes bytestring through. --- CHANGELOG.md | 3 +++ chatmaild/src/chatmaild/filtermail.py | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb84e4b5..4208b0a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## untagged +- Pass through `original_content` instead of `content` in filtermail + ([#509](https://github.com/chatmail/server/pull/509)) + - Document TLS requirements in the readme ([#514](https://github.com/chatmail/server/pull/514)) diff --git a/chatmaild/src/chatmaild/filtermail.py b/chatmaild/src/chatmaild/filtermail.py index 751590e8..3258b107 100644 --- a/chatmaild/src/chatmaild/filtermail.py +++ b/chatmaild/src/chatmaild/filtermail.py @@ -196,7 +196,9 @@ class BeforeQueueHandler: return error logging.info("re-injecting the mail that passed checks") client = SMTPClient("localhost", self.config.postfix_reinject_port) - client.sendmail(envelope.mail_from, envelope.rcpt_tos, envelope.content) + client.sendmail( + envelope.mail_from, envelope.rcpt_tos, envelope.original_content + ) return "250 OK" def check_DATA(self, envelope):