From: mkanat%bugzilla.org <> Date: Mon, 28 Jan 2008 00:08:45 +0000 (+0000) Subject: Bug 411544: Subject lines were still being improperly line-broken in emails. X-Git-Tag: bugzilla-3.1.3~358 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce3089f58a6edcb4074df97d1e6133d55b04377a;p=thirdparty%2Fbugzilla.git Bug 411544: Subject lines were still being improperly line-broken in emails. Patch By Jeff Lawson r=mkanat, a=mkanat --- diff --git a/Bugzilla/Mailer.pm b/Bugzilla/Mailer.pm index 0040c855eb..2702b8ff16 100644 --- a/Bugzilla/Mailer.pm +++ b/Bugzilla/Mailer.pm @@ -44,6 +44,7 @@ use Bugzilla::Util; use Date::Format qw(time2str); use Encode qw(encode); +use Encode::MIME::Header; use Email::Address; use Email::MIME; # Loading this gives us encoding_set. @@ -78,9 +79,11 @@ sub MessageToMTA { if (Bugzilla->params->{'utf8'} && !utf8::is_utf8($value)) { utf8::decode($value); } + + # avoid excessive line wrapping done by Encode. + local $Encode::Encoding{'MIME-Q'}->{'bpl'} = 998; + 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); } }