Subject: | Add always-trust support to Mail::GnuPG. |
Hi,
I need to be able to send out some encrypted emails using peoples GPG
public keys that have been provided in a manual method. And I don't
want to have to setup specific key for automatically creating trust
signatures which might leak out into the wild.
Fortunately gpg has a solution to this called always-trust. And
GnuPG::Interface exposes this.
The attached patch makes Mail::GnuPG expose it as well. It would be
very handy to have this rolled into Mail::GnuPG.
Cheers!
Subject: | mail-gnupg-always_trust.patch |
--- libmail-gnupg-perl-0.16.orig/lib/Mail/GnuPG.pm 2011-12-06 21:30:00.000000000 +1300
+++ libmail-gnupg-perl-0.16/lib/Mail/GnuPG.pm 2011-12-06 21:33:11.000000000 +1300
@@ -45,6 +45,7 @@
keydir => gpg configuration/key directory
passphrase => primary key password
use_agent => use gpg-agent if non-zero
+ always_trust => always trust a public key
# FIXME: we need more things here, maybe primary key id.
@@ -78,6 +79,10 @@
# ( defined $self->{passphrase} ?
# ( passphrase => $self->{passphrase} ) : () ),
);
+
+ if (defined $self->{always_trust}) {
+ $gnupg->options->always_trust($self->{always_trust})
+ }
$gnupg->call( $self->{gpg_path} ) if defined $self->{gpg_path};
}