summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/Mailer.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/Bugzilla/Mailer.pm b/Bugzilla/Mailer.pm
index 0040c855e..2702b8ff1 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);
}
}