Commit ce3089f5 authored by mkanat%bugzilla.org's avatar mkanat%bugzilla.org

Bug 411544: Subject lines were still being improperly line-broken in emails.

Patch By Jeff Lawson <jlawson-mozilla@bovine.net> r=mkanat, a=mkanat
parent 3e29f04a
...@@ -44,6 +44,7 @@ use Bugzilla::Util; ...@@ -44,6 +44,7 @@ use Bugzilla::Util;
use Date::Format qw(time2str); use Date::Format qw(time2str);
use Encode qw(encode); use Encode qw(encode);
use Encode::MIME::Header;
use Email::Address; use Email::Address;
use Email::MIME; use Email::MIME;
# Loading this gives us encoding_set. # Loading this gives us encoding_set.
...@@ -78,9 +79,11 @@ sub MessageToMTA { ...@@ -78,9 +79,11 @@ sub MessageToMTA {
if (Bugzilla->params->{'utf8'} && !utf8::is_utf8($value)) { if (Bugzilla->params->{'utf8'} && !utf8::is_utf8($value)) {
utf8::decode($value); utf8::decode($value);
} }
# avoid excessive line wrapping done by Encode.
local $Encode::Encoding{'MIME-Q'}->{'bpl'} = 998;
my $encoded = encode('MIME-Q', $value); my $encoded = encode('MIME-Q', $value);
# Encode adds unnecessary line breaks, with two spaces after each.
$encoded =~ s/\n / /g;
$email->header_set($header, $encoded); $email->header_set($header, $encoded);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment