#!/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("