]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 411544: Subject lines were still being improperly line-broken in emails.
authormkanat%bugzilla.org <>
Mon, 28 Jan 2008 00:08:45 +0000 (00:08 +0000)
committermkanat%bugzilla.org <>
Mon, 28 Jan 2008 00:08:45 +0000 (00:08 +0000)
Patch By Jeff Lawson <jlawson-mozilla@bovine.net> r=mkanat, a=mkanat

Bugzilla/Mailer.pm

index 0040c855ebb779eb0d732215cbe995cb207199f2..2702b8ff160c3dbb0a71b0775a8a941234718a05 100644 (file)
@@ -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);
         }
     }