From 7ff45375f1ca1208dd9173973a123178ddbdea59 Mon Sep 17 00:00:00 2001 From: Daniel B Date: Tue, 3 May 2016 19:41:53 +0200 Subject: [PATCH] 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) --- plugins/dmarc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/dmarc b/plugins/dmarc index b0437ce..d37a9b4 100644 --- a/plugins/dmarc +++ b/plugins/dmarc @@ -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; }