Bug 1254982 - dnf-automatic generates emails with broken charset
Summary: dnf-automatic generates emails with broken charset
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-19 11:32 UTC by Alexander
Modified: 2015-10-05 21:53 UTC (History)
8 users (show)

Fixed In Version: dnf-1.1.2-4.fc23 dnf-1.1.2-4.fc22
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-10-04 19:13:41 UTC


Attachments (Terms of Use)

Description Alexander 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 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 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.


Note You need to log in before you can comment on or make changes to this bug.