Re: Form 'Reply-To'
by "Leland V. Lammert" <lvl(at)omnitec.net>
|
Date: |
Tue, 28 Dec 1999 20:23:30 -0600 |
To: |
"Susan Bishop" <susan(at)angara.com>, <hwg-servers(at)hwg.org> |
References: |
omnitec rcbowen |
|
todo: View
Thread,
Original
|
|
At 11:35 AM 12/28/99 , Susan Bishop wrote:
>Any updates to this form yet? Our website uses the current FormMail to
>process its forms.
Susan,
We are using a script that has been hanging around for some time, .. here is the first part of the script with the changes:
#!/usr/local/bin/perl
#
# Omnitec Corporation mail script for the CSR St. Louis Guest Book
$MAIL="/usr/lib/sendmail webmaster\@<thisdomain>.com";
print "Content-type: text/html\n\n";
# Parse routine for input data
sub ReadParse {
local (*in) = @_ if @_; local ($i, $loc, $key, $val);
if ($ENV{'REQUEST_METHOD'} eq "GET") { $in = $ENV{'QUERY_STRING'};}
elsif ($ENV{'REQUEST_METHOD'} eq "POST")
{read(STDIN,$in,$ENV{'CONTENT_LENGTH'});}
@in = split(/&/,$in);
foreach $i (0 .. $#in) {
$in[$i] =~ s/\+/ /g; ($key, $val) = split(/=/,$in[$i],2);
$FOUND=0; foreach (@FIELDS) { $FOUND=1 if ($key eq $_); }
if (($key ne 'TO')&&($key ne 'SUBJECT')&&($key ne 'REPLY-TO')&&($FOUND==0))
{ push(@FIELDS,$key); }
$key =~ s/%(..)/pack("c",hex($1))/ge;
$val =~ s/%(..)/pack("c",hex($1))/ge;
$in{$key} .= "\0" if (defined($in{$key}));
$in{$key} .= $val; } return 1; }
&ReadParse;
$SUBJECT=$in{'Subject'}; delete $in{'Subject'};
$REPLYTO=$in{'ReplyTo'}; delete $in{'ReplyTo'};
# Open Mail and create the output message
open (MAIL,"| $MAIL") || die "Ain't Gonna Happen";
print MAIL "Subject: SUBJECT\n";
print MAIL "Reply-To: $REPLYTO\n";
<snip>
============================================
Leland V. Lammert lvl(at)omnitec.net
Chief Scientist Omnitec Corporation
Network/Internet Consultants www.omnitec.net
============================================
HWG: hwg-servers mailing list archives,
maintained by Webmasters @ IWA