File:  [Local Repository] / processmail / reminder.pl
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Mon Feb 4 17:22:28 2002 UTC (22 years, 5 months ago) by boris
Initial revision

    1: #!/usr/local/bin/perl
    2: #
    3: #$Id: reminder.pl,v 1.1 2002/02/04 17:22:28 boris Exp $
    4: #
    5: # Читаем файл и шлем e-mail
    6: #
    7: #
    8: # Исходные файлы и параметры
    9: #
   10: 
   11:     use Getopt::Std; 
   12: 
   13: $usage = 'reminder.pl $Revision: 1.1 $, $Date: 2002/02/04 17:22:28 $'. "\n".
   14: "Usage: reminder.pl [-d] [-m mail_file]  [-o results] \n";
   15: 
   16: require 'parameters.pl';
   17: require 'subroutines.pl';
   18: 
   19: die $usage unless getopts('t:m:o:d');
   20: 
   21: $DEBUG=$opt_d;
   22: 
   23: my %teams;
   24: 
   25: #
   26: # Читаем ответы команд
   27: #
   28: if ($opt_m)
   29: {
   30:     die "Cannot open $opt_m\n" unless open(INFILE,$opt_m)
   31: }
   32: else
   33: {
   34:     *INFILE=*STDIN;
   35: }
   36: readmail(\%teams);
   37: close(INFILE);
   38: #
   39: # Пишем мейл
   40: #
   41: if ($opt_o)
   42: { 
   43:     die "Cannot open $opt_o\n" unless open(OUTFILE,">$opt_o");
   44: }
   45: else
   46: {
   47:     open(OUTFILE,"|/usr/lib/sendmail -oi -t");
   48: }
   49: select OUTFILE;
   50: &printheader;
   51: foreach $team (keys %teams)
   52: {
   53:     print  "$team\n";
   54: }
   55: 
   56: &printfooter;
   57: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>