From: mkanat%bugzilla.org <> Date: Fri, 3 Oct 2008 06:47:17 +0000 (+0000) Subject: Bug 405453: Make Bugzilla encode all outgoing email header contents X-Git-Tag: bugzilla-3.2rc2~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96e13fe7b2cab110e5a73bdc829fccf5ec4fc4b5;p=thirdparty%2Fbugzilla.git Bug 405453: Make Bugzilla encode all outgoing email header contents Patch By Max Kanat-Alexander r=himorin, a=mkanat --- diff --git a/Bugzilla/Mailer.pm b/Bugzilla/Mailer.pm index 2fbdbae7a9..7b673440b0 100644 --- a/Bugzilla/Mailer.pm +++ b/Bugzilla/Mailer.pm @@ -85,8 +85,11 @@ sub MessageToMTA { $email->header_set('MIME-Version', '1.0') if !$email->header('MIME-Version'); # Encode the headers correctly in quoted-printable - foreach my $header qw(From To Cc Reply-To Sender Errors-To Subject) { - if (my $value = $email->header($header)) { + foreach my $header ($email->header_names) { + my @values = $email->header($header); + # We don't recode headers that happen multiple times. + next if scalar(@values) > 1; + if (my $value = $values[0]) { if (Bugzilla->params->{'utf8'} && !utf8::is_utf8($value)) { utf8::decode($value); }