* refactor: derive `AnymailInboundMessage` from `email.message.EmailMessage`
rather than legacy Python 2.7 `email.message.Message`
* feat(inbound): replace confusing `inline_attachments` with `content_id_map`
and `inlines`; rename `is_inline_attachment` to `is_inline`; deprecate old names
Closes#328
---------
Co-authored-by: Mike Edmunds <medmunds@gmail.com>
* Update docs to (usually) refer to Brevo rather than Sendinblue
* Change SENDINBLUE_API_URL to api.brevo.com
(same API is available on both domains)
* Leave code references (settings, backend name, webhook urls)
unchanged as `sendinblue`, to avoid unnecessary client changes
- Support Postmark's RawEmail option;
recommend it in docs
- Handle Bcc when provided by Postmark
- Obtain `envelope_sender` from Return-Path info
Postmark now adds, rather than parsing Received-SPF
Related:
- Add `AnymailInboundMessage.bcc` convenience prop
- Test against full Postmark "check" inbound payloads
(which don't match their docs or real inbound payloads)
- Don't warn about receiving "check" payload
- Rename `anymail.backends.amazon_sesv2.EmailBackend`
to `amazon_ses`, making SES v2 the default.
- Rename the old `amazon_ses` backend to `amazon_sesv1`,
keeping it available. Add a deprecation warning.
- Alias `amazon_sesv2` to `amazon_ses`, with a
deprecation warning (for projects that opted
into v2 early under Anymail 9.1 or 9.2).
- Similar renaming on the test files.
- Update docs to assume v2 in most places
(other than migration-specific sections)
Switch to pyproject.toml packaging, using hatchling.
- Replace all uses of setup.py with updated equivalent
- BREAKING: Change extra name `amazon_ses` to
`amazon-ses`, to comply with Python packaging
name normalization
- Use hatch custom build hook to freeze version number
in readme (previously custom setup.py code)
- Move separate requirements for dev, docs, tests
into their own requirements.txt files
- Fix AnymailImproperlyInstalled to correctly refer
to package extra name
- Update testing documentation
- Update docs readme rendering to match PyPI
(and avoid setup.py)
- In tox tests, use isolated builds and update pip
- Remove AUTHORS.txt (it just referred to GitHub)
Fix AnymailInboundMessage.to, .cc, .from_email when
message was built with AnymailInboundMessage.construct
using empty strings for those params. (Postmark inbound
relies on this.)
Fixes#307
Postmark's "test" button in their inbound settings
posts data with attachments that don't match their docs or
actual inbound behavior. Accept that and issue a warning.
Closes#304
Work around recent (unannounced) Sendinblue API change
that caused "Invalid headers" API error with non-string
custom header values, by converting basic numeric types
to strings. (Borrowed code from SendGrid backend.)
Fixes#288
Workaround for Django multipart/form-data limitation
where certain attachment filenames cause fields to be dropped
or to end up in request.POST rather than request.FILES.
Handle the MultiValueDictKeyError in inbound webhooks when
this has occurred. Also update docs to recommend avoiding
the problem by using Mailgun and SendGrid's "raw MIME" options.
Also handle reported cases of empty, duplicate keys in Mailgun's
content-id-map.
Fixes#272
Remove `AnymailError.describe_send`, which added sender and
recipient email addresses to every AnymailError message
(whether or not relevant to the error).
Addresses #245
Improve handling of alternative parts and `content_subtype`
to match how Django's SMTP backend handles some unusual cases.
Change Test backend to support (and record) text/* alternative
parts. (But still reject other types of alternatives.)
Fixes#252
Postmark uses their ErrorCode 300 to report several different
send-time validation errors, some of which identify invalid
recipients that need to be handled specially, but many of which
are ordinary API errors.
Rework the logic for parsing ErrorCode 300 error messages:
Handle only "Invalid 'To'" or "Error parsing 'To'" (or 'Cc'
or 'Bcc') as recipient errors. Otherwise raise an API error.
Fixes#238 silent failure when sending with long metadata keys.
Allow inbound and tracking webhooks using SNS topics from any AWS region.
The topic subscription must be confirmed in the topic's own region (not
the boto3 default), determined by examing the topic's ARN.
Fixes#235
* Omit default_app_config under Django 3.2 and later
to avoid DeprecationWarning
* Also adds testing on Python 3.9, 3.10-alpha
* Also updates test matrix to include all supported
Python versions (some older Django versions expanded
Python support in patch releases)
Catch invalid message_id and status when initializing
AnymailRecipientStatus, so problems with ESP response
are caught earlier (in individual backend
parse_recipient_status, rather than base backend _send).
SparkPost's API no longer allows this, and now returns
a confusing error message about return_path.
(Not treating as a breaking change in Anymail, because
the breaking change was in the SparkPost API. This just
improves the error message in the unlikely event anyone
is trying to use this feature.)
Closes#212