Skip to content

Commit 22202c5

Browse files
committed
Bug 1880288: Noncharacters in comments cause bugmail sending to fail
1 parent 67d5f3c commit 22202c5

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

Bugzilla/BugMail.pm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use Bugzilla::Comment;
2020
use Bugzilla::Mailer;
2121
use Bugzilla::Hook;
2222

23+
use Encode qw();
2324
use Date::Parse;
2425
use Date::Format;
2526
use Scalar::Util qw(blessed);
@@ -521,6 +522,7 @@ sub _generate_bugmail {
521522
my @parts = (Email::MIME->create(
522523
attributes => {content_type => "text/plain",},
523524
body => $msg_text,
525+
encode_check => Encode::FB_DEFAULT
524526
));
525527
if ($user->setting('email_format') eq 'html') {
526528
$template->process("email/bugmail.html.tmpl", $vars, \$msg_html)
@@ -529,6 +531,7 @@ sub _generate_bugmail {
529531
Email::MIME->create(
530532
attributes => {content_type => "text/html",},
531533
body => $msg_html,
534+
encode_check => Encode::FB_DEFAULT
532535
);
533536
}
534537

Bugzilla/Mailer.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ sub MessageToMTA {
4848
my $dbh = Bugzilla->dbh;
4949

5050
my $email = ref $msg ? $msg : Email::MIME->new($msg);
51+
$email->encode_check_set(Encode::FB_DEFAULT);
5152

5253
# Ensure that we are not sending emails too quickly to recipients.
5354
if (Bugzilla->get_param_with_override('use_mailer_queue')

0 commit comments

Comments
 (0)