#!/usr/bin/perl $script_path = './smailA.cgi'; $sendmail_path = '/usr/sbin/sendmail'; if($ENV{'REQUEST_METHOD'} eq "POST") { read(STDIN, $buf, $ENV{'CONTENT_LENGTH'}); @data = split(/&/, $buf); foreach (@data) { ($name,$value) = split(/=/, $_); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $decode_data{$name} = $value; } $add = $decode_data{'add'}; $sub = $decode_data{'sub'}; $comment = $decode_data{'comment'}; open(SENDMAIL,"| $sendmail_path -t") || &Error("sendmail open error"); print SENDMAIL << "EOF"; From: $add To: $add Subject: $sub $comment . EOF close(SENDMAIL); print "Content-Type: text/html\r\n\r\n"; print << "END";
SUCCESS!!