Commit Graph

909 Commits

Author SHA1 Message Date
Mike Edmunds
063fb08a58 Amazon SES: add webhook extension points; close webhook boto3 clients
In Amazon SES webhook views (tracking and inbound):
- Close boto3 clients after use. (Not strictly required, but doesn't hurt.
  Amazon SES backend was already doing this.)
- Break out some webhook functionality to simplify subclassing.
  (E.g., to handle S3 object encryption through outside tooling, as
  AWS hasn't released a Python version of their S3 encryption client.)
2024-09-09 11:34:46 -07:00
Mike Edmunds
1da9011f50 CI/CD: use Python 3.12 by default
For CI/CD tasks not testing a specific Python version, switch to Python 3.12.
(Had been using mixture of 3.10 and 3.11. GitHub's ubuntu-22.04 runner has
Python 3.10 installed by default, but 3.12 should be in the tool cache.)
2024-09-08 16:20:10 -07:00
Mike Edmunds
0e020b21e2 Docs: update tooling
- Latest Sphinx 7.4.x
  (current sphinx-rtd-theme 2.x isn't yet compatible with Sphinx 8)
- Bump Pygments
- Update Python intersphinx to link to latest Python 3
2024-09-08 16:16:51 -07:00
Mike Edmunds
2324cb48a3 Drop Python 3.7 2024-09-08 16:14:31 -07:00
Mike Edmunds
e4331d2249 Unisender Go: Fix status tracking webhook and tests.
- 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.
2024-09-08 15:27:47 -07:00
Mike Edmunds
2f2a888f61 Resend: add support for send_at
Resend's new `scheduled_at` API field allows delayed sending
(though not with attachments or batch sending).

Closes #396.
2024-09-06 11:36:40 -07:00
Mike Edmunds
af6eaea565 Docs: Note Mandrill's cc/bcc handling depends on preserve_recipients
Closes #391
2024-09-06 10:44:35 -07:00
Justin Duke
03f5fb7641 Docs: Update outdated Postal links 2024-09-06 09:55:42 -07:00
Mike Edmunds
397dcf5f8a Docs: prep for upcoming RTD build changes
Read the Docs is changing their build process. Some docs/conf.py
manipulation they used to do automatically now must be manually
included.

https://about.readthedocs.com/blog/2024/07/addons-by-default/

Related changes:

* Drop our version-alert.js. RTD's new "addons" includes
  equivalent warning on unreleased versions.

* Integrate Google Analytics via sphinxcontrib-googleanalytics
  when GOOGLE_ANALYTICS_ID is set in docs build environment.
2024-09-02 13:35:34 -07:00
Mike Edmunds
9d4fb5daf9 Docs: clarify use of Mailgun's inbound "raw MIME" option
Refs #389
2024-08-07 15:05:21 -07:00
Mike Edmunds
7779920e9b Tests: fix Python 3.13 email.utils.make_msgid mocking
Python 3.13 changes where email.utils imports socket for make_msgid.
2024-08-07 14:08:13 -07:00
Mike Edmunds
ae6d730c46 Upgrade pre-commit tools; Update black and isort to Python 3.8 profiles 2024-08-07 13:27:40 -07:00
Mike Edmunds
66c677e4ab [black reformatting] 2024-08-07 13:25:57 -07:00
Mike Edmunds
9c4cf001d0 Drop Django 3.0, 3.1, 3.2. Drop Python 3.7. 2024-08-07 12:59:47 -07:00
Mike Edmunds
6cb1a8b4e9 Release 11.1 2024-08-07 12:37:35 -07:00
Mike Edmunds
53dcc1e1b8 Docs: note inbound attachments doesn't include inlines
Closes #389
2024-08-07 12:30:09 -07:00
Mike Edmunds
13fa505257 CI/CD: Support Django 5.1 release
- Change Django 5.1 install from pre-release to release.
- Add Python 3.13 testing for Django 5.2dev
2024-08-07 12:15:51 -07:00
Luis Nell
d05f448891 Brevo: support proxy open, complained, error events
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>
2024-07-25 11:52:32 -07:00
Mike Edmunds
5e689cdc13 Postal: use larger key for webhook tests
cryptography v43.0 requires minimum 1024-bit keys
2024-07-20 13:14:06 -07:00
Mike Edmunds
e700ac9ae8 Help automated tools recognize BSD 3-Clause License
This project has always been licensed under the BSD 3-Clause license.

Certain automated tools (ahem, GitHub) have recently stoped recognizing the license text as being the BSD 3-Clause license.

This attempts to adjust the license text to match the tools' expectations. The licensing of the project HAS NOT CHANGED.
2024-07-20 12:53:49 -07:00
Mike Edmunds
136ba59ceb Release 11.0.1 2024-07-11 13:02:30 -07:00
Mike Edmunds
24031710ec CI-CD: Fix gh release target
`gh release --target` no longer accepts a full ref
(and has never allowed a tag). It needs either
a branch or a sha.
2024-07-11 12:54:03 -07:00
Mike Edmunds
f86c019e1d Docs: Amazon SES: fix IAM policy recommendations
Correct IAM action permissions required for
Amazon SES v2 API.

Fixes #384
2024-07-11 12:37:22 -07:00
Mike Edmunds
2d9ca13cbf Docs: update third-party template packages 2024-07-11 11:52:55 -07:00
Mike Edmunds
e63d9d850f Update package metadata and ESP ownership 2024-07-11 11:40:37 -07:00
Mike Edmunds
78ccd72fbe Release 11.0 2024-06-23 13:22:31 -07:00
Mike Edmunds
567fbb52ab Amazon SES: Fix header encoding problem
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
2024-06-22 16:52:45 -07:00
Mike Edmunds
c4b2e08b16 SparkPost: error on features incompatible with template_id
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.
2024-06-22 14:47:51 -07:00
Mike Edmunds
5c2f2fd35a Docs: add notes to esp-feature-matrix
Use footnotes to clarify some details
in the supported features table.

Closes #377
2024-06-22 12:58:50 -07:00
Mike Edmunds
f355bd533c Docs: new ownership for several ESPs
For ESPs that have incorporated new owners
in their branding, identify the new owner
in the docs:

- Mailgun -> Sinch Mailgun
- Postmark -> ActiveCampaign Postmark
- SendGrid -> Twilio SendGrid
- SparkPost -> Bird ???

(Bird's rebranding of SparkPost seems to still
be a work in progress at this point. In fact,
Bird's rebranding of itself from MessageBird
seems incomplete.)

There are no current plans to rename ESP
backends, as the new owners seem to be mostly
keeping the original ESP names and domains for
API endpoints, docs, etc.

(Similarly, I'm not updating project keywords.)
2024-06-22 11:09:15 -07:00
Mike Edmunds
faf98c22d7 MailerSend: support extra headers
MailerSend added a `"headers"` API field
(which is available to "Enterprise
accounts only").
2024-06-21 17:41:33 -07:00
Mike Edmunds
0776b12331 Feature: Implement merge_headers
Implement and document `merge_headers`
for all other ESPs that can support it. (See #371
for base and Amazon SES implementation.)

Closes #374
2024-06-20 15:31:58 -07:00
Vitaliy
6e696b8566 SendGrid: report dropped "Bounced Address" webhook events as reason "bounced"
In SendGrid tracking webhook, handle event="dropped", reason="Bounced Address" 
events as type "dropped", reject_reason "bounced" (rather than reject_reason "other").

See https://www.twilio.com/docs/sendgrid/for-developers/tracking-events/event#dropped
2024-06-20 14:42:25 -07:00
Mike Edmunds
0f2eef7300 Amazon SES: support headers with template
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
2024-06-08 13:29:09 -07:00
Mike Edmunds
1cdadda161 Amazon SES: require boto3 with sesv2 support
Since Anymail dropped SES v1 support,
require at least boto3 v1.10.17
(which added the sesv2 client).
2024-06-08 13:29:09 -07:00
Stan Triepels
e74e23247b Docs: Update links to SendGrid documentation
Twilio migrated SendGrid docs to a new domain.
Old links 404 now.
2024-05-22 15:30:06 -07:00
Mike Edmunds
d6c108c027 Tests: test with Django 5.1 prerelease 2024-05-22 11:16:01 -07:00
Rodrigo Nicolas Carreras
33f680686b Add merge_headers option for Amazon SES
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>
2024-05-21 11:55:29 -07:00
Mike Edmunds
4c62f7bee0 Tests: fix broken inbound test
Django SafeMIMEText corner case
behaves differently in Python
3.11.9+, 3.12.3+, likely due to
https://github.com/python/cpython/pull/116125
2024-05-16 11:39:48 -07:00
Mike Edmunds
daef82c158 Amazon SES: improve missing client error 2024-05-16 11:37:19 -07:00
Mike Edmunds
25980d8a74 Upgrade flake8
Bump flake8 version to avoid
checking punctuation inside
strings under Python 3.12.
2024-05-16 11:36:57 -07:00
Dustin Wyatt
dc1ddfa739 Docs: Fix inbound headers example
Inbound example incorrectly used `EmailMessage.getall`; should be `get_all`.  https://docs.python.org/3.12/library/email.message.html#email.message.EmailMessage.get_all
2024-04-18 11:19:07 -07:00
Patrick Hintermayer
bf257ec3f2 docs(brevo): fix minor typo 2024-03-13 11:05:55 -07:00
Mike Edmunds
24b65e0f74 CI/CD: upgrade workflow dependencies 2024-03-12 13:52:57 -07:00
Mike Edmunds
abb984485b Amazon SES: remove deprecated v1 support
- Remove deprecated amazon_sesv1 EmailBackend
- Remove deprecated amazon_sesv2 alias
  for amazon_ses EmailBackend
- Update docs
2024-03-12 13:38:45 -07:00
Mike Edmunds
1b78912b20 CD: fix release workflow permissions
(Note: v10.3 *was* released successfully,
but the workflow failed to update
the GitHub Releases page at the end
due to token permission problems.)
2024-03-12 12:22:43 -07:00
Mike Edmunds
fc1bd1497f Release 10.3 2024-03-12 11:46:20 -07:00
Mike Edmunds
948ab2be27 Brevo: SendinBlue compatibility
(See previous commit.)

- Maintain deprecated compatibility
  versions on the old names/URLs.
  (Split into separate commit
  to make renamed files more
  obvious.)
2024-03-11 18:51:39 -07:00
Mike Edmunds
c7ee59c3ca Brevo: Rename SendinBlue to Brevo
- 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.
2024-03-11 18:46:52 -07:00
Mike Edmunds
14d451659e Unisender Go: fix integration test
test+bcc2@... is a sink address;
bcc2@... is not (and gets rejected)
2024-03-06 17:10:36 -08:00