From lrlait@ertel.gsfc.nasa.gov Mon Apr 10 05:18 PDT 1995
Received: from ertel.gsfc.nasa.gov (ertel.gsfc.nasa.gov [128.183.58.23]) by caesar.jpl.nasa.gov (8.6.10/8.6.9) with ESMTP id FAA25151 for <gindi@caesar.jpl.nasa.gov>; Mon, 10 Apr 1995 05:18:13 -0700
Received: (from lrlait@localhost) by ertel.gsfc.nasa.gov (8.6.10/8.6.9) id IAA04861; Mon, 10 Apr 1995 08:19:14 -0400
From: "Leslie R. Lait" <lrlait@ertel.gsfc.nasa.gov>
Message-Id: <199504101219.IAA04861@ertel.gsfc.nasa.gov>
Subject: Re: html
To: gindi@caesar.jpl.nasa.gov
Date: Mon, 10 Apr 1995 08:19:14 -0400 (EDT)
Cc: lrlait@ertel.gsfc.nasa.gov (Leslie R. Lait)
In-Reply-To: <199504042239.WAA14841@hyperion.gsfc.nasa.gov> from "nobody@hyperion.gsfc.nasa.gov" at Apr 4, 95 10:39:13 pm
X-Mailer: ELM [version 2.4 PL23]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Content-Length: 2003
Status: R

Gindi Lynch:

I was on travel all last week, so this response is a little late.

Anyway, you wrote:
>    I'm trying to get the ATMOS homepage up to par.  Right now I'm working
>    with a strawman version and I was wondering how you got your mail 
>    thing to work.  I have discovered I need /cgi-bin/mailit.  Do you know 
>    how I can get it?  

I wrote the mailit script myself.  It is a perl script, so you will need 
perl (we are running perl 4.036).

Here is the script:
------------------------------ cut here ---------------------------------
#!/usr/bin/perl

$str = join('::',@ARGV);

printf "Content-type: text/html%c%c",10,10;

die "Must be referenced with METHODS of POST\n" 
     if ( $ENV{"REQUEST_METHOD"} ne "POST" ) ;


# set up defaults
$email{"username"} = "nobody";
$email{"usermail"} = "nobody@nowhere";
$email{"subject"} = "No Subject";
$email{"how"} = "No data";
$email{"msg"} = "";

$line = <>;
@parms = split('&',$line);
foreach $parm (@parms) {
   ( $keyword, $value ) = split('=',$parm);
   $value =~ s/\+/ /g;
   while ( $value =~ m/%(..)/ ) {
       $byte = pack('c',hex($1));
       $value =~ s/%(..)/$byte/;
   }

   $email{$keyword} = $value;
}

$whofrom = $email{"usermail"} . " (" . $email{"username"} . ")";
$subject = $email{"subject"};
@msg = split("\n", $email{"msg"});

open(OUT,"| Mail webmaster") || die "Cannot run mail\n";
print OUT "\n\n";
print OUT "~rt $whofrom\n";
print OUT "~s $subject\n";
print OUT " How I learned about this WWW page:\n";
print OUT "   $email{'how'}\n";
print OUT "\nMESSAGE:\n";
foreach $line (@msg) {
   print OUT "   $line\n";
}
close OUT;

print "<h1>Message submitted!</h1>\n";
print " Thank you for your comments.\n";


------------------------------ cut here ---------------------------------
-- 
--------------------------------------- 
Leslie Robert Lait                    | Try the GSFC Code 916 WWW page at
lrlait@ertel.gsfc.nasa.gov            | http://hyperion.gsfc.nasa.gov/ 
My opinions are my own, not NASA's.   | 

