From 90891504fcf5e6717a6aa5b506da9e2ab89cf3fc Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Tue, 14 Jun 2022 10:13:06 +0200 Subject: [PATCH] Change handling of attach size to match earlier behaviour --- src/pretix/base/services/mail.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pretix/base/services/mail.py b/src/pretix/base/services/mail.py index 875aed5459..b62db99fe2 100644 --- a/src/pretix/base/services/mail.py +++ b/src/pretix/base/services/mail.py @@ -412,8 +412,9 @@ def mail_send_task(self, *args, to: List[str], subject: str, body: str, html: st logger.exception('Could not attach invoice to email') pass - if attach_size < settings.FILE_UPLOAD_MAX_SIZE_EMAIL_ATTACHMENT: - # Do not attach more than 4MB, it will bounce way to often. + if attach_size < settings.FILE_UPLOAD_MAX_SIZE_EMAIL_ATTACHMENT - 1: + # Do not attach more than (limit - 1 MB) in tickets (1MB space for invoice, email itself, …), + # it will bounce way to often. for a in args: try: email.attach(*a)