- Fix signature checking to avoid false validation errors
on webhook payloads including `/` (including all "clicked"
and most "opened" events). And in general, avoid depending
on specific details of Unisender Go's JSON serialization.
(Fixes #398.)
- Handle "use single event" webhook option (which has a different
payload format).
- Verify basic auth when Anymail's WEBHOOK_SECRET is used.
(This is optional for Unisender Go, since payloads are signed,
but it needs to be checked when enabled.)
- Treat "soft_bounced" events as "deferred" rather than "bounced",
since they will be retried later.
- Update validation error to reference Project ID if the webhook
is configured for a specific project.
- Expose Unisender Go's delivery_status code and unsubscribe form
comment as Anymail's normalized event.description.
- Update webhook tests based on actual payloads and add several
missing tests.
- Update docs to clarify webhook use with Unisender Go projects.
Add support for Brevo's new "Complained," "Error" and
"Loaded by proxy" events in Brevo tracking webhook.
Closes#385.
---------
Co-authored-by: Mike Edmunds <medmunds@gmail.com>
A combination of long display name and
commas (or other special characters) could
result in invalid address headers.
See details in #369.
Fix by removing unnecessary email.policy
override, which was causing new header folding
code to run with headers built using Compat32
legacy header encoding. The two don't mix.
Fixes#369
Raise an `AnymailUnsupportedFeature` error
when trying to use a `template_id` along with
other content payload fields that SparkPost
silently ignores when template_id is present.
Use new SES v2 SendBulkEmail ReplacementHeaders param
to support features that require custom headers,
including `extra_headers`, `metadata`,
`merge_metadata` and `tags`.
Update integration tests and docs
Closes#375
Add new `merge_headers` message option
for per-recipient headers with template sends.
* Support in base backend
* Implement in Amazon SES backend
(Requires boto3 >= 1.34.98.)
---------
Co-authored-by: Mike Edmunds <medmunds@gmail.com>
(See previous commit.)
- Maintain deprecated compatibility
versions on the old names/URLs.
(Split into separate commit
to make renamed files more
obvious.)
- Replace "SendinBlue" with "Brevo"
throughout the code.
- Maintain deprecated compatibility
versions on the old names/URLs.
(Split into separate commit
to make renamed files more
obvious.)
- Update docs to reflect change,
provide migration advice.
- Update integration workflow.
Resend's API no longer returns 403
responses for bad API keys (or 401
for missing auth header). Now, it just
never responds, leading to a TimeoutError.
Since this seems likely to be a Resend
bug, just disable the bad API key
integration test for now.
(Resend changed behavior sometime between
2023-12-07 and 2023-12-14, from our
scheduled integration test runs.)
Replace generic `combine` with
specific `merge_dicts_deep`,
`merge_dicts_shallow`,
`merge_dicts_one_level` or
`concat_lists`, depending on
appropriate behavior for each
message attribute.
Fixes merging global `SEND_DEFAULTS`
with message `esp_extra` for ESP APIs
that use nested payload structures.
And clarifies intent for other properties.
* 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>
Postmark has changed their error message
for invalid server token. (Also, we don't
care about the specific error code, just
that the error is caught and reported.)
Mandrill has changed status code for
invalid from_email from 500 to 400.
(We don't actually care about the specific
code, just that the error is caught and
reported.)
* 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
If no version-specific tests.test_settings.settings* file
exists for the current Django version, fall back to an
earlier settings file.
- runtests.py find latest settings_N_M earlier than or
matching Django version N.M being tested, rather than
requiring exact match
- remove test_settings files that were just duplicates
of earlier versions
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