From 79cd8e829cd0821368bc7163cba647b8c97fa800 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Fri, 3 Oct 2008 06:42:39 +0000 Subject: Bug 405453: Make Bugzilla encode all outgoing email headers. Patch by Max Kanat-Alexander r=himorin, a=mkanat --- Bugzilla/Mailer.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Bugzilla/Mailer.pm') diff --git a/Bugzilla/Mailer.pm b/Bugzilla/Mailer.pm index fc3f60784..bb0917bc1 100644 --- a/Bugzilla/Mailer.pm +++ b/Bugzilla/Mailer.pm @@ -96,8 +96,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); } -- cgit v1.2.3-24-g4f1b