From 75d283972ad5aa844fe3bee6bffed0cd786b632c Mon Sep 17 00:00:00 2001 From: kramo Date: Wed, 14 May 2025 18:57:22 +0200 Subject: [PATCH] =?UTF-8?q?client:=20Don=E2=80=99t=20split=20broadcasts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- openemail/core/client.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openemail/core/client.py b/openemail/core/client.py index 8b6237c..af8743c 100644 --- a/openemail/core/client.py +++ b/openemail/core/client.py @@ -1086,8 +1086,10 @@ async def _build_message( files = {} modified = date # TODO for name, data in attachments.items(): - for index, start in enumerate(range(0, len(data), MAX_MESSAGE_SIZE)): - part = data[start : start + MAX_MESSAGE_SIZE] + max_size = MAX_MESSAGE_SIZE if readers else len(data) # Don't split broadcasts + + for index, start in enumerate(range(0, len(data), max_size)): + part = data[start : start + max_size] files[name] = ( { "name": name,