summaryrefslogtreecommitdiff
path: root/script/qmauth.py
diff options
context:
space:
mode:
authorJannis M. Hoffmann <jannis@fehcom.de>2023-03-21 13:33:21 +0100
committerJannis M. Hoffmann <jannis@fehcom.de>2023-03-21 13:33:21 +0100
commit0b588dff194f5dbf55ee49e88e0ca396b1bed858 (patch)
treed41c4cfb64f505658a9b3edb0f9877c6a63102dd /script/qmauth.py
parent6fe35cbd50d318bed8d12c5d9fc2602f8936f883 (diff)
Bundle of small changes
Diffstat (limited to 'script/qmauth.py')
-rwxr-xr-xscript/qmauth.py4
1 files changed, 3 insertions, 1 deletions
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()