diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-05-03 12:08:31 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-05-03 12:08:31 +0000 |
| commit | 21a2ca6a2121bc96edef4212f7ce79e8bb0a8062 (patch) | |
| tree | ec03062783bd5502c77a3baaba7d234e2dfd9006 | |
| parent | befbd82d85816882436f86912637cda0de332369 (diff) | |
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
| -rw-r--r-- | django/core/mail.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/django/core/mail.py b/django/core/mail.py index 4794f9d5bb..8fcf26fe03 100644 --- a/django/core/mail.py +++ b/django/core/mail.py @@ -6,12 +6,17 @@ from django.conf import settings 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): |
