Skip to content
This repository has been archived by the owner on Dec 9, 2022. It is now read-only.

The text/plain version of email alert has bad encoding marker #49

Open
bachradsusi opened this issue Mar 1, 2017 · 0 comments
Open

Comments

@bachradsusi
Copy link
Member

Reported by goeran at https://fedorahosted.org/setroubleshoot/ticket/9

An alert email contains both a plain text version and an HTML version of the alert. Since these messages are localized, they may contain non-ASCII characters. The HTML part is correctly marked as being UTF-8-encoded, but the plain text part is not. It defaults to us-ascii.

I took a look in the code, and it seems that this simple fix would solve the problem:

--- email_alert.py~     2008-02-21 21:19:02.000000000 +0100
+++ email_alert.py      2008-06-14 10:24:20.000000000 +0200
@@ -70,7 +70,7 @@
     email_msg['To']      = ', '.join(to_addrs)
     email_msg['Date']    = formatdate()
 
-    email_msg.attach(MIMEText(text))
+    email_msg.attach(MIMEText(text, 'plain', 'utf-8'))
     email_msg.attach(MIMEText(html, 'html', 'utf-8'))
 
     try:
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant