------------------------------------------------------------
revno: 1865
fixes bug: https://launchpad.net/bugs/1917968
committer: Mark Sapiro <m...@msapiro.net>
branch nick: 2.1
timestamp: Fri 2021-03-05 18:24:12 -0800
message:
  Thghten conditions for scrubbing text/plain.
modified:
  Mailman/Handlers/Scrubber.py
  NEWS


--
lp:mailman/2.1
https://code.launchpad.net/~mailman-coders/mailman/2.1

Your team Mailman Checkins is subscribed to branch lp:mailman/2.1.
To unsubscribe from this branch go to 
https://code.launchpad.net/~mailman-coders/mailman/2.1/+edit-subscription
=== modified file 'Mailman/Handlers/Scrubber.py'
--- Mailman/Handlers/Scrubber.py	2020-06-21 18:45:30 +0000
+++ Mailman/Handlers/Scrubber.py	2021-03-06 02:24:12 +0000
@@ -90,6 +90,9 @@
     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 @@
                 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:

=== modified file 'NEWS'
--- NEWS	2021-02-15 03:36:36 +0000
+++ NEWS	2021-03-06 02:24:12 +0000
@@ -12,6 +12,9 @@
     - 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

_______________________________________________
Mailman-checkins mailing list -- mailman-checkins@python.org
To unsubscribe send an email to mailman-checkins-le...@python.org
https://mail.python.org/mailman3/lists/mailman-checkins.python.org/
Member address: arch...@jab.org

Reply via email to