From 22202c561487481e21456a396b1f386b402eec3c Mon Sep 17 00:00:00 2001 From: Dave Miller Date: Thu, 29 Aug 2024 06:56:57 -0400 Subject: [PATCH] Bug 1880288: Noncharacters in comments cause bugmail sending to fail --- Bugzilla/BugMail.pm | 3 +++ Bugzilla/Mailer.pm | 1 + 2 files changed, 4 insertions(+) diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm index 81d0f28cf..1ec134589 100644 --- a/Bugzilla/BugMail.pm +++ b/Bugzilla/BugMail.pm @@ -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 ); } diff --git a/Bugzilla/Mailer.pm b/Bugzilla/Mailer.pm index 4efc1becd..b778e431f 100644 --- a/Bugzilla/Mailer.pm +++ b/Bugzilla/Mailer.pm @@ -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') -- 2.47.2