Allow all extra message headers in send.

Mandrill has relaxed previous API restrictions on headers.
Fixes #58.
This commit is contained in:
medmunds
2014-01-25 11:58:12 -08:00
parent 6ebd5d1342
commit 1e44392b13
4 changed files with 15 additions and 30 deletions

View File

@@ -130,8 +130,7 @@ class DjrillBackend(BaseEmailBackend):
still work through Mandrill.
Raises NotSupportedByMandrillError for any standard EmailMessage
features that cannot be accurately communicated to Mandrill
(e.g., prohibited headers).
features that cannot be accurately communicated to Mandrill.
"""
sender = sanitize_address(message.from_email, message.encoding)
from_name, from_email = parseaddr(sender)
@@ -162,11 +161,6 @@ class DjrillBackend(BaseEmailBackend):
% len(message.bcc))
if message.extra_headers:
for k in message.extra_headers.keys():
if k != "Reply-To" and not k.startswith("X-"):
raise NotSupportedByMandrillError(
"Invalid message header '%s' - Mandrill "
"only allows Reply-To and X-* headers" % k)
msg_dict["headers"] = message.extra_headers
return msg_dict