summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2022-12-24 22:42:44 +0100
committerRicardo Wurmus <rekado@elephly.net>2022-12-24 22:43:44 +0100
commitca4d83865943f2851b07deaf34b026705c46dd41 (patch)
treed96416aea83c3d8f5be0fd62d6fe9636a6d8641a
parent4361d69de393a55ad27574d10d7c6ad62477a13e (diff)
Don't show large attachments that fail to report their size.
Fixes <https://issues.guix.gnu.org/48160>.
-rw-r--r--mumi/web/view/utils.scm3
1 files changed, 2 insertions, 1 deletions
diff --git a/mumi/web/view/utils.scm b/mumi/web/view/utils.scm
index d05e4a8..7ab5ab5 100644
--- a/mumi/web/view/utils.scm
+++ b/mumi/web/view/utils.scm
@@ -260,7 +260,8 @@ lines when PLAIN? is #T."
(lambda (disposition)
(and=> (assoc-ref disposition 'size)
(lambda (size)
- (> size 5000))))))))
+ (> size 5000)))))
+ (> (string-length body) 5000))))
(attachment-name
(or (and=> (assoc-ref headers 'content-disposition)
(cut assoc-ref <> 'filename))