diff --git a/gl-mr635-empty_attachment.patch b/gl-mr635-empty_attachment.patch new file mode 100644 index 0000000..0eff3e5 --- /dev/null +++ b/gl-mr635-empty_attachment.patch @@ -0,0 +1,31 @@ +From eb67c2fc470b88385f63435a826d73b32fc3c226 Mon Sep 17 00:00:00 2001 +From: Mark Sapiro +Date: Mon, 15 Jul 2024 17:44:59 -0700 +Subject: [PATCH] Return null bytes for empty attachment get_content. + +--- + hyperkitty/models/email.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/hyperkitty/models/email.py b/hyperkitty/models/email.py +index 651694e5..12732a93 100644 +--- a/hyperkitty/models/email.py ++++ b/hyperkitty/models/email.py +@@ -329,12 +329,12 @@ class Attachment(models.Model): + if self.content is not None: + return bytes(self.content) + if folder is None: +- return "" ++ return b'' + filepath = os.path.join(folder, str(self.counter)) + if not os.path.exists(filepath): + logger.error("Could not find local attachment %s for email %s", + self.counter, self.email.id) +- return "" ++ return b'' + with open(filepath, "rb") as f: + content = f.read() + return content +-- +GitLab + diff --git a/python-HyperKitty.changes b/python-HyperKitty.changes index 8ef1cc7..87f4c7c 100644 --- a/python-HyperKitty.changes +++ b/python-HyperKitty.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jul 18 20:22:39 UTC 2024 - Georg Pfuetzenreuter + +- Add gl-mr635-empty_attachment.patch to resolve corrupted archive + downloads on mails with empty attachments + ------------------------------------------------------------------- Sun Jun 23 08:37:43 UTC 2024 - Andreas Schneider diff --git a/python-HyperKitty.spec b/python-HyperKitty.spec index 651287d..3cccbfb 100644 --- a/python-HyperKitty.spec +++ b/python-HyperKitty.spec @@ -94,6 +94,8 @@ Patch0: hyperkitty-settings.patch Patch98: gl-mr300-add-opengraph-metadata.patch # PATCH-FIX-UPSTREAM gl-mr470-introduce-feed-filtering.patch gl#mailman/hyperkitty#470 Patch99: gl-mr470-introduce-feed-filtering.patch +# PATCH-FIX-UPSTREAM gl-mr635-empty_attachment.patch gl#mailman/hyperkitty#635 +Patch100: gl-mr635-empty_attachment.patch # BuildRequires: %{python_module Django >= %{django_min_version} with %python-Django < %{django_max_version}} BuildRequires: %{python_module Whoosh}