mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 11:51:05 -05:00
Change attach_inline_image default domain from hostname to "inline".
This avoids problems with ESPs that don't distinguish *Content-ID* from attachment filename, where a local hostname ending in ".com" could cause Gmail to block messages sent with inline attachments. (Mailgun, Mailjet, Mandrill and SparkPost have APIs affected by this.) Fixes #112.
This commit is contained in:
@@ -398,9 +398,15 @@ classes.)
|
||||
`idstring` and `domain` are optional, and are passed to Python's
|
||||
:func:`~email.utils.make_msgid` to generate the :mailheader:`Content-ID`.
|
||||
Generally the defaults should be fine.
|
||||
(But be aware the default `domain` can leak your server's local hostname
|
||||
in the resulting email.)
|
||||
|
||||
.. versionchanged:: 4.0
|
||||
|
||||
If you don't supply a `domain`, Anymail will use the simple string "inline"
|
||||
rather than :func:`~email.utils.make_msgid`'s default local hostname. This
|
||||
avoids a problem with ESPs that confuse :mailheader:`Content-ID` and attachment
|
||||
filename: if your local server's hostname ends in ".com", Gmail could block
|
||||
messages with inline attachments generated by earlier Anymail versions and sent
|
||||
through these ESPs.
|
||||
|
||||
.. function:: attach_inline_image(message, content, filename=None, subtype=None, idstring="img", domain=None)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user