#!/usr/bin/perl # ^^^^^^^^^^^^ update to your configuration(1/2) # maildecG.pl: Mail decode Goma's, use sendmail command # ver.2.00 1996/09/06 # Copyright (c) 1996 GOMASUKE # Orange Internet Service USERS, Japan # require 'jcode.pl'; chop($day = `date`); %m = ("Jan","01","Feb","02","Mar","03","Apr","04", "May","05","Jun","06","Jul","07","Aug","08", "Sep","09","Oct","10","Nov","11","Dec","12"); ($w,$mm,$d,$t,$g,$y) = split(' ',$day); $d = substr("0$d", -2); $date = "$w, $m{$mm}/$d/$y $t $g"; $ENV{'REQUEST_METHOD'} =~ tr/a-z/A-Z/; if ($ENV{'REQUEST_METHOD'} eq "GET") { $dat = $ENV{'QUERY_STRING'}; } else { read(STDIN, $dat, $ENV{'CONTENT_LENGTH'}); } $ag = 0; $Smail = ""; @buf = split('&',$dat); foreach $item (@buf) { ($var,$value) = split('=',$item); $value =~ tr/+/ /; $value =~ s/%([0-9a-fA-F][0-9a-fA-F])/pack("C", hex($1))/eg; $value =~ s/\x0d\x0a/\x0a/g; $value =~ s/\x0d/\x0a/g; $Smail = "$Smail$var :=\n$value\n\n"; &jcode'convert(*value,'jis'); $itm{$var} = $value; $arg[$ag] = $var; $ag++; } $mailto = "/usr/bin/sendmail -t"; # ^^^^^^^^^ update to your configuration(2/2) $myadrs = $itm{'myadrs'}; $myadrs = "foo@hogehoge"; # ATTENTION $url = $itm{'url'}; $name = $itm{'name'}; $email = $itm{'email'}; if ($email eq "") { print "Content-type: text/html\n\n"; print "

Input your e-mail address

\n"; exit; } $org = $itm{'org'}; if ($org eq "") { $org = "WWW net surfer"; } $subject = $itm{'subject'}; if ($subject eq "") { $subject = "no subject"; } $rr = $itm{'rr'}; $cc = $itm{'cc'}; $bcc = $itm{'bcc'}; open(ML,"| $mailto"); print ML <\n/g; &jcode'convert(*Smail,'sjis'); print "Content-type: text/html\n\n"; print "Mail Receipt\n"; print "

E-mail send script completed

\n"; print "$Smail"; } else { print "Location: $url\n\n"; } exit;