summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Mailer.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/Mailer.pm')
-rw-r--r--Bugzilla/Mailer.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/Bugzilla/Mailer.pm b/Bugzilla/Mailer.pm
index 556500b1a..68718eb6e 100644
--- a/Bugzilla/Mailer.pm
+++ b/Bugzilla/Mailer.pm
@@ -56,6 +56,7 @@ BEGIN {
}
use Email::Send;
use Sys::Hostname;
+use Bugzilla::Install::Util qw(vers_cmp);
sub MessageToMTA {
my ($msg, $send_now) = (@_);
@@ -75,12 +76,15 @@ sub MessageToMTA {
}
else {
# RFC 2822 requires us to have CRLF for our line endings and
- # Email::MIME doesn't do this for us. We use \015 (CR) and \012 (LF)
+ # Email::MIME doesn't do this for us until 1.911. We use \015 (CR) and \012 (LF)
# directly because Perl translates "\n" depending on what platform
# you're running on. See http://perldoc.perl.org/perlport.html#Newlines
# We check for multiple CRs because of this Template-Toolkit bug:
# https://rt.cpan.org/Ticket/Display.html?id=43345
- $msg =~ s/(?:\015+)?\012/\015\012/msg;
+ if (vers_cmp($Email::MIME::VERSION, 1.911) == -1) {
+ $msg =~ s/(?:\015+)?\012/\015\012/msg;
+ }
+
$email = new Email::MIME($msg);
}