#!/usr/server/gnu/bin/perl #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #.IDENTIFICATION comments #.LANGUAGE Per Script #.PURPOSE WWW cgi script to mail comments to the author of a page. #.AUTHOR Bo Frese Rasmussen [ST-ECF] #.KEYWORDS WWW, CGI, Comments, Form #.ENVIRONMENT UNIX # #.COMMENTS Calling conventions : # # ..../cgi-bin/comments// # # All extra arguments in the path are optional. # # Email address to send comments to. # default = http@$SERVER_NAME # # Description of which page the comment # has been send from # default = "" # #.VERSION 1.0 15/04-1994 Creation # 2.0 30/12-1994 Rewriten in Perl # #.COPYRIGHT (see end of file) #------------------------------------------------------------------------------ $version = "comments 1.0"; $rel_date = "30/12/1994"; #--------------------------- # Configuration Parameters : #--------------------------- $HTTPUSER = "http@ac1.hq.eso.org"; $LOGO = "http://arch-http.hq.eso.org/bfrasmus/images/webmaster.gif"; $MAILPROG = "mail"; sub html_tail { print <
$version - $rel_date ...... Send comments to $HTTPUSER END_HTML ; } unshift(@INC, "/usr/server/arc/lib/perl"); # Perl library ( for "cgi-lib.pl" ) #------------------------------------------------------- # Include perl libraries #------------------------------------------------------- require "cgi-lib.pl"; print &PrintHeader; # Print HTML header (the "text/html" stuff) # so we are ready even if an error message are # printed. #------------------------------ # Parse info from Web Client #------------------------------ ( $void , $email, $title ) = split( '/', $ENV{'PATH_INFO'}, 3 ); $email = $HTTPUSER unless $email; $email =~ s/[^a-zA-Z0-9\.\@_-]//g; # Just to avoid 'rm -r *' to be passed ..... if ( $ENV{'REQUEST_METHOD'} eq "GET" ) { print <Comments Mail Form

What do you think of our server?

The software you have been using is still new and constantly under development. Tell us about bugs, features we should add, things you liked and didn't like, etc.


To..... : $email 
From... :  <- Please correct !
Subject :  

END_OF_HTML } else { &ReadParse; open (MAIL,"| $MAILPROG $email") || die "Error: Can't start mail program - Please report this error to $HTTPUSER"; print MAIL "Reply-To: $in{'from'}\n"; print MAIL "Subject: $in{'subject'}\n"; print MAIL "-----\n"; print MAIL "\n\n$in{'message'}\n"; print MAIL "\n\n-----------------------------------------------------------------\n"; print MAIL "$version - $rel_date "; print MAIL "... from $ENV{'REMOTE_HOST'} ($ENV{'REMOTE_ADDR'})\n"; close ( MAIL ); print "\n"; print "

Thanks for your comments !

\n"; print "They have been send to $email\n

\n"; } #-------------------------------------------------------------------- # Add signature. #-------------------------------------------------------------------- &html_tail; exit 1; __END__ #.COPYRIGHT NOTICE # ========================================================================== # Copyright Bo Frese Rasmussen 1994 - All Rights Reserved # Copyright European Southern Observatory(ESO) 1994 - All Rights Reserved # Copyright Space Telescope - European Coordinating Facility(ST-ECF) 1994 # - All Rights Reserved # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose is hereby granted without fee, provided # that the above copyright notice appear in all copies and that both that # copyright notice, this permission notice, and the following disclaimer # appear in supporting documentation, and that the names of the copyright # holders, not be used in advertising or publicity pertaining to # distribution of the software without specific, written prior # permission. # # BO FRESE RASMUSSEN, EUROPEAN SOUTHERN OBSERVATORY, AND OTHER # CONTRIBUTORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO # THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND # FITNESS FOR ANY PARTICULAR PURPOSE. IN NO EVENT SHALL BO FRESE # RASMUSSEN, EUROPEAN SOUTHERN OBSERVATORY OR ANY OTHER CONTRIBUTOR BE # LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY # DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA, OR PROFITS, # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE, OR OTHER TORTIOUS ACTION, # ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS # SOFTWARE.