From: Dave Miller Date: Thu, 16 Dec 2021 23:45:25 +0000 (-0500) Subject: Bug 1657496: correctly handle MIME type on single-part email. r=eseyman, a=justdave X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f4afbd8dd029554fdc075d24c659e9be5d1ebb8;p=thirdparty%2Fbugzilla.git Bug 1657496: correctly handle MIME type on single-part email. r=eseyman, a=justdave --- diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm index 18795d7354..2075a71e12 100644 --- a/Bugzilla/BugMail.pm +++ b/Bugzilla/BugMail.pm @@ -495,10 +495,10 @@ sub _generate_bugmail { } my $email = Bugzilla::MIME->new($msg_header); - if (scalar(@parts) == 1) { - $email->content_type_set($parts[0]->content_type); - } - else { + + # If there's only one part, we don't need to set the overall content type + # because Email::MIME will automatically take it from that part (bug 1657496) + if (scalar(@parts) > 1) { $email->content_type_set('multipart/alternative'); # Some mail clients need same encoding for each part, even empty ones.