diff options
author | Ivan Kohler <ivan@freeside.biz> | 2013-01-19 17:05:43 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2013-01-19 17:05:43 -0800 |
commit | dc45b8bd747e8e61b4318f0b3c7be7a8be739aa9 (patch) | |
tree | 803ffd631a85815eaecf129e10d9812d8038e19d /rt | |
parent | 4c775d58b5dbb4fae05f303a612c781eaaf3a56f (diff) |
set Sender: like From: to avoid Outlook drain bramage, RT#20825
Diffstat (limited to 'rt')
-rwxr-xr-x | rt/lib/RT/Action/SendEmail.pm | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/rt/lib/RT/Action/SendEmail.pm b/rt/lib/RT/Action/SendEmail.pm index 2a7a2e3c0..1e6607eb4 100755 --- a/rt/lib/RT/Action/SendEmail.pm +++ b/rt/lib/RT/Action/SendEmail.pm @@ -871,21 +871,25 @@ sub SetFrom { my $self = shift; my %args = @_; + my $from = $args{From}; + if ( RT->Config->Get('UseFriendlyFromLine') ) { my $friendly_name = $self->GetFriendlyName(%args); - $self->SetHeader( - 'From', + $from = sprintf( RT->Config->Get('FriendlyFromLineFormat'), $self->MIMEEncodeString( $friendly_name, RT->Config->Get('EmailOutputEncoding') ), $args{From} - ), - ); - } else { - $self->SetHeader( 'From', $args{From} ); + ); } + + $self->SetHeader( 'From', $from ); + + #also set Sender:, otherwise MTAs add a nonsensical value like rt@machine, + #and then Outlook prepends "rt@machine on behalf of" to the From: header + $self->SetHeader( 'Sender', $from ); } =head2 GetFriendlyName |