aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Sapiro <mark@msapiro.net>2021-03-05 18:24:12 -0800
committerMark Sapiro <mark@msapiro.net>2021-03-05 18:24:12 -0800
commitd2ca3472e083e435e812cbc3247cccf372cba906 (patch)
treea65d75e2129ca202605d8912beb1c995fa1400f6
parent7651d375b035cdfde969aaa4556b13f3caab8781 (diff)
downloadmailman2-d2ca3472e083e435e812cbc3247cccf372cba906.tar.gz
mailman2-d2ca3472e083e435e812cbc3247cccf372cba906.tar.xz
mailman2-d2ca3472e083e435e812cbc3247cccf372cba906.zip
Thghten conditions for scrubbing text/plain.
-rw-r--r--Mailman/Handlers/Scrubber.py8
-rw-r--r--NEWS3
2 files changed, 10 insertions, 1 deletions
diff --git a/Mailman/Handlers/Scrubber.py b/Mailman/Handlers/Scrubber.py
index cecd11fb..16ce3b02 100644
--- a/Mailman/Handlers/Scrubber.py
+++ b/Mailman/Handlers/Scrubber.py
@@ -90,6 +90,9 @@ def guess_extension(ctype, ext):
if ctype.lower == 'application/octet-stream':
# For this type, all[0] is '.obj'. '.bin' is better.
return '.bin'
+ if ctype.lower == 'text/plain':
+ # For this type, all[0] is '.ksh'. '.txt' is better.
+ return '.txt'
return all and all[0]
@@ -196,7 +199,10 @@ def process(mlist, msg, msgdata=None):
format = part.get_param('format')
delsp = part.get_param('delsp')
# TK: if part is attached then check charset and scrub if none
- if part.get('content-disposition') and \
+ # MAS: Content-Disposition is not a good test for 'attached'.
+ # RFC 2183 sec. 2.10 allows Content-Disposition on the main body.
+ # Make it specifically 'attachment'.
+ if part.get('content-disposition').lower() == 'attachment' and \
not part.get_content_charset():
omask = os.umask(002)
try:
diff --git a/NEWS b/NEWS
index d9b6da1e..7fb1f609 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,9 @@ Here is a history of user visible changes to Mailman.
- Fixed an issue where sometimes the wrapper message for DMARC mitigation
Wrap Message has no Subject:. (LP: #1915655)
+ - Plain text message bodies with Content-Disposition: and no declared
+ charset are no longer scrubbed. (LP: #1917968)
+
2.1.34 (26-Jun-2020)
i18n