summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
Diffstat (limited to 'script')
-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()