#!/usr/bin/perl
$gpgpath = "/usr/bin/gpg";
$gpguser = "xxxxxxxx\@xxxxxxxxx.com";
print "Content-Type: text/html\n";
print "\n
\n";
$stdin = ;
$stdin =~ s/\+/ /g;
%form = split(/=|&/, $stdin);
$filenum = int(rand 50) + 1;
open(OUTMESSAGE, ">tmpMessages/$filenum");
while (($name, $value) = each %form)
{
$value =~ s/%([0-9a-fA-F][0-9a-fA-F])/pack("C", hex($1))/eg;
$form{"$name"} = $value;
}
print OUTMESSAGE $form{'body'};
close OUTMESSAGE;
$gpgcommand = "$gpgpath --batch --always-trust --eatr -a -r $gpguser -o tmpMessages/$filenum.enc -e";
print $gpgcommand;
print `$gpgcommand`;
print "\n\n";