https://bugzilla.redhat.com/show_bug.cgi?id=1855962

            Bug ID: 1855962
           Summary: bugzilla can't send non-html email
           Product: Fedora
           Version: 32
            Status: NEW
         Component: bugzilla
          Assignee: ita...@ispbrasil.com.br
          Reporter: sjo...@acm.org
        QA Contact: extras...@fedoraproject.org
                CC: emman...@seyman.fr, ita...@ispbrasil.com.br,
                    perl-devel@lists.fedoraproject.org
  Target Milestone: ---
    Classification: Fedora



Created attachment 1700684
  --> https://bugzilla.redhat.com/attachment.cgi?id=1700684&action=edit
the patch

Description of problem:

Since the update to packages perl-Email-MIME-1.949-1.fc31.noarch and
perl-Email-MIME-ContentType-1.024-1.fc31.noarch on Fedora 31, bugzilla can't
send non-html (simple text/plain) emails anymore.
The reason seems to be a tighter control of how the method content_type_set()
is to be used.  When sending non-html email, bugzilla uses a call
$email->content_type_set($parts[0]->content_type);
(BugMail.pm, line 499) where the given content_type contains the string
'text/plain; charset=UTF-8'.  The content_type_set method splits on the / and
wants the second part to be a correct MIME subtype.  But clearly it isn't since
it also contains a charset attribute.
The solution (what works for me) is to replace this call with two calls:
$email->content_type_set('text/plain');
$email->charset_set($use_utf8 ? 'UTF-8' : 'iso-8859-1');

Note that the code being executed is only used in case there is a single part
to be sent (i.e. not html which uses the other branch for multipart messages),
and so is definitely text/plain.

This problem occurs both in Fedora 31 and 32.

Version-Release number of selected component (if applicable):
bugzilla-5.0.6-3.fc31.noarch
perl-Email-MIME-1.949-1.fc31.noarch
perl-Email-MIME-ContentType-1.024-1.fc31.noarch


How reproducible:
100%

Steps to Reproduce:
1.configure bugzilla to send plain text emails (Administration -> Default
Parameters).
2.trigger bugzilla to send an email by e.g. adding or changing a bug.
3.

Actual results:
A page saying:
Invalid Content-Type 'subtype' parameter at Bugzilla/BugMail.pm line 499.
and no email being sent.
(during experimentation I added code to the report function to tell me the
content of this invalid subtype; it turned out to be 'plain; charset=UTF-8')

Expected results:
email being sent.

Additional info:


-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
perl-devel mailing list -- perl-devel@lists.fedoraproject.org
To unsubscribe send an email to perl-devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/perl-devel@lists.fedoraproject.org

Reply via email to