aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/SendReport/Email.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-03-08 14:13:48 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-03-14 15:36:27 +0000
commit74a7ed654369cb3ebd282c01d4a0de87a646c4ce (patch)
tree27e5e8090d8a1e3be4e69b9d5344e9fa67ee1b6a /perllib/FixMyStreet/SendReport/Email.pm
parent7361516252a4d98620f66318cabe75acb3291efb (diff)
Use sender in From if From and To domains match.
To deal with a recipient mail server not allowing inbound email using the same domain as an internal domain, e.g. https://community.mimecast.com/docs/DOC-1419
Diffstat (limited to 'perllib/FixMyStreet/SendReport/Email.pm')
-rw-r--r--perllib/FixMyStreet/SendReport/Email.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/SendReport/Email.pm b/perllib/FixMyStreet/SendReport/Email.pm
index 8fedc48b5..9abccf510 100644
--- a/perllib/FixMyStreet/SendReport/Email.pm
+++ b/perllib/FixMyStreet/SendReport/Email.pm
@@ -2,6 +2,7 @@ package FixMyStreet::SendReport::Email;
use Moo;
use FixMyStreet::Email;
+use Utils::Email;
BEGIN { extends 'FixMyStreet::SendReport'; }
@@ -90,7 +91,8 @@ sub send {
my $sender = FixMyStreet::Email::unique_verp_id('report', $row->id);
- if (FixMyStreet::Email::test_dmarc($params->{From}[0])) {
+ if (FixMyStreet::Email::test_dmarc($params->{From}[0])
+ || Utils::Email::same_domain($params->{From}, $params->{To})) {
$params->{'Reply-To'} = [ $params->{From} ];
$params->{From} = [ $sender, $params->{From}[1] ];
}