RT-SimpleGPGVerify
view release on metacpan or search on metacpan
This RT extension allows your RT 3.6 instance to verify GPG signatures on incoming mail.
To use the GPG signature verification, you need to do the following:
Set up a gnupg key directory with a pubring containing only the keys
you care about and specify the following in your SiteConfig.pm
Set($RT::GPGKeyDir, "/path/to/keyring-directory");
@RT::MailPlugins = qw(Auth::MailFrom Filter::SimpleGPGVerify);
You'll also want to have a configuration file (gpg.conf) that looks like this in your GPG keyring directory:
keyserver pgp.mit.edu
keyserver-options honor-http-proxy,auto-key-retrieve
Copyright 2007 Best Practical Solutions, LLC
lib/RT/Interface/Email/Filter/SimpleGPGVerify.pm view on Meta::CPAN
Message => undef,
RawMessageRef => undef,
CurrentUser => undef,
AuthLevel => undef,
Ticket => undef,
Queue => undef,
Action => undef,
@_
);
my ( $val, $key, $address,$gpg );
$args{'Message'}->head->set('RT-PGP-Status-A' => '1');
eval {
my $parser = RT::EmailParser->new();
$parser->SmartParseMIMEEntityFromScalar(Message => ${$args{'RawMessageRef'}}, Decode => 0);
$gpg = Mail::GnuPG->new( keydir => $RT::GPGKeyDir );
my $entity = $parser->Entity;
_safe_run_child {( $val, $key, $address ) = $gpg->verify( $parser->Entity)};
};
if (my $msg = $@) { $RT::Logger->error($msg); }
$args{'Message'}->head->set('RT-PGP-Status-B' => '1');
$args{'Message'}->head->set('RT-PGP-Status' => '');
if (defined $val) {
if ($address) {
$args{'Message'}->head->set('RT-PGP-Status' => 'Good signature from '. $address);
( run in 1.704 second using v1.01-cache-2.11-cpan-df04353d9ac )