#!/usr/bin/perl5
#
# $Id: email_cat3.pl,v 1.2 1998/05/21 20:45:21 sheneman Exp $
#
##############################################################################
#
# The contents of this file are subject to the Netscape Public License Version
# 1.0 (the "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at http://www.mozilla.org/NPL/ 
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
# the specific language governing rights and limitations under the License. 
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are Copyright (C) 1998 Netscape
# Communications Corporation. All Rights Reserved.
#
##############################################################################
#
#
# E-Mail the category 3 people here
#
# Luke Sheneman
# 01/07/97
#

$CAT3_FILE =  "/u/sheneman/projects/cleanup/current/cat3.txt";
$EMAIL_FILE = "/u/sheneman/projects/cleanup/kill_cat3/cat3.html";

# build a current list of usernames
@users = `cat $CAT3_FILE | grep USER | cut -f2 -d:`;

# generate a custom e-mail for this user
foreach $user (@users) {
    chop $user;
    $file = `cat $EMAIL_FILE`;
    $file =~ s/USERNAME/$user/g;

    open (OUT, ">outfile");
    print (OUT "Subject: IMPORTANT!  PLEASE ACT IMMEDIATELY!\n");
    print (OUT "Content-type: text/html\n\n");
    print (OUT "$file");
    close (OUT);

    $result = `/bin/mail $user < outfile`;

    print("Mailed $user\n");

    sleep 2;
}

