#!/usr/bin/perl # ~~~~~~~~~ update to your environment(1/2) # maildec.pl: Mail decode for mail command # ver.1.00 1996/10/12 # Copyright (c)1996 GOMASUKE # Orange Internet Service USERS, Japan require 'jcode.pl'; $mail = "/usr/bin/mail"; # ~~~~~~~~~ update to your environment(2/2) $myadrs = "foo\@bar.co.jp"; # ~~~~~~~~~~~~~~ update to your address @week = ("Sun","Mon","Tue","Wed","Thu","Fri","Sat"); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdat) = localtime(time); $year += 1900; #VALID THRU 12/2037 $mon++; $date = sprintf("%4d/%02d/%02d %3s %02d:%02d:%02d", $year,$mon,$mday,$week[$wday],$hour,$min,$sec); $ua = $ENV{'HTTP_USER_AGENT'}; $ua =~ s/Mozilla/Netscape/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'}); } @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; &jcode'convert(*value, 'jis'); $value =~ s/\x0d\x0a/\x0a/g; $value =~ s/\x0d/\x0a/g; $itm{$var} = $value; } $subject = $itm{'subject'}; if ($subject eq "") { $subject = "no subject"; } $url = $itm{'url'}; $name = $itm{'name'}; $email = $itm{'email'}; if ($email eq "") { print "Content-type: text/html\n\n"; print "

e-mail address not exist

\n"; exit; } $data = $itm{'data'}; $mailto = "$mail -s '$subject' $myadrs"; open(MAIL,"| $mailto"); print MAIL <E-mail send completed\n"; } else { print "Location: $url\n\n"; } exit;