From: myon Date: Mon, 1 May 2006 11:12:35 +0000 (+0000) Subject: + Make also-encrypt-to a list, add a commented stanza to the default X-Git-Url: https://git.sthu.org/?p=pgp-tools.git;a=commitdiff_plain;h=415853a798c69ae8a5bbd1579f0f5d2b8d1cfa41 + Make also-encrypt-to a list, add a commented stanza to the default config file (Closes: #325163). + Include mail-template in default config file, some minor syntax fixes. git-svn-id: svn://svn.debian.org/pgp-tools/trunk@277 b513b33f-fedd-0310-b452-c3deb5f4c849 --- diff --git a/caff/caff b/caff/caff index 2fc095d..cfb7d09 100755 --- a/caff/caff +++ b/caff/caff @@ -164,9 +164,9 @@ is set to. Path to your secret keyring. Default: B<$HOME/.gnupg/secring.gpg>. -=item B [keyid] +=item B [list of keyids] -An additional keyid to encrypt messages to. Default: none. +Additional keyids to encrypt messages to. Default: none. =item B [string] @@ -380,26 +380,36 @@ sub generate_config() { ($Cgecos,$Cemail,$Ckeys) = ('#','#','#'); }; - return < # -# if you have a v4 key, it will simply be the last 16 digits of +# If you have a v4 key, it will simply be the last 16 digits of # your fingerprint. # # Example: -# \$CONFIG{'keyid'} = [ qw{FEDCBA9876543210} ]; +# \$CONFIG{'keyid'} = [ qw{FEDCBA9876543210} ]; # or, if you have more than one key: -# \$CONFIG{'keyid'} = [ qw{0123456789ABCDEF 89ABCDEF76543210} ]; +# \$CONFIG{'keyid'} = [ qw{0123456789ABCDEF 89ABCDEF76543210} ]; +$Ckeys\$CONFIG{'keyid'} = [ qw{@keys} ]; -$Ckeys\$CONFIG{'keyid'} = [ qw{@keys} ]; +# Additionally encrypt messages sent to these keyids +#\$CONFIG{'also-encrypt-to'} = [ qw{@keys} ]; + +# Mail template to use for the encrypted part +#\$CONFIG{'mail-template'} = << 'EOM'; EOT + + $template .= "#$_" foreach ; + $template .= "#EOM\n"; + return $template; }; sub check_executable($$) { @@ -456,28 +466,9 @@ sub load_config() { $CONFIG{'key-files'} = () unless defined $CONFIG{'key-files'}; $CONFIG{'mailer-send'} = [] unless defined $CONFIG{'mailer-send'}; die ("$PROGRAM_NAME: mailer-send is not an array ref in $config.\n") unless (ref $CONFIG{'mailer-send'} eq 'ARRAY'); - $CONFIG{'mail-template'} = <<'EOM' unless defined $CONFIG{'mail-template'}; -Hi, - -please find attached the user id{(scalar @uids >= 2 ? 's' : '')}. -{foreach $uid (@uids) { - $OUT .= "\t".$uid."\n"; -};} of your key {$key} signed by me. - -Note that I did not upload your key to any keyservers. -If you have multiple user ids, I sent the signature for each user id -separately to that user id's associated email address. You can import -the signatures by running each through `gpg --import`. - -If you want this new signature to be available to others, please upload -it yourself. With GnuPG this can be done using - gpg --keyserver subkeys.pgp.net --send-key {$key} - -If you have any questions, don't hesitate to ask. - -Regards, -{$owner} -EOM + unless (defined $CONFIG{'mail-template'}) { + $CONFIG{'mail-template'} .= $_ foreach ; + } }; sub make_gpg_fds() { @@ -766,7 +757,14 @@ sub send_mail($$$@) { $gpg->options->meta_interactive( 0 ); my ($inputfd, $stdoutfd, $stderrfd, $statusfd, $handles) = make_gpg_fds(); $gpg->options->push_recipients( $key_id ); - $gpg->options->push_recipients( $CONFIG{'also-encrypt-to'} ) if defined $CONFIG{'also-encrypt-to'}; + if (defined $CONFIG{'also-encrypt-to'}) { + if (ref($CONFIG{'also-encrypt-to'})) { + $gpg->options->push_recipients($_) + foreach @{$CONFIG{'also-encrypt-to'}}; + } else { # old syntax + $gpg->options->push_recipients($CONFIG{'also-encrypt-to'}); + } + } my $pid = $gpg->encrypt(handles => $handles); my ($stdout, $stderr, $status) = readwrite_gpg($message, $inputfd, $stdoutfd, $stderrfd, $statusfd); waitpid $pid, 0; @@ -1301,3 +1299,29 @@ for my $keyid (@keyids_ok) { }; }; + +########################### +# the default mail template +########################### + +__DATA__ +Hi, + +please find attached the user id{(scalar @uids >= 2 ? 's' : '')} +{foreach $uid (@uids) { + $OUT .= "\t".$uid."\n"; +};}of your key {$key} signed by me. + +If you have multiple user ids, I sent the signature for each user id +separately to that user id's associated email address. You can import +the signatures by running each through `gpg --import`. + +Note that I did not upload your key to any keyservers. If you want this +new signature to be available to others, please upload it yourself. +With GnuPG this can be done using + gpg --keyserver subkeys.pgp.net --send-key {$key} + +If you have any questions, don't hesitate to ask. + +Regards, +{$owner} diff --git a/caff/caffrc.sample b/caff/caffrc.sample index cadc44e..dae0229 100644 --- a/caff/caffrc.sample +++ b/caff/caffrc.sample @@ -1,5 +1,5 @@ # $Id$ -# vim: syntax=perl +# vim:ft=perl: $CONFIG{'owner'} = 'John Doe'; $CONFIG{'email'} = 'user@example.com'; @@ -11,7 +11,7 @@ $CONFIG{'email'} = 'user@example.com'; # your fingerprint. $CONFIG{'keyid'} = [ qw{DE7AAF6E94C09C7F 62AF4031C82E0039} ]; -$CONFIG{'also-encrypt-to'} = 'DE7AAF6E94C09C7F'; +$CONFIG{'also-encrypt-to'} = [ qw{DE7AAF6E94C09C7F} ]; $CONFIG{'caffhome'} = $ENV{'HOME'}.'/.caff'; # The options below need not be changed for normal operation. @@ -42,10 +42,10 @@ $CONFIG{'caffhome'} = $ENV{'HOME'}.'/.caff'; # $CONFIG{'mail-template'} = <<'EOM' # Hi, # -# please find attached the user id{(scalar @uids >= 2 ? 's' : '')}. +# please find attached the user id{(scalar @uids >= 2 ? 's' : '')} # {foreach $uid (@uids) { # $OUT .= "\t".$uid."\n"; -# };} of your key {$key} signed by me. +# };}of your key {$key} signed by me. # # Note that I did not upload your key to any keyservers. # If you have multiple user ids, I sent the signature for each user id diff --git a/debian/changelog b/debian/changelog index 071c3b8..7651285 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,12 +5,15 @@ signing-party (0.4.6-1) unreleased; urgency=low (Closes: #356830). + Make local-user a config option, thanks to Michael C. Toren for the patch (Closes: #361316). + + Make also-encrypt-to a list, add a commented stanza to the default + config file (Closes: #325163). + + Include mail-template in default config file, some minor syntax fixes. + Bump copyright, use URL in User-Agent header. * pgp-clean: + Import caff's getopt handling. + Add option to allow exporting subkeys (Closes: #359698). - -- Christoph Berg Sun, 30 Apr 2006 12:25:27 +0200 + -- Christoph Berg Mon, 1 May 2006 13:06:14 +0200 signing-party (0.4.5-1) unstable; urgency=low