domainkeys: only register hooks if Mail::DomainKeys is loadable
This commit is contained in:
parent
efbaf2ec6f
commit
41550c2681
@ -68,7 +68,22 @@ sub init {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
sub hook_data_post {
|
sub register {
|
||||||
|
my $self = shift;
|
||||||
|
|
||||||
|
for my $m ( qw/ Mail::DomainKeys::Message Mail::DomainKeys::Policy / ) {
|
||||||
|
eval "use $m";
|
||||||
|
if ( $@ ) {
|
||||||
|
warn "skip: plugin disabled, could not load $m\n";
|
||||||
|
$self->log(LOGERROR, "skip: plugin disabled, is $m installed?");
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
$self->register_hook('data_post', 'data_post_handler');
|
||||||
|
};
|
||||||
|
|
||||||
|
sub data_post_handler {
|
||||||
my ($self, $transaction) = @_;
|
my ($self, $transaction) = @_;
|
||||||
|
|
||||||
if ( ! $transaction->header->get('DomainKey-Signature') ) {
|
if ( ! $transaction->header->get('DomainKey-Signature') ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user