[Mailman-Users] v2.0beta2 three patches

Doug Hughes Doug.Hughes at Eng.Auburn.EDU
Fri Apr 21 16:20:48 CEST 2000


>The third fixes a bug for archival of moderated mails.
>

More background: The bug manifests itself as anything that
must be approved by the moderator does not make it to
the pipermail archive. It does, however, make it into the
.mbox archive, but with a missing MBOX From line.

This bug affects 2.0beta1 and 2.0beta2

Here is a simple Perl script to fix the .mbox file.
Direct it into a new file. move the original pipermail
archive directory to e.g. listname-bak, then run arch
on the new mbox file, chown the listname dir to the appropriate
owner (e.g. daemon), and then copy the new perl generated
.mbox file over the old one. (if you feel uncomfortable about
this, do a diff on list.mbox/list.mbox and the new file
previous to the arch and copying steps.

#!/usr/bin/perl
while (<>) {
    if (/^Received:/ && $last eq "\n") { 
        $keep = $_;
        $done = 0;
        while ($done != 2) {
            $_ = <>;    # Get next line
            if (/^Date: /) {
                $done++;
                ($label, $dow, $dom, $mon, $yr, $time) = split(/[\s,]+/);
            }
            if (/^From:.*<(.*)>/) {
                $done++;
                $fr = $1;
            }
            $keep .= $_;
        }
        print "From $fr  $dow $mon $dom $time $yr\n";
        print $keep;
    
    } else {
        $last = $_; 
        print;
    }
}   


example with a list called testlist

cd $mailmanhome/archives/(private|public)
mv testlist testlist.bak
perlscript < testlist.mbox/testlist.mbox > newtl.mbox
diff newtl.mbox testlist.mbox/testlist.mbox
.. < text containing new From lines in newtl.mbox > ...
../../bin/arch testlist newtl.mbox
chown -R daemon testlist
mv newtl.mbox testlist.mbox/testlist.mbox








More information about the Mailman-Users mailing list