summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Mailer.pm
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2008-10-03 08:42:39 +0200
committermkanat%bugzilla.org <>2008-10-03 08:42:39 +0200
commit79cd8e829cd0821368bc7163cba647b8c97fa800 (patch)
tree6ad2f670902239d4b8215d7aa7191d16d95a943d /Bugzilla/Mailer.pm
parenta43231dd4ccef2b02fa0434217b637a6d1638c97 (diff)
downloadbugzilla-79cd8e829cd0821368bc7163cba647b8c97fa800.tar.gz
bugzilla-79cd8e829cd0821368bc7163cba647b8c97fa800.tar.xz
Bug 405453: Make Bugzilla encode all outgoing email headers.
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=himorin, a=mkanat
Diffstat (limited to 'Bugzilla/Mailer.pm')
-rw-r--r--Bugzilla/Mailer.pm7
1 files changed, 5 insertions, 2 deletions
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);
}