diff options
author | Matthew Somerville <matthew@mysociety.org> | 2016-02-02 17:47:18 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2016-02-23 13:11:37 +0000 |
commit | 28144f5153a0a7f7bad9466c883bd5c147568028 (patch) | |
tree | ed205b75e336fa53d4f622451d3209cfcae31915 /perllib/FixMyStreet/SendReport | |
parent | 06b8a48093a0ce395ea6824e6b00afec444447c3 (diff) |
Better handle replies to bounce addresses.
Auto unsubscribe alert bounces, forward on report bounces and alert
replies to support, and send through to report creator non-bounce
replies to their report (for systems that ignore both the From and
Reply-To headers).
Also forward any totally unparsed bounce to support to possibly then
adjust this bounce handling.
Diffstat (limited to 'perllib/FixMyStreet/SendReport')
-rw-r--r-- | perllib/FixMyStreet/SendReport/Email.pm | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/perllib/FixMyStreet/SendReport/Email.pm b/perllib/FixMyStreet/SendReport/Email.pm index 4d2c8bb17..7e5c10469 100644 --- a/perllib/FixMyStreet/SendReport/Email.pm +++ b/perllib/FixMyStreet/SendReport/Email.pm @@ -98,18 +98,17 @@ sub send { $params->{Bcc} = $self->bcc if @{$self->bcc}; + my $sender = sprintf('<fms-%s@%s>', + FixMyStreet::Email::generate_verp_token('report', $row->id), + FixMyStreet->config('EMAIL_DOMAIN') + ); + if (FixMyStreet::Email::test_dmarc($params->{From}[0])) { $params->{'Reply-To'} = [ $params->{From} ]; - $params->{From} = [ FixMyStreet->config('CONTACT_EMAIL'), $params->{From}[1] ]; + $params->{From} = [ $sender, $params->{From}[1] ]; } - my $result = FixMyStreet::Email::send_cron( - $row->result_source->schema, - $params, - FixMyStreet->config('CONTACT_EMAIL'), - $nomail, - $cobrand - ); + my $result = FixMyStreet::Email::send_cron($row->result_source->schema, $params, $sender, $nomail, $cobrand); unless ($result) { $self->success(1); |