#!/usr/bin/perl ############################################################# # The Shodor Education Foundation # # Brian Block - 6/21/2006 # # v2j_bug_report.cgi # # CGI bug report for vensim2java # # Original Code by: Dave Joiner # # # # Purpose: v2j_bug_report.cgi is used to send form data # # from v2j_bugs.html via email. The old code used a pipe # # to a mail program, which has potential security flaws. # # this version uses the perl module Net::SMTP, hopefully # # providing a more secure interface. # ############################################################# use CGI qw/:standard *table start_ul/; #load standard CGI routines use CGI::Pretty qw( :html3 ); #format html source so it isnt in 1 line use Net::SMTP; #instead of piping to sendmail...better security $recipient = "bblock\@shodor.org"; # get all variables from form input $bug_report = param("bug_report"); $smtp = Net::SMTP->new('mail.shodor.org'); #constructor passes smtp host $smtp->mail("v2j\@shodor.org"); #from $smtp->to("$recipient"); #to $smtp->data; #start email data $smtp->datasend("From: v2j_bug_report\n"); $smtp->datasend("To: bblock\@shodor.org\n"); $smtp->datasend("Subject: \[--V2J BUG REPORT--\]\n"); $smtp->datasend("\n"); $smtp->datasend("$bug_report"); #input from form $smtp->dataend; $smtp->quit; #start the html page creation using CGI.pm module print header(-type => 'text/html'); print start_html( -title=>"Vensim2Java - Bug Report", -bgcolor=>"#ffffff"); print h2("
Thanks!
"); $bug_report =~ s/\n/\/g; print table({width=>'60%', align=>'center', cellpadding=>'15', style=>'border:solid;border-collapse:collapse;border-width:2px'}, Tr( td({style=>'background-color:#e5d8b4;'}, "Thank you for taking the time to help improve Vensim2Java. The following bug report has been sent:",p, table({width=>'60%', align=>'center', cellpadding=>'5', style=>'border:solid;border-collapse:collapse;border-width:1px'}, Tr(td({style=>'background-color:#ece1c4'}, $bug_report ))), p, "Your feedback will be reviewed and appropriate measures will be taken to fix the problem. If you have any other questions, feel free to send an email to bblock\@shodor.org.", br, br, "Return to the Vensim2Java homepage.") )); exit;