[Bug 1917968] [NEW] A text/plain message body is scrubbed with a .ksh extension
Public bug reported: If a simple text/plain message has a Content-Disposition: header and does not have a Content-Type: header with a charset parameter, the body will be scrubbed to a file with a .ksh extension. It is only text/plain attachments that should be scrubbed in this way and they should be given a .txt extension. ** Affects: mailman Importance: Low Assignee: Mark Sapiro (msapiro) Status: Fix Committed -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/1917968 Title: A text/plain message body is scrubbed with a .ksh extension To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/1917968/+subscriptions
** Branch linked: lp:mailman/2.1 -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/1917968 Title: A text/plain message body is scrubbed with a .ksh extension To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/1917968/+subscriptions
Some msgs won't have a Content-Disposition header. Mar 06 13:46:43 2021 (6223) uncaught archiver exception at filepos: 0 Mar 06 13:46:43 2021 (6223) Uncaught runner exception: 'NoneType' object has no attribute 'lower' Mar 06 13:46:43 2021 (6223) Traceback (most recent call last): File "/var/lib/mailman/Mailman/Queue/Runner.py", line 119, in _oneloop self._onefile(msg, msgdata) File "/var/lib/mailman/Mailman/Queue/Runner.py", line 190, in _onefile keepqueued = self._dispose(mlist, msg, msgdata) File "/var/lib/mailman/Mailman/Queue/ArchRunner.py", line 77, in _dispose mlist.ArchiveMail(msg) File "/var/lib/mailman/Mailman/Archiver/Archiver.py", line 250, in ArchiveMail h.processUnixMailbox(f) File "/var/lib/mailman/Mailman/Archiver/pipermail.py", line 584, in processUnixMailbox m = mbox.next() File "/usr/lib/python2.7/mailbox.py", line 2076, in next return self.factory(_PartialFile(self.fp, start, stop)) File "/var/lib/mailman/Mailman/Mailbox.py", line 90, in scrubber return mailbox.scrub(msg) File "/var/lib/mailman/Mailman/Mailbox.py", line 110, in scrub return self._scrubber(self._mlist, msg) File "/var/lib/mailman/Mailman/Handlers/Scrubber.py", line 205, in process if part.get('content-disposition').lower() == 'attachment' and \ AttributeError: 'NoneType' object has no attribute 'lower' -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/1917968 Title: A text/plain message body is scrubbed with a .ksh extension To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/1917968/+subscriptions
Try changing it to if part.get('content-disposition') and part.get('content- disposition').lower() == 'attachment'... It's ugly, but it works! :) -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/1917968 Title: A text/plain message body is scrubbed with a .ksh extension To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/1917968/+subscriptions
Thanks for pointing that out. -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/1917968 Title: A text/plain message body is scrubbed with a .ksh extension To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/1917968/+subscriptions
Actually part.get('content-disposition', '').lower() == 'attachment'... is the fix. -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/1917968 Title: A text/plain message body is scrubbed with a .ksh extension To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/1917968/+subscriptions
Nice! Thanks. -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/1917968 Title: A text/plain message body is scrubbed with a .ksh extension To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/1917968/+subscriptions
** Changed in: mailman Status: Fix Committed => Fix Released -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/1917968 Title: A text/plain message body is scrubbed with a .ksh extension To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/1917968/+subscriptions
participants (3)
-
Jim Popovitch
-
Launchpad Bug Tracker
-
Mark Sapiro