#!/usr/local/bin/perl

# archive: A hack to use mh to handle the archives
#
# You may redistribute this file, or inlcude it into the offical majordomo
#   package
#
# $Source: /sources/cvsrepos/majordomo/contrib/archive_mh.pl,v $
# $Revision: 1.1 $
# $Date: 1993/09/01 20:36:51 $
# $Author: rouilj $
# $State: Exp $
#
# $Locker:  $

# set our path explicitly
$ENV{'PATH'} = "/bin:/usr/bin:/usr/ucb";

# Read and execute the .cf file
$cf = $ENV{"MAJORDOMO_CF"} || "/tools/majordomo-1.56/majordomo.cf";
if ($ARGV[0] eq "-C") {
    $cf = $ARGV[1];
    shift(@ARGV); 
    shift(@ARGV); 
}
if (! -r $cf) {
    die("$cf not readable; stopped");
}
eval(`cat $cf`) || die 'eval of majordomo.cf failed';

# Go to the home directory specified by the .cf file
chdir("$homedir");

exec("/tools/mh-6.8/lib/mh/rcvstore +$filedir/$ARGV[0] -nocreate\n");
