| version 1.4, 2010/10/05 23:03:09 |
version 1.5, 2010/10/05 23:46:55 |
|
|
| # | /path/to/mail-gnupg-encrypt.pl -r your@email.address.com |
# | /path/to/mail-gnupg-encrypt.pl -r your@email.address.com |
| # |
# |
| |
|
| # $Platon: scripts/perl/mail-gnupg/mail-gnupg-encrypt.pl,v 1.3 2005/01/16 19:57:27 rajo Exp $ |
# $Platon: scripts/perl/mail-gnupg/mail-gnupg-encrypt.pl,v 1.4 2010-10-05 23:03:09 rajo Exp $ |
| |
|
| use strict; |
use strict; |
| use warnings; |
use warnings; |
|
|
| $cfgfile |
$cfgfile |
| $boundary $new_content_type $old_content_type |
$boundary $new_content_type $old_content_type |
| $header_line $curr_header_key |
$header_line $curr_header_key |
| |
$new_content_type_is_set |
| ); |
); |
| |
|
| sub help($;); |
sub help($;); |
| Line 60 $new_content_type = "Content-Type: multi |
|
| Line 61 $new_content_type = "Content-Type: multi |
|
| $old_content_type = ''; |
$old_content_type = ''; |
| $header_line = ''; |
$header_line = ''; |
| $curr_header_key = ''; |
$curr_header_key = ''; |
| |
$new_content_type_is_set = 0; |
| |
|
| $conf = AppConfig->new( # {{{ |
$conf = AppConfig->new( # {{{ |
| { |
{ |
| Line 107 if (my $pid = fork()) { # parent |
|
| Line 109 if (my $pid = fork()) { # parent |
|
| while (my $line = <STDIN>) { |
while (my $line = <STDIN>) { |
| if ($line =~ m/^$/o) { # end of header, print PGP header {{{ |
if ($line =~ m/^$/o) { # end of header, print PGP header {{{ |
| print CHILD_WTR $header_line; |
print CHILD_WTR $header_line; |
| |
if ($new_content_type_is_set == 0) { |
| |
#warn "NO CONTENT-TYPE-YET"; |
| |
print CHILD_WTR $new_content_type; |
| |
} |
| print CHILD_WTR "\n\n--$boundary\n", |
print CHILD_WTR "\n\n--$boundary\n", |
| "Content-Type: application/pgp-encrypted\n", |
"Content-Type: application/pgp-encrypted\n", |
| "Content-Disposition: attachment\n\n", |
"Content-Disposition: attachment\n\n", |
| Line 120 if (my $pid = fork()) { # parent |
|
| Line 126 if (my $pid = fork()) { # parent |
|
| if ($curr_header_key eq 'content-type') { # na predchadzajucom riadku bol content-type |
if ($curr_header_key eq 'content-type') { # na predchadzajucom riadku bol content-type |
| $header_line .= $line; |
$header_line .= $line; |
| $line = $new_content_type; |
$line = $new_content_type; |
| |
$new_content_type_is_set = 1; |
| } |
} |
| $curr_header_key = lc($1); |
$curr_header_key = lc($1); |
| if ($curr_header_key eq 'content-type') { |
if ($curr_header_key eq 'content-type') { |