🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.gnus
Article #635

Re: converting rmail format to mh format

#635
From: Vivek Khera
Date: Thu, 28 Jan 1993 18:43
62 lines
2623 bytes
In article <SSAMMY.93Jan28130131@hunter-03.cs.strath.ac.uk> ssammy@cs.strath.ac.uk (Paul Sammy 4th Year iE/CES) writes:

   I've just changed my default-article saver to save articles in the MH 
   format.
   However, I've got quite a lot of articles in the rmail format that I'd
   like to be able to view from the MH folder.

here's my program to do this.  written in Perl.  i call it babyl2mh.
after conversion, you must manually delete the rmail files you no
longer need.

--cut here--
#!/usr/gnu/bin/perl

# incorporate an RMAIL babyl file into an MH folder
#
# usage: babyl2mh +folder babyl-file
#
# V. Khera 17-JUL-1991
# $Id: babyl2mh,v 1.1 1991/07/17 18:23:39 khera Exp $

# where to find rcvstore
$rcvstore = "/usr/local/lib/mh/rcvstore";

#
# pull out command line args
#
die "usage: babyl2mh +folder babyl-file\n" unless @ARGV == 2;

$folder = shift;
# make sure folder name starts with a "+"
(substr($folder,0,1) eq "+") || (substr($folder,0,0) = "+");
$bfname = shift;

print "Incorporating RMAIL file $bfname into MH folder $folder\n";

#
# read in babyl file.
#
$/ = "\037";	# this separates the records in a babyl file
$* = 1;		# records are multi-lines

open(BABYL,$bfname) || die "Couldn't open $bfname\n";

$_ = <BABYL>;	# discard header.

$msgnum = 0;

while (<BABYL>) {
  chop;		# get rid of delimeter
  s/\f(.|\n)*\*\*\* EOOH \*\*\*\n//;	# remove duplicate header information
  open(RCVSTORE,"|" . $rcvstore . " $folder");
  print RCVSTORE $_;
  $msgnum++;
  print "Message $msgnum done.\n";
}
--cut here--
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Gradual Student/Systems Guy  Department of Computer Science
Internet:   khera@cs.duke.edu             Box 90129
            (MIME mail accepted)          Durham, NC 27708-0129 (919)660-6528
Technical Details
Message-ID: <KHERA.93Jan28134318@thneed.cs.duke.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!europa.eng.gtefsd.com!emory!sol.ctr.columbia.edu!howland.reston.ans.net!spool.mu.edu!agate!stanford.edu!rock!concert!duke!khera
References: <SSAMMY.93Jan28130131@hunter-03.cs.strath.ac.uk>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!europa.eng.gtefsd.com!emory!sol.ctr.columbia.edu!howland.reston.ans.net!spool.mu.edu!agate!stanford.edu!rock!concert!duke!khera
From: khera@cs.duke.edu (Vivek Khera)
Newsgroups: gnu.emacs.gnus
Subject: Re: converting rmail format to mh format
Message-ID: <KHERA.93Jan28134318@thneed.cs.duke.edu>
Date: 28 Jan 93 18:43:18 GMT
References: <SSAMMY.93Jan28130131@hunter-03.cs.strath.ac.uk>
Sender: news@duke.cs.duke.edu
Distribution: gnu
Organization: Duke University CS Dept., Durham, NC
Lines: 62
Nntp-Posting-Host: thneed.cs.duke.edu
To: ssammy@cs.strath.ac.uk (Paul Sammy 4th Year iE/CES)
In-reply-to: ssammy@cs.strath.ac.uk's message of 28 Jan 93 13:01:31 GMT
X-Md4-Signature: 1caae3a28707db81fb74abb895e03205