From 60299ec5c0edac882d5552be61e4602e71447af8 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Wed, 6 Apr 2016 01:53:02 +0200 Subject: Bug 1246228 - Email addresses must not be encoded r=dkl --- Bugzilla/MIME.pm | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'Bugzilla/MIME.pm') diff --git a/Bugzilla/MIME.pm b/Bugzilla/MIME.pm index 0916133a0..baeaa2ac2 100644 --- a/Bugzilla/MIME.pm +++ b/Bugzilla/MIME.pm @@ -12,8 +12,6 @@ use warnings; use 5.14.0; use parent qw(Email::MIME); -use Encode qw(encode); - sub new { my ($class, $msg) = @_; @@ -78,17 +76,9 @@ sub as_string { # Encode the headers correctly in quoted-printable foreach my $header ($self->header_names) { my @values = $self->header($header); - # We don't recode headers that happen multiple times. - next if scalar(@values) > 1; - if (my $value = $values[0]) { - utf8::decode($value) unless utf8::is_utf8($value); - - # avoid excessive line wrapping done by Encode. - local $Encode::Encoding{'MIME-Q'}->{'bpl'} = 998; + map { utf8::decode($_) if defined($_) && !utf8::is_utf8($_) } @values; - my $encoded = encode('MIME-Q', $value); - $self->header_set($header, $encoded); - } + $self->header_str_set($header, @values); } # Ensure the character-set and encoding is set correctly on single part -- cgit v1.2.3-24-g4f1b