Skip to content
This repository was archived by the owner on Dec 9, 2022. It is now read-only.
This repository was 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

Description

@bachradsusi

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions