Hi,
I am using PGP on a unix server, but instead of receiving an encrypted email, I get the following in the body of the message instead, and I can't work out why.
I hope someone can help (my script is listed below too..)
Thanks - Matt.
From body of email where encrypted message should be :
pgpe [[-r <recip1> -r <recip2>] [-s [-u <myid>]] | [-c]] [-afqtvz]
<file1> [-o outfile1] <file2> [-o <outfile2>]
PGP Encrypt file(s)
-a ASCII armoring
-c Conventional Encryption (IDEA only; is mutually exclusive
with -s, -u and -r)
-f Filter Mode; Read from stdin to stdout
-o <output file> Output file for most recent input file
-q Quiet mode
-r <userid> UserID to encrypt to. May be specified multiple times.
-s Sign, as well as encrypt (use pgps to just sign). If no
userid is specified with -u, the default userid is used.
-t Text mode
-u <userid> UserID of the key you wish to sign with. May only be
specified once.
-v Verbose
-z Batch mode (assumes no user interaction; not yet
implemented.
--license Display usage license
Other programs in this suite include pgps to sign, pgpv to decrypt/verify,and pgpk for key management.
#!/usr/bin/perl
use FileHandle;
use IPC::Open2;
#set path
$ENV{'PGPPATH'} = $ENV{'DOCUMENT_ROOT'} . '/../.pgp';
#set mailprog
$mailprog = '/usr/lib/sendmail';
#set recipient
$encryptedRecipient = "me\@mydomain.co.uk";
#print header
print "Content-type: text/html\n\n";
print <<HTML;
<html><head><title>sending order...</title></head><body bgcolor='#8E59EF' text='white'>PGP EMAIL TEST PROGRAM
HTML
# Send E-Mail
open(MAIL,"|$mailprog -t"
$pid = open2(\*Reader, \*Writer, "/usr/local/bin/pgpe -a $encryptedRecipient"
Writer->autoflush();
print "pid is $pid\n";
print MAIL "To: $encryptedRecipient\n";
print MAIL "From: $encryptedRecipient\n";
print MAIL "Subject: Encryption test\n\n";
print MAIL "\n Non encrypted text\n";
print MAIL "-" x 75 . "\n\n";
print Writer "Should be encrypted text\n\n";
print MAIL "-" x 75 . "\n\n";
#close
close Writer;
@got = <Reader>;
print MAIL @got;
close (MAIL);
print "</body></html>\n";
I am using PGP on a unix server, but instead of receiving an encrypted email, I get the following in the body of the message instead, and I can't work out why.
I hope someone can help (my script is listed below too..)
Thanks - Matt.
From body of email where encrypted message should be :
pgpe [[-r <recip1> -r <recip2>] [-s [-u <myid>]] | [-c]] [-afqtvz]
<file1> [-o outfile1] <file2> [-o <outfile2>]
PGP Encrypt file(s)
-a ASCII armoring
-c Conventional Encryption (IDEA only; is mutually exclusive
with -s, -u and -r)
-f Filter Mode; Read from stdin to stdout
-o <output file> Output file for most recent input file
-q Quiet mode
-r <userid> UserID to encrypt to. May be specified multiple times.
-s Sign, as well as encrypt (use pgps to just sign). If no
userid is specified with -u, the default userid is used.
-t Text mode
-u <userid> UserID of the key you wish to sign with. May only be
specified once.
-v Verbose
-z Batch mode (assumes no user interaction; not yet
implemented.
--license Display usage license
Other programs in this suite include pgps to sign, pgpv to decrypt/verify,and pgpk for key management.
#!/usr/bin/perl
use FileHandle;
use IPC::Open2;
#set path
$ENV{'PGPPATH'} = $ENV{'DOCUMENT_ROOT'} . '/../.pgp';
#set mailprog
$mailprog = '/usr/lib/sendmail';
#set recipient
$encryptedRecipient = "me\@mydomain.co.uk";
#print header
print "Content-type: text/html\n\n";
print <<HTML;
<html><head><title>sending order...</title></head><body bgcolor='#8E59EF' text='white'>PGP EMAIL TEST PROGRAM
HTML
# Send E-Mail
open(MAIL,"|$mailprog -t"
$pid = open2(\*Reader, \*Writer, "/usr/local/bin/pgpe -a $encryptedRecipient"
Writer->autoflush();
print "pid is $pid\n";
print MAIL "To: $encryptedRecipient\n";
print MAIL "From: $encryptedRecipient\n";
print MAIL "Subject: Encryption test\n\n";
print MAIL "\n Non encrypted text\n";
print MAIL "-" x 75 . "\n\n";
print Writer "Should be encrypted text\n\n";
print MAIL "-" x 75 . "\n\n";
#close
close Writer;
@got = <Reader>;
print MAIL @got;
close (MAIL);
print "</body></html>\n";