1#!/usr/bin/perl 2# 13.9.1999, Sampo Kellomaki <sampo@iki.fi> 3# 4# Usage: printf "test\r\n" | ./smime -mime text/plain | ./smime -cs joecool-both.pem 1234 | send.pl subject from to 5# 6 7use Net::SMTP; 8 9($subject, $from, $to) = @ARGV; 10$subject = "sign test $$" unless $subject; 11$from = 'sampo2@neuronio.pt' unless $from; 12$to = 'sampo2@neuronio.pt' unless $to; 13 14$smime = join '', <STDIN>; 15 16$msg = <<SMTP; 17To: $to 18From: $from 19Subject: $subject 20MIME-Version: 1.0 21$smime 22SMTP 23 ; 24 25print ">>$msg<<\n"; 26$msg =~ s/\r\n/\n/g; # seems datasend will do gratuitous LF->CFLF for us 27 28$smtp = Net::SMTP->new('mail.neuronio.pt'); 29$smtp->mail($from); 30$smtp->to($to); 31$smtp->data(); 32$smtp->datasend($msg); 33$smtp->dataend(); 34 35print "Done.\n"; 36 37__END__ 38 39printf "test\r\n" | ./smime -mime text/plain | ./smime -cs joecool-both.pem 1234 | ./send.pl 40 41printf "teksti\r\n" | ./smime -m image/gif openssl.gif | ./smime -cs joecool-both.pem 1234 | ./send.pl 42 43./smime -m image/gif openssl.gif <8bit | ./smime -cs joecool-both.pem 1234 | ./send.pl | tee sig2 44 45