bin/arch fails with TypeError

Bug #266310 reported by Ixsnet
2
Affects Status Importance Assigned to Milestone
GNU Mailman
Fix Released
Medium
Unassigned

Bug Description

[root@bender mailman]# bin/arch -s 15965 -e 15965
bawue-net-admin
archives/private/bawue-net-admin.mbox/bawue-net-admin.mbox
Pickling archive state into
/opt/mailman-2.1.7/archives/private/bawue-net-admin/pipermail.pck
Traceback (most recent call last):
  File "bin/arch", line 200, in ?
    main()
  File "bin/arch", line 188, in main
    archiver.processUnixMailbox(fp, start, end)
  File
"/opt/mailman-2.1.7/Mailman/Archiver/pipermail.py",
line 569, in processUnixMailbox
    m = mbox.next()
  File "/usr/lib/python2.2/mailbox.py", line 34, in next
    return self.factory(_Subfile(self.fp, start, stop))
  File "/opt/mailman-2.1.7/Mailman/Mailbox.py", line
89, in scrubber
    return mailbox.scrub(msg)
  File "/opt/mailman-2.1.7/Mailman/Mailbox.py", line
109, in scrub
    return self._scrubber(self._mlist, msg)
  File
"/opt/mailman-2.1.7/Mailman/Handlers/Scrubber.py", line
352, in process
    t = part.get_payload(decode=decode)
  File "/opt/mailman-2.1.7/pythonlib/email/Message.py",
line 213, in get_payload
    return Utils._qdecode(payload)
  File "/usr/lib/python2.2/quopri.py", line 161, in
decodestring
    return a2b_qp(s, header = header)
TypeError: argument 1 must be string or read-only
buffer, not None

[http://sourceforge.net/tracker/index.php?func=detail&aid=1430236&group_id=103&atid=100103]

Revision history for this message
Ixsnet (ixsnet) wrote :
Revision history for this message
Mark Sapiro (msapiro) wrote :

The underlying cause of this problem is the fact that the
original message contains a subpart of type
message/delivery-status which in turn contains a text/plain
'returned message'. The reason this is a problem is that the
Python email library parses message/delivery-status parts
differently from other MIME parts. It considers groups of
lines separated from each other by empty lines to each be
the headers of a sub-part of the message/delivery-status
part, and these sub-parts all have only headers and no bodies.

One of these sub-parts in this case has headers with
content-type text/plain which causes scrubber to try to
include the decoded body of this part in the flattened
text/plain message which causes the error.

The attached patch will catch the exception in this case and
allow the message to be added to the archive, but the entire
message/delivery-status part will not be in the archived
message because the parser treats it as all headers and no body.

Please try the patch and report whether you think this is
satisfactory.

Revision history for this message
Ixsnet (ixsnet) wrote :

Thanks a lot.
The patch works so far as arch does not traceback anymore.

The attachment gets handled as follows:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: /
Size: 0 bytes
Desc: not available
Url : blabla

So yes, it's satisfactory.

Revision history for this message
Mark Sapiro (msapiro) wrote :

Patch is commited to CVS.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.