diff options
Diffstat (limited to 'rt/lib/RT/Action/SendEmail.pm')
-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 |