Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

Patch from smurf@smurf.noris.de.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5143 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 21a2ca6a2121bc96edef4212f7ce79e8bb0a8062 1 parent befbd82
Malcolm Tredinnick authored

Showing 1 changed file with 5 additions and 0 deletions. Show diff stats Hide diff stats

  1. 5  django/core/mail.py
5  django/core/mail.py
@@ -6,12 +6,17 @@
6 6
 from email.MIMEText import MIMEText
7 7
 from email.Header import Header
8 8
 from email.Utils import formatdate
  9
+from email import Charset
9 10
 import os
10 11
 import smtplib
11 12
 import socket
12 13
 import time
13 14
 import random
14 15
 
  16
+# Don't BASE64-encode UTF-8 messages so that we avoid unwanted attention from
  17
+# some spam filters.
  18
+Charset.add_charset('utf-8', Charset.SHORTEST, Charset.QP, 'utf-8')
  19
+
15 20
 # Cache the hostname, but do it lazily: socket.getfqdn() can take a couple of
16 21
 # seconds, which slows down the restart of the server.
17 22
 class CachedDnsName(object):

0 notes on commit 21a2ca6

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