]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1880288: Noncharacters in comments cause bugmail sending to fail
authorDave Miller <justdave@bugzilla.org>
Thu, 29 Aug 2024 10:56:57 +0000 (06:56 -0400)
committerDave Miller <justdave@bugzilla.org>
Thu, 29 Aug 2024 10:56:57 +0000 (06:56 -0400)
Bugzilla/BugMail.pm
Bugzilla/Mailer.pm

index 81d0f28cf7eb502599acc60d45055b834af52738..1ec134589ed8bed3394b80fd73bbb79a2c6eb48d 100644 (file)
@@ -20,6 +20,7 @@ use Bugzilla::Comment;
 use Bugzilla::Mailer;
 use Bugzilla::Hook;
 
+use Encode qw();
 use Date::Parse;
 use Date::Format;
 use Scalar::Util qw(blessed);
@@ -521,6 +522,7 @@ sub _generate_bugmail {
   my @parts = (Email::MIME->create(
     attributes => {content_type => "text/plain",},
     body       => $msg_text,
+    encode_check => Encode::FB_DEFAULT
   ));
   if ($user->setting('email_format') eq 'html') {
     $template->process("email/bugmail.html.tmpl", $vars, \$msg_html)
@@ -529,6 +531,7 @@ sub _generate_bugmail {
       Email::MIME->create(
       attributes => {content_type => "text/html",},
       body       => $msg_html,
+      encode_check => Encode::FB_DEFAULT
       );
   }
 
index 4efc1becdc5a6557e6e5359029fefec9adcaf19d..b778e431f87a494d54c20702ea5e3f55dbb1354d 100644 (file)
@@ -48,6 +48,7 @@ sub MessageToMTA {
   my $dbh = Bugzilla->dbh;
 
   my $email = ref $msg ? $msg : Email::MIME->new($msg);
+  $email->encode_check_set(Encode::FB_DEFAULT);
 
   # Ensure that we are not sending emails too quickly to recipients.
   if (Bugzilla->get_param_with_override('use_mailer_queue')