Fix dmarc reject (#260)

* 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)
This commit is contained in:
Daniel B 2016-05-03 19:41:53 +02:00 committed by Matt Simerson
parent 9748064889
commit 7ff45375f1

View File

@ -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;
}