Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fixed #3472 -- Don't BASE64-encode UTF-8 (or ASCII) email messages.

Patch from

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 21a2ca6a2121bc96edef4212f7ce79e8bb0a8062 1 parent befbd82
@malcolmt malcolmt authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 django/core/
5 django/core/
@@ -6,12 +6,17 @@
from email.MIMEText import MIMEText
from email.Header import Header
from email.Utils import formatdate
+from email import Charset
import os
import smtplib
import socket
import time
import random
+# Don't BASE64-encode UTF-8 messages so that we avoid unwanted attention from
+# some spam filters.
+Charset.add_charset('utf-8', Charset.SHORTEST, Charset.QP, 'utf-8')
# Cache the hostname, but do it lazily: socket.getfqdn() can take a couple of
# seconds, which slows down the restart of the server.
class CachedDnsName(object):

0 comments on commit 21a2ca6

Please sign in to comment.
Something went wrong with that request. Please try again.