]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1657496: correctly handle MIME type on single-part email. r=cybershadow, a=justdave
authorDave Miller <justdave@mozilla.com>
Thu, 16 Dec 2021 23:51:46 +0000 (18:51 -0500)
committerDave Miller <justdave@mozilla.com>
Thu, 16 Dec 2021 23:51:46 +0000 (18:51 -0500)
Bugzilla/BugMail.pm

index b5ac2163ce2bc4bbd912d5b80e5db9a0f11de542..81d0f28cf7eb502599acc60d45055b834af52738 100644 (file)
@@ -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);