]> 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 11:01:23 +0000 (07:01 -0400)
committerGitHub <noreply@github.com>
Thu, 29 Aug 2024 11:01:23 +0000 (07:01 -0400)
Bugzilla/MIME.pm
Bugzilla/Mailer.pm

index 33b51e1c24d5538d2117256ed5bcfb4d2798952f..dd6aeaedfbda87d99163d343378b2d10d558e251 100644 (file)
@@ -13,7 +13,7 @@ use 5.14.0;
 use parent qw(Email::MIME);
 
 sub new {
-  my ($class, $msg) = @_;
+  my ($class, $msg, $args) = @_;
 
   # Template-Toolkit trims trailing newlines, which is problematic when
   # parsing headers.
@@ -52,7 +52,7 @@ sub new {
   # you're running on. See http://perldoc.perl.org/perlport.html#Newlines
   $msg =~ s/(?:\015+)?\012/\015\012/msg;
 
-  return $class->SUPER::new($msg);
+  return $class->SUPER::new($msg, $args);
 }
 
 sub as_string {
@@ -113,7 +113,7 @@ workarounds.
 =head1 SYNOPSIS
 
   use Bugzilla::MIME;
-  my $email = Bugzilla::MIME->new($message);
+  my $email = Bugzilla::MIME->new($message, $args);
 
 =head1 DESCRIPTION
 
index 0dd9d7e45a2293af4da233b1fcf925a176c522e4..5bb2b7747f14cb6f68c500ba5f60490eb7f4509b 100644 (file)
@@ -21,6 +21,7 @@ use Bugzilla::MIME;
 use Bugzilla::User;
 use Bugzilla::Util;
 
+use Encode qw()
 use Date::Format qw(time2str);
 
 use Email::Sender::Simple qw(sendmail);
@@ -61,6 +62,7 @@ sub generate_email {
       encoding     => 'quoted-printable',
     },
     body_str => $msg_text,
+    encode_check => Encode::FB_DEFAULT
   ));
   if ($templates->{html} && $email_format eq 'html') {
     $template->process($templates->{html}, $vars, \$msg_html)
@@ -73,6 +75,7 @@ sub generate_email {
         encoding     => 'quoted-printable',
       },
       body_str => $msg_html,
+      encode_check => Encode::FB_DEFAULT
       );
   }