aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/SendReport/Email.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2015-08-19 12:41:27 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2015-08-19 16:51:07 +0100
commitd9f5d6805f8d897e81e00208ab138bada05f8e9d (patch)
tree050c4fc094efc681a2b222a1a449775abc4812c0 /perllib/FixMyStreet/SendReport/Email.pm
parent36d8eba063fe14a153b7f378fef5853725943c37 (diff)
Test for DMARC when sending report email.
Diffstat (limited to 'perllib/FixMyStreet/SendReport/Email.pm')
-rw-r--r--perllib/FixMyStreet/SendReport/Email.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/SendReport/Email.pm b/perllib/FixMyStreet/SendReport/Email.pm
index fa4d437fb..9fec0ac9c 100644
--- a/perllib/FixMyStreet/SendReport/Email.pm
+++ b/perllib/FixMyStreet/SendReport/Email.pm
@@ -1,6 +1,7 @@
package FixMyStreet::SendReport::Email;
use Moose;
+use FixMyStreet::Email;
BEGIN { extends 'FixMyStreet::SendReport'; }
@@ -93,6 +94,12 @@ sub send {
From => $self->send_from( $row ),
};
$params->{Bcc} = $self->bcc if @{$self->bcc};
+
+ if (FixMyStreet::Email::test_dmarc($params->{From}[0])) {
+ $params->{'Reply-To'} = [ $params->{From} ];
+ $params->{From} = [ mySociety::Config::get('CONTACT_EMAIL'), $params->{From}[1] ];
+ }
+
my $result = FixMyStreet::App->send_email_cron(
$params,
mySociety::Config::get('CONTACT_EMAIL'),