From d13eae3aec89314fb595e00630e57029656fa59b Mon Sep 17 00:00:00 2001 From: Daniel B Date: Thu, 28 Apr 2016 19:09:07 +0200 Subject: [PATCH] Check rua is defined before trying to parse it (#257) Because $pol->rue returns undef is there's no rua defined, an error is printed in the logs FATAL PLUGIN ERROR [dmarc]: URI string is required! at /usr/share/perl5/vendor_perl/Mail/DMARC/PurePerl.pm line 295 --- plugins/dmarc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/dmarc b/plugins/dmarc index ca32c2c..83bc7de 100644 --- a/plugins/dmarc +++ b/plugins/dmarc @@ -144,7 +144,7 @@ sub check_dmarc { my $pol; eval { $pol = $dmarc->result->published; }; if ( $self->{_args}{reporting} && $pol ) { - if ( $dmarc->has_valid_reporting_uri($pol->rua) ) { + if ( $pol->rua && $dmarc->has_valid_reporting_uri($pol->rua) ) { eval { $dmarc->save_aggregate(); }; $self->log(LOGERROR, $@ ) if $@; }