![](https://secure.gravatar.com/avatar/fd4bd17264b01a28529e408abc3c7156.jpg?s=120&d=mm&r=g)
There seems to be a bug in the pipermail archiving in combination with admin aproved messages. The bug is that, in the archive mbox, 'From ' lines will be missing from messages which have been passed through admin approval, which means that they will be considered part of the previous message or, if there is no previous message, that the mbox is invalid and no archive will be built.
This happens because of one or two buglets, one in the mailbox standard module, and one possibly in the rfc822 module or otherwise in Mailman. When holding a message, the code uses 'str(msg)' (where msg is a rfc822.Message instance) to dump the pending message to a file. Unfortunately, rfc822.Message.__str__() only dumps the normal mail headers and the body, and *not* the 'From ' line, which is stored in rfc822.Message.unixfrom. I dont really think that is a bug in the rfc822 module, as the 'From ' line is not rfc822 but a sendmail (i think) addon for its own use, but it needs to be worked around in any case. The simple fix is attached.
In the course of tracking this bug I also found out that the mailbox standard module drops the 'From ' line entirely, before it passes the message to the rfc822.Message constructor. At first I thought that this caused the problem, but now I'm not entirely sure, and I'm not in a position to test it at the moment. This is a bug though, but not in Mailman, and I already sent a fix for it to the python patches list. If anyone is willing to test this, and the above fix doesn't work on its own, grab the mailbox.py fix from the patches mailarchive.
And, er, my apologies for this large a rant on this small a bug, it's late and I'm overworked, not spending enough time with python ;)
PS: there'll probably be some offset in this patch, my cvs tree is still cluttered with unshared hacks ;) even if it fails, though, I'm confident most people will be able to apply it by hand ;)
-- Thomas Wouters <thomas@xs4all.net>
Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
![](https://secure.gravatar.com/avatar/d10cad24a9804753ca20a8ad2d2cc593.jpg?s=120&d=mm&r=g)
I've made some changes in my copy of Mailman to split the message body from the header in admindb.py. This makes it much easier to browse through the held messages. It works perfectly, except for the fact that I haven't found a way yet to limit the number of lines displayed to ADMINDB_PAGE_TEXT_LIMIT... can anybody help me with this? the code i'm using is:
fp = open(os.path.join(mm_cfg.DATA_DIR, filename)) fullmsg = Message.Message(fp) msg_header = string.join(fullmsg.headers, '') msg_body = fullmsg.body fp.close()
You can see a result of how it looks at http://rixhq.nu/mm/admindb.png The "send copy" isn't functional yet though -- I had it working on the previous version of Mailman, but I'm not sure yet how to implement it with the new posting methods in MM. Also, I've made some small changes that move the heldmsg output to a seperate template, so I have more control on the layout of the output and it makes to code a bit more readable :)
Ricardo.
--
![](https://secure.gravatar.com/avatar/fd4bd17264b01a28529e408abc3c7156.jpg?s=120&d=mm&r=g)
On Fri, Mar 24, 2000 at 11:57:27PM +0100, Thomas Wouters wrote:
There seems to be a bug in the pipermail archiving in combination with admin aproved messages. The bug is that, in the archive mbox, 'From ' lines will be missing from messages which have been passed through admin approval, which means that they will be considered part of the previous message or, if there is no previous message, that the mbox is invalid and no archive will be built.
I've been able to test it properly now... the mailbox.py bug wrt unixfrom is unrelated (but still a bug, imho) and just this diff (attached again) is enough to fix Mailman. Since msg.unixfrom is '' if unixfrom isn't set, this shouldn't break a thing.
Regards,
Thomas Wouters <thomas@xs4all.net>
Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
participants (2)
-
Ricardo Kustner
-
Thomas Wouters