summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorPhilippe M. Chiasson <gozer@mozilla.com>2015-11-18 21:08:23 +0100
committerDavid Lawrence <dkl@mozilla.com>2015-11-18 21:08:23 +0100
commit36652801f98aacde4e6893a75a7ddeb9c6741782 (patch)
treedcc5738d7e5ae1f1707fbe7e46845280d554bd8e /Bugzilla
parent0f131638d9ce2f9f71a2a2f31ac01cd1c2513a7f (diff)
downloadbugzilla-36652801f98aacde4e6893a75a7ddeb9c6741782.tar.gz
bugzilla-36652801f98aacde4e6893a75a7ddeb9c6741782.tar.xz
Bug 1225844 - remove the CRLF Email::MIME workaround when >= 1.911 is installed
Diffstat (limited to 'Bugzilla')
-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);
}