Bug 1254982 - dnf-automatic generates emails with broken charset
dnf-automatic generates emails with broken charset
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
22
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: packaging-team-maint
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-19 07:32 EDT by Alexander
Modified: 2015-10-05 17:53 EDT (History)
8 users (show)

See Also:
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 15:13:41 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Alexander 2015-08-19 07:32:26 EDT
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 08:27:57 EDT
Thanks for the report. Post the dnf traceback, please.
Comment 2 Alexander 2015-09-01 02:44:09 EDT
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 08:39:10 EDT
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 11:00:57 EDT
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 11:03:02 EDT
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-22 23:54:38 EDT
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 17:22:30 EDT
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 11:20:21 EDT
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 11:24:29 EDT
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-03 21:36:04 EDT
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-03 21:51:58 EDT
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 15:12:49 EDT
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 17:52:19 EDT
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.