aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/EmailSend.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2016-02-02 17:47:18 +0000
committerMatthew Somerville <matthew@mysociety.org>2016-02-23 13:11:37 +0000
commit28144f5153a0a7f7bad9466c883bd5c147568028 (patch)
treeed205b75e336fa53d4f622451d3209cfcae31915 /perllib/FixMyStreet/EmailSend.pm
parent06b8a48093a0ce395ea6824e6b00afec444447c3 (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/EmailSend.pm')
-rw-r--r--perllib/FixMyStreet/EmailSend.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/EmailSend.pm b/perllib/FixMyStreet/EmailSend.pm
index 1c6e2cf7a..09f434931 100644
--- a/perllib/FixMyStreet/EmailSend.pm
+++ b/perllib/FixMyStreet/EmailSend.pm
@@ -55,7 +55,7 @@ if ( FixMyStreet->test_mode ) {
push @$mailer_args, username => $username, password => $password
if $username && $password;
$args = {
- mailer => 'FixMyStreet::EmailSend::DoNotReply',
+ mailer => 'FixMyStreet::EmailSend::Variable',
mailer_args => $mailer_args,
};
} else {
@@ -67,5 +67,12 @@ sub new {
my ($cls, $hash) = @_;
$hash ||= {};
my %args = ( %$args, %$hash );
+
+ my $sender = delete($args{env_from});
+ if ($sender) {
+ $args{mailer_args} = [ @{$args{mailer_args}} ] if $args{mailer_args};
+ push @{$args{mailer_args}}, env_from => $sender;
+ }
+
return Email::Send->new(\%args);
}