Skip to content

Commit

Permalink
Fix dmarc reject (#260)
Browse files Browse the repository at this point in the history
* Update data_post_headers documentation
We cannot reject at this stage, which is only there to alter headers.
Fix #258

* DMARC plugin: reject in data_post
Followup of #258: we cannot reject a connection during data_post_headers. So add a new hook in data_post to do the real rejection

* Add the dmarc_reject note on the transaction
It's probably possible to have one valid email after an invalid one using the same connection (even if not common)
  • Loading branch information
Daniel B authored and msimerson committed May 3, 2016
1 parent 9748064 commit 7ff4537
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/dmarc
Expand Up @@ -192,12 +192,12 @@ sub check_dmarc {

$self->adjust_karma(-3);
# Add a mark now so the data_post hook can do the real reject
$self->connection->notes('reject_dmarc', '1');
$transaction->notes('reject_dmarc', '1');
}

sub reject_dmarc {
my ($self, $transaction) = @_;
return $self->get_reject("failed DMARC policy")
if ($self->connection->notes('reject_dmarc'));
if ($transaction->notes('reject_dmarc'));
return DECLINED;
}

0 comments on commit 7ff4537

Please sign in to comment.