Re: [hypermail] hypermail + majordomo + /etc/aliases

From: Daniel Stenberg <daniel_at_haxx.se_at_hypermail-project.org>
Date: Mon, 23 Apr 2001 09:17:44 +0200 (MET DST)
Message-ID: <Pine.GSO.4.30.0104230912240.26017-100000_at_pm1.contactor.se>


On Fri, 20 Apr 2001, Ed Pop wrote:

> Could you please send me these scripts...

My procmail script is very simple and looks like below. It keeps the mail in the inbox as well as it passes it to the 'inpipe' script. There's really no reason to do this with procmail, as a .forward is good enough, but I use procmail as it enables easier debugging in cases when I want to test or change stuff.

The 'inpipe' script is a perl hack that will need your adjustments to be useful. I've edited out things from it that was unique to my server/domain.

Use everything at your own risk, treat these as public domain.

# Sender: owner-<listname>_at_<our domain>
# should result in <listname> only

my $domain="enter domain here";
if($rerun eq "") {

    _at_mail=<STDIN>;

    for(_at_mail) {

        if($_ =~ /^Sender: *owner-(.*)\_at_$domain/) {
            $mlname=$1;
        }

    }
}

if ($mlname eq "") {

    print "Not our mailing list!\n";
    exit;
}

$HOME=$ENV{'HOME'};
# path to hypermail executable

$hyper="$HOME/hypermail";

# path to gnu date command

$date="$HOME/gnudate";

# path to dir where the archives should be made
$archive_dir="$HOME/html";

# year and month right now

$month=`$date +"%Y-%m"`;
chomp $month; # cut the newline

# get file name

$file="$archive_dir/$mlname-mail-$month";

# output directory name

my $archive="$mlname-archive-$month";
$outdir="$archive_dir/$archive";

if ( $rerun eq "") {

    open(OUT, ">>$file");
    # pipe input to the file
    for(_at_mail) {

        print OUT $_;
    }
    close(OUT);
# swap to this directory

chdir($archive_dir);

# now, run hypermail on the new archive:
print "RUN: $hyper -m $file -d $outdir -c config -l \"$mlname listarkiv\"\n"; system("$hyper -m $file -d $outdir -c config -l \"$mlname listarkiv\"");

# remove previous symbolic link

unlink("$mlname-latest");
# make a symbolic link to the latest dir
symlink($archive, "$mlname-latest");

-- 
      Daniel Stenberg - http://daniel.haxx.se - +46-705-44 31 77
   ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol
Received on Mon 23 Apr 2001 02:20:02 PM GMT

This archive was generated by hypermail 2.2.0 : Thu 22 Feb 2007 07:33:53 PM GMT GMT