#
# COPYRIGHT:
#
-# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC
# <sales@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
}
unless ( $self->TemplateObj->MIMEObj->head->get('From') ) {
+
+ my $from = $replyto;
+
if ( RT->Config->Get('UseFriendlyFromLine') ) {
my $friendly_name = $args{friendly_name};
}
$friendly_name =~ s/"/\\"/g;
- $self->SetHeader(
- 'From',
+ $from =
sprintf(
RT->Config->Get('FriendlyFromLineFormat'),
$self->MIMEEncodeString(
$friendly_name, RT->Config->Get('EmailOutputEncoding')
),
$replyto
- ),
- );
- } else {
- $self->SetHeader( 'From', $replyto );
+ );
}
+
+ $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 );
}
unless ( $self->TemplateObj->MIMEObj->head->get('Reply-To') ) {