Don't filter attachment types

Mandrill dropped filtering on attachment mimetypes, so stop enforcing this in Djrill.
Fixes #26
This commit is contained in:
medmunds
2013-02-28 17:47:47 -08:00
parent 921baab602
commit 92d413f5ae
3 changed files with 11 additions and 35 deletions

View File

@@ -233,18 +233,6 @@ class DjrillBackend(BaseEmailBackend):
if mimetype is None:
mimetype = DEFAULT_ATTACHMENT_MIME_TYPE
# Mandrill silently filters attachments with unsupported mimetypes.
# This can be confusing, so we raise an exception instead.
(main, sub) = mimetype.lower().split('/')
attachment_allowed = (
main == 'text' or main == 'image'
or (main == 'application' and sub == 'pdf'))
if not attachment_allowed:
raise NotSupportedByMandrillError(
"Invalid attachment mimetype '%s'. Mandrill only supports "
"text/*, image/*, and application/pdf attachments."
% mimetype)
try:
content_b64 = b64encode(content)
except TypeError: