mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 03:41:05 -05:00
also consider Content-ID when marking attachment as inline (#126)
Handle MIME attachments with Content-ID as inline by default. Treat MIME attachments that have a *Content-ID* but no explicit *Content-Disposition* header as inline, matching the behavior of many email clients.
This commit is contained in:
committed by
Mike Edmunds
parent
4028eda583
commit
64f7d31d14
@@ -291,7 +291,8 @@ class Attachment(object):
|
||||
self.content = attachment.as_string().encode(self.encoding)
|
||||
self.mimetype = attachment.get_content_type()
|
||||
|
||||
if get_content_disposition(attachment) == 'inline':
|
||||
content_disposition = get_content_disposition(attachment)
|
||||
if content_disposition == 'inline' or (not content_disposition and 'Content-ID' in attachment):
|
||||
self.inline = True
|
||||
self.content_id = attachment["Content-ID"] # probably including the <...>
|
||||
if self.content_id is not None:
|
||||
|
||||
Reference in New Issue
Block a user