From b146e0cd7e00fc0b9d3a220f389a58a7ad63a1c6 Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Tue, 26 Mar 2013 22:15:13 -0400 Subject: [PATCH] dkim: added karma for dkim results (allow/reject) --- plugins/dkim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/dkim b/plugins/dkim index 549dc2c..4155df6 100644 --- a/plugins/dkim +++ b/plugins/dkim @@ -152,6 +152,7 @@ sub get_details { sub handle_sig_fail { my ( $self, $dkim, $mess ) = @_; + $self->adjust_karma( -1 ); return $self->get_reject( "DKIM signature invalid: " . $dkim->result_detail, $mess ); }; @@ -179,6 +180,7 @@ sub handle_sig_invalid { }; }; + $self->adjust_karma( -1 ); $self->log(LOGINFO, $mess ); if ( $prs->{accept} ) { @@ -212,6 +214,7 @@ sub handle_sig_pass { if ( $prs->{accept} ) { $self->add_header( $mess ); $self->log(LOGINFO, "pass, valid signature, accept policy"); + $self->adjust_karma( 1 ); return DECLINED; } elsif ( $prs->{neutral} ) { @@ -222,6 +225,7 @@ sub handle_sig_pass { } elsif ( $prs->{reject} ) { $self->log(LOGINFO, $mess ); + $self->adjust_karma( -1 ); return $self->get_reject( "DKIM signature valid but fails policy, $mess", "fail, valid sig, reject policy" @@ -252,7 +256,6 @@ sub handle_sig_none { }; }; - if ( $prs->{accept} ) { $self->log( LOGINFO, "pass, no signature, accept policy" ); return DECLINED;