Skip to content

Commit

Permalink
Remove duplicate <> around envelope senders.
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed Mar 14, 2017
1 parent 8b19bd2 commit 7361516
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
4 changes: 4 additions & 0 deletions perllib/FixMyStreet/Email.pm
Expand Up @@ -77,6 +77,10 @@ sub _render_template {
return $var;
}

sub unique_verp_id {
sprintf('fms-%s@%s', generate_verp_token(@_), FixMyStreet->config('EMAIL_DOMAIN'));
}

sub _unique_id {
sprintf('fms-%s-%s@%s',
time(), unpack('h*', random_bytes(5, 1)),
Expand Down
6 changes: 1 addition & 5 deletions perllib/FixMyStreet/Script/Alerts.pm
Expand Up @@ -283,11 +283,7 @@ sub _send_aggregated_alert_email(%) {
} );
$data{unsubscribe_url} = $cobrand->base_url( $data{cobrand_data} ) . '/A/' . $token->token;

my $sender = sprintf('<fms-%s@%s>',
FixMyStreet::Email::generate_verp_token('alert', $data{alert_id}),
FixMyStreet->config('EMAIL_DOMAIN')
);

my $sender = FixMyStreet::Email::unique_verp_id('alert', $data{alert_id});
my $result = FixMyStreet::Email::send_cron(
$data{schema},
"$data{template}.txt",
Expand Down
5 changes: 1 addition & 4 deletions perllib/FixMyStreet/SendReport/Email.pm
Expand Up @@ -88,10 +88,7 @@ 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')
);
my $sender = FixMyStreet::Email::unique_verp_id('report', $row->id);

if (FixMyStreet::Email::test_dmarc($params->{From}[0])) {
$params->{'Reply-To'} = [ $params->{From} ];
Expand Down

0 comments on commit 7361516

Please sign in to comment.