From db9cc834dd06cdba84a215b05a5e72a627c044e2 Mon Sep 17 00:00:00 2001 From: Dave Miller Date: Thu, 16 Dec 2021 18:51:46 -0500 Subject: [PATCH] Bug 1657496: correctly handle MIME type on single-part email. r=cybershadow, a=justdave --- Bugzilla/BugMail.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm index b5ac2163c..81d0f28cf 100644 --- a/Bugzilla/BugMail.pm +++ b/Bugzilla/BugMail.pm @@ -538,10 +538,9 @@ sub _generate_bugmail { # For tracking/diagnostic purposes, add our hostname $email->header_set('X-Generated-By' => hostname()); - 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'); } $email->parts_set(\@parts); -- 2.47.2