#! /usr/local/bin/perl -w use strict; use CGI (); use Mail::Internet (); # avoid mailx etc. $ENV{'PERL_MAILERS'} = "mail:/donotuse:sendmail:/usr/sbin/sendmail"; $ENV{'MAILADDRESS'} = 'webmaster@mail.lns.cornell.edu'; my $to = "service\@lns.cornell.edu"; my $query = new CGI; my @fields = ( 'page', 'Who', 'Inst', 'Email', 'Phone', 'PhoneBldg', 'PhoneLNS', 'Visitor', 'Accnt', 'Auspices', 'HowLong', 'When', 'Bldg', 'Room', 'What', 'WhatOther', 'OS', 'Distr', 'OtherOS', 'Connection1', 'MACaddr1', 'Conn1Replace', 'Connection2', 'MACaddr2', 'Conn2Replace', 'Clark' ); print $query->header(); print <<"header"; LEPP - Resources
Documents Computing CESR Scoreboard Design & Publication Services


Outside Links

header if (!$query->param('Email')) { print "

Missing email address

\nYou must supply an email address\n"; print qq(Return to the previous page to resume filling in the form\n); } elsif ($query->param('When') =~ /asap/i) { print qq(

Invalid Date

\nPlease provide a date--ASAP is not sufficient for our scheduling purposes\n); print qq(Return to the previous page to resume filling in the form\n); } else { my @body; for my $field (@fields) { push @body, sprintf("%-10s %s\n", $field, $query->param($field)) if $query->param($field); } push @body, sprintf("\nsubmitted from: %s (%s)\n", $ENV{'REMOTE_ADDR'}, $ENV{'REMOTE_HOST'} || "no reverse DNS" ); my $msg = Mail::Internet->new(Body => \@body); my $head = $msg->head; $head->replace('Subject', $query->param('Subject')); $head->replace('From', $query->param('Email')); $head->replace('To', $to); if ($msg->smtpsend(To => $to)) { # remove the remote host info pop @body; print qq(

Your DHCP request has been sent to the LNS computer group with this information:

);

	print @body;
	print "
\n"; } else { print qq(

Script Error

Please send mail to service\@mail.lns.cornell.edu

); } # Send confirmation email if($query->param('Clark')){ my @body2; for my $field (@fields) { push @body2, sprintf("%-10s %s\n", $field, $query->param($field)) if $query->param($field); } push @body2, sprintf("\nsubmitted from: %s (%s)\n", $ENV{'REMOTE_ADDR'}, $ENV{'REMOTE_HOST'} || "no reverse DNS" ); my $msg2 = Mail::Internet->new(Body => \@body2); my $head2 = $msg2->head; $head2->replace('Subject', $query->param('Subject')); $head2->replace('From', $query->param('Email')); $head2->replace('To', $query->param('Email')); if ($msg2->smtpsend(To => $to)) {} } } print <<"trailer";
trailer