Bug 1254982

Summary: dnf-automatic generates emails with broken charset
Product: [Fedora] Fedora Reporter: Alexander Yurtsev <ayurtsev>
Component: dnfAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: ayurtsev, jsilhan, mluscon, packaging-team-maint, pnemade, rholy, tim.lauridsen, vmukhame
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-1.1.2-4.fc23 dnf-1.1.2-4.fc22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-10-04 19:13:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alexander Yurtsev 2015-08-19 11:32:26 UTC
Description of problem:

Emails, sent by the dnf-automatic, use "us-ascii" charset (Content-Type: text/plain; charset="us-ascii"). So, if the system language is set to some non-English language, dnf-automatic emails include native characters and are displayed incorrectly.


Version-Release number of selected component (if applicable):

dnf-automatic-1.1.0-2.fc22.noarch

How reproducible:

Always

Steps to Reproduce:

Set up dnf-automatic for downloading and applying updates with reports via email. Wait for an email from dnf.

Actual results:

Unreadable characters in email client (thunderbird)

Expected results:

The email client shall display all email contents correctly, without switching encoding manually. Changing charset to utf-8 in emails should help.

Comment 1 Honza Silhan 2015-08-31 12:27:57 UTC
Thanks for the report. Post the dnf traceback, please.

Comment 2 Alexander Yurtsev 2015-09-01 06:44:09 UTC
dnf finishes normally and does not produce any traceback in this case. The only problem is that the email that is sent as a notification about applied updates is displayed incorrectly due to wrong charset.

Comment 3 Alexander Yurtsev 2015-09-11 12:39:10 UTC
The below patch fixes this issue for me:


--- /usr/lib/python2.7/site-packages/dnf/automatic/emitter.py_save	2015-09-11 15:33:35.422794834 +0300
+++ /usr/lib/python2.7/site-packages/dnf/automatic/emitter.py	2015-09-11 15:36:24.770152054 +0300
@@ -89,6 +89,9 @@
         message = dnf.pycomp.email_mime(body)
         email_from = self._conf.email_from
         email_to = self._conf.email_to
+
+        message.set_charset("utf-8")
+
         message['Subject'] = subj
         message['From'] = email_from
         message['To'] = ','.join(email_to)

Comment 4 Fedora Update System 2015-09-22 15:00:57 UTC
hawkey-0.6.1-1.fc23 dnf-plugins-core-0.1.12-2.fc23 dnf-1.1.2-2.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-16428

Comment 5 Fedora Update System 2015-09-22 15:03:02 UTC
dnf-plugins-core-0.1.12-2.fc22 hawkey-0.6.1-1.fc22 dnf-1.1.2-2.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-16429

Comment 6 Fedora Update System 2015-09-23 03:54:38 UTC
dnf-1.1.2-2.fc23, dnf-plugins-core-0.1.12-2.fc23, hawkey-0.6.1-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update dnf-plugins-core dnf hawkey'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-16428

Comment 7 Fedora Update System 2015-09-23 21:22:30 UTC
dnf-1.1.2-2.fc22, dnf-plugins-core-0.1.12-2.fc22, hawkey-0.6.1-1.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update dnf-plugins-core dnf hawkey'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-16429

Comment 8 Fedora Update System 2015-10-02 15:20:21 UTC
dnf-plugins-core-0.1.12-3.fc23 hawkey-0.6.1-2.fc23 dnf-1.1.2-4.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-38e69423f3

Comment 9 Fedora Update System 2015-10-02 15:24:29 UTC
dnf-plugins-core-0.1.12-3.fc22 hawkey-0.6.1-2.fc22 dnf-1.1.2-4.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-3528c659e4

Comment 10 Fedora Update System 2015-10-04 01:36:04 UTC
dnf-1.1.2-4.fc22, dnf-plugins-core-0.1.12-3.fc22, hawkey-0.6.1-2.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update hawkey dnf-plugins-core dnf'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-3528c659e4

Comment 11 Fedora Update System 2015-10-04 01:51:58 UTC
dnf-1.1.2-4.fc23, dnf-plugins-core-0.1.12-3.fc23, hawkey-0.6.1-2.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update hawkey dnf-plugins-core dnf'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-38e69423f3

Comment 12 Fedora Update System 2015-10-04 19:12:49 UTC
dnf-1.1.2-4.fc23, dnf-plugins-core-0.1.12-3.fc23, hawkey-0.6.1-2.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2015-10-05 21:52:19 UTC
dnf-1.1.2-4.fc22, dnf-plugins-core-0.1.12-3.fc22, hawkey-0.6.1-2.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.