Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #2991: Added Message-ID header to messages sent from Django. Th…

…anks, Graham King.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4051 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 6f164ad4856a1a5431b3b3e19ab6dbafe692a52d 1 parent b1b4e8e
Jacob Kaplan-Moss jacobian authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 django/core/mail.py
4 django/core/mail.py
View
@@ -4,6 +4,9 @@
from email.MIMEText import MIMEText
from email.Header import Header
import smtplib, rfc822
+import socket
+import time
+import random
class BadHeaderError(ValueError):
pass
@@ -50,6 +53,7 @@ def send_mass_mail(datatuple, fail_silently=False, auth_user=settings.EMAIL_HOST
msg['From'] = from_email
msg['To'] = ', '.join(recipient_list)
msg['Date'] = rfc822.formatdate()
+ msg['Message-ID'] = "<%d.%d@%s>" % ( time.time(), random.getrandbits(64), socket.getfqdn() )
try:
server.sendmail(from_email, recipient_list, msg.as_string())
num_sent += 1
Please sign in to comment.
Something went wrong with that request. Please try again.