[Mon-commit] mon/alert.d mail.alert,1.1.1.1,1.2
Brought to you by:
trockij
|
From: Jim T. <tr...@us...> - 2004-10-06 16:29:36
|
Update of /cvsroot/mon/mon/alert.d In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1945/alert.d Modified Files: mail.alert Log Message: added -f to set the from: in header and envelope, patch from Hans-Dieter Karl <hd...@hd...> Index: mail.alert =================================================================== RCS file: /cvsroot/mon/mon/alert.d/mail.alert,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** mail.alert 9 Jun 2004 05:18:07 -0000 1.1.1.1 --- mail.alert 6 Oct 2004 16:29:19 -0000 1.2 *************** *** 6,9 **** --- 6,11 ---- # to a pager or email subject line. # + # -f from@addr.x set the smtp envelope "from" address + # # Jim Trocki, tr...@tr... # *************** *** 30,34 **** use Text::Wrap; ! getopts ("S:s:g:h:t:l:u"); $summary=<STDIN>; --- 32,36 ---- use Text::Wrap; ! getopts ("S:s:g:h:t:l:f:u"); $summary=<STDIN>; *************** *** 38,41 **** --- 40,44 ---- $mailaddrs = join (',', @ARGV); + $mailfrom = "-f $opt_f -F $opt_f" if (defined $opt_f); $ALERT = $opt_u ? "UPALERT" : "ALERT"; *************** *** 44,48 **** ($wday,$mon,$day,$tm) = split (/\s+/, $t); ! open (MAIL, "| /usr/lib/sendmail -oi -t") || die "could not open pipe to mail: $!\n"; print MAIL <<EOF; --- 47,51 ---- ($wday,$mon,$day,$tm) = split (/\s+/, $t); ! open (MAIL, "| /usr/lib/sendmail -oi -t $mailfrom") || die "could not open pipe to mail: $!\n"; print MAIL <<EOF; *************** *** 59,63 **** Group : $opt_g Service : $opt_s - Description : $ENV{MON_DESCRIPTION} Time noticed : $t Secs until next alert : $opt_l --- 62,65 ---- |