Great Circle Associates Majordomo-Users
(January 1998)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Majordomo Digests to mbox format for MHonarc (perl script)
From: The Hermit Hacker <scrappy @ hub . org>
Date: Sun, 4 Jan 1998 23:44:43 -0400 (AST)
To: mhonarc @ rosat . mpe-garching . mpg . de
Cc: "Majordomo user's mailing list" <majordomo-users @ greatcircle . com>


Hi...

	I've searched the archives for some brain dead simple way of bring in old
digests so that MHonarc can use them, and couldn't find anything but some 
references to procmail and -msgsep...nothing which seemed to work "easily"...

	So, here is my contribution...a simple, brain dead script that takes a
Majordomo digest and converts it to a format that can be used by MHonarc...
I don't guarantee it, but if anyone can suggest what is wrong with it, I'd
like to know and try to fix it

	Just run it as: <scriptname> <infile> > <outfile>

Marc G. Fournier                                
Systems Administrator @ hub.org 
primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org 

#!/usr/local/bin/perl
$userid = getlogin();

$ii = 0;
while (<>) {
  if($printline) {
    $line{$ii} = $_;
    $ii++;
  }
  if (/^----------------------------------------------------------------------/) {
    $printline = 1;
    $line{$ii} = "------------------------------";
    $ii++;
  }
}

for($jj = 0; $jj < $ii; $jj++) {
  if(/^------------------------------/, $line{$jj}) {
    if($line{$jj+2} =~ "^Date:") {
      print "From $userid\n";
      $jj += 2;
    } else {
      if($line{$jj+2} =~ "^End of") {
        exit;
      }
    }
  }
  print $line{$jj};
}



Follow-Ups:
Indexed By Date Previous: Re: Fully automatic bounce handling?
From: Jason L Tibbitts III <tibbs@hpc.uh.edu>
Next: [no subject]
From: "R F Thompson" <RTHOMP1@prodigy.net>
Indexed By Thread Previous: Give Your Child "One of the Best Children's Videos!"
From: 39sLDR5ZP@1yrdue.net
Next: Re: Majordomo Digests to mbox format for MHonarc (perl script)
From: Richard Seabrook <seabrook@umbc.edu>

Google
 
Search Internet Search www.greatcircle.com