From 0b588dff194f5dbf55ee49e88e0ca396b1bed858 Mon Sep 17 00:00:00 2001 From: "Jannis M. Hoffmann" Date: Tue, 21 Mar 2023 13:33:21 +0100 Subject: Bundle of small changes --- script/qmauth.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'script') diff --git a/script/qmauth.py b/script/qmauth.py index 1dcc8e3..c306e1f 100755 --- a/script/qmauth.py +++ b/script/qmauth.py @@ -219,8 +219,10 @@ def _get_body(mail): ret = mail.get_content() if ret.isascii(): return ret.decode(encoding='ascii') - else: + elif len(ret) <= 512*1024: return b64encode(ret).decode(encoding='ascii') + else: + raise QMAuthError("non attachment part too large (>512kB)", size=len(ret)) if (mctype := mail.get_content_maintype()) == 'message': msg = mail.get_content() -- cgit v1.2.3