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
** Branch linked: lp:mailman/2.1
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'
Try changing it to
if part.get('content-disposition') and part.get('content- disposition').lower() == 'attachment'...
It's ugly, but it works! :)
Thanks for pointing that out.
Actually
part.get('content-disposition', '').lower() == 'attachment'...
is the fix.
Nice! Thanks.
** Changed in: mailman Status: Fix Committed => Fix Released