Commit Graph

837 Commits

Author SHA1 Message Date
Mike Edmunds
6c5b6b76fc Mailgun (docs): Clarify API keys
Explain account-level "Mailgun API keys"
vs. domain-level "sending API keys."
2023-08-24 17:44:33 -07:00
Mike Edmunds
de44b938e9 Release 10.1 2023-07-31 10:45:38 -07:00
Mike Edmunds
05afde0651 SendGrid: support multiple reply_to
Closes #325
2023-07-27 18:37:31 -07:00
Mike Edmunds
c8a5e13c89 Brevo: add inbound support
(Also adds "responses" to test requirements,
for mocking fetches of Brevo inbound
attachments.)

Closes #322
2023-07-27 18:26:57 -07:00
Léo Martinez
0ac248254e Inbound: improve inline content handling
* 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>
2023-07-27 15:10:58 -07:00
Mike Edmunds
bc8ef9af0f Tests: update Postmark integration
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.)
2023-06-27 12:25:13 -07:00
Mike Edmunds
4f4461af4d Tests: update Mandrill integration
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.)
2023-06-27 12:23:35 -07:00
sblondon
8a72f89e8a Sendinblue: rename to Brevo
* 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
2023-06-13 13:04:52 -07:00
Mike Edmunds
099ef314e4 Release 10.0 2023-05-07 12:09:28 -07:00
Mike Edmunds
a3ad0254cf CI: Simplify test PyPI release
Allow releasing to Test PyPI by setting GitHub
environment "release" variable `PYPI_REPOSITORY_URL`
to `https://test.pypi.org/legacy/`.

Also ensure twine-upload doesn't try to prompt
for credentials, and turn off upload progress bar.
2023-05-07 11:41:24 -07:00
Mike Edmunds
744d467f70 Postmark inbound: improve inbound parsing
- 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
2023-05-06 11:40:00 -07:00
Mike Edmunds
746cf0e24e Mandrill: drop Djrill compatibility 2023-05-04 13:08:05 -07:00
Mike Edmunds
41754d9813 Amazon SES: use SES v2 API by default
- 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)
2023-05-04 12:27:55 -07:00
Mike Edmunds
2335b9cfc8 Fix ReadTheDocs build
- Docs build now requires package installed
- Update tox docs to use Python 3.11, same as RTD
2023-05-03 17:21:41 -07:00
Mike Edmunds
e8df0ec8e0 Modernize packaging
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)
2023-05-03 16:55:08 -07:00
Mike Edmunds
9fba58237d Drop support for Python 3.6 and old urllib3 2023-05-02 13:59:01 -07:00
Mike Edmunds
485766182e Release 9.2 2023-05-02 13:03:31 -07:00
Mike Edmunds
7d993ee610 Fix fail_silently when session/client creation fails
Make sure backends actually fail silently when asked
(rather than raising inaccurate errors suggesting
coding problems).

Fixes #308
2023-05-02 12:38:18 -07:00
Mike Edmunds
1ba26e1be3 Fix empty strings in AnymailInboundMessage from/to/cc
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
2023-05-02 11:42:00 -07:00
Mike Edmunds
fdac3bfe37 Import make_msgid from correct package 2023-05-02 11:26:29 -07:00
Mike Edmunds
8c31883c1a Tests: get tox py36 tests working again
tox dependency virtualenv dropped support for creating
Python 3.6 environments in a minor release. [1]

Announce deprecation of Anymail Python 3.6 support.
Until that can take effect, pin an older version of
virtualenv that still works for tox py36 testenv.

[1]: See https://github.com/pypa/virtualenv/pull/2548#issuecomment-1527278210 et seq
2023-05-02 10:23:55 -07:00
Therry van Neerven
885eb9b98a Postmark: workaround invalid "test inbound" data
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
2023-04-22 12:00:05 -07:00
Mike Edmunds
d9a80e7347 Tests: Test release version of Django 4.2 2023-04-03 12:18:34 -07:00
Mike Edmunds
c59ad9e7a1 Release 9.1 2023-03-11 11:44:02 -08:00
Mike Edmunds
62bd0669af MailerSend: add support (new ESP for Anymail)
Closes #298
2023-03-10 17:22:20 -08:00
Mike Edmunds
c58640d438 Mandrill: update integration test
Mandrill bad API key can respond either 401 or 500,
so don't bother checking exact status code. 
(Just make sure it results in a useful error.)
2023-03-09 09:56:42 -08:00
Mike Edmunds
ea446a94d3 Amazon SES: implement SES v2 API backend
* Add `anymail.backends.amazon_sesv2.EmailBackend` using SES v2 API
* Declare current SES v1 backend as "deprecated"

Closes #274
2023-02-26 14:16:46 -08:00
medmunds
67b19678d2 Tests: Django 5.0 dev requires Python 3.10+ 2023-02-08 14:41:50 -08:00
medmunds
f5f3fc86e6 Simplify url patterns
Favor `django.urls.path` over `re_path` where possible.
2023-02-08 14:23:15 -08:00
medmunds
4e3e76f997 Docs: add help link to readme 2023-02-08 13:49:39 -08:00
medmunds
b84435d7f6 CI: update job output mechanism
GH workflow changed job outputs from `echo ::set-output`
to appending to `$GITHUB_OUTPUT` file.

tox-gh-matrix 0.2.0 supports new mechanism
2023-02-08 13:15:41 -08:00
medmunds
39e822321f Docs: update readthedocs.yml config
Move deprecated python.version to build.tools.python,
use latest stable Python 3 (rather than pinning 3.7).
2023-02-08 13:15:41 -08:00
medmunds
353e793323 Docs: update absolute links to anymail.dev
Canonical hosting for docs moved from anymail.readthedocs.io
to anymail.dev in May 2022.
2023-02-08 11:25:11 -08:00
medmunds
b1f49b8870 Tests: test Django 4.2-alpha, Python 3.11, PyPy 3.9 2023-02-08 11:05:18 -08:00
medmunds
ec864f5165 Tests: simplify test_settings maintenance
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
2023-02-08 11:03:06 -08:00
medmunds
f71813f820 Fix Sendinblue integration test
Fix change apparently introduced by black?
(Unclear why this didn't cause integration test failure
when run in PR branch.)
2023-02-06 15:36:29 -08:00
medmunds
65a470996f Reformat code with automated tools
- Update blame-ignore-revs
  (fix hash: GH "rebase and merge" doesn't fast-forward)
2023-02-06 15:11:57 -08:00
medmunds
57d0695ac0 Reformat code with automated tools
- Update blame-ignore-revs
2023-02-06 15:05:24 -08:00
medmunds
b4e22c63b3 Reformat code with automated tools
Apply standardized code style
2023-02-06 15:05:24 -08:00
medmunds
40891fcb4a Apply code styles via pre-commit
- Add black and isort for Python styling
- Add doc8 for reStructuredText styling
- Add prettier for css/html/js/md/yaml styling
- Run all styling tools from pre-commit hooks
- Adjust flake8 config for compatibility with black
  (and current Django style)
- Add some other helpful pre-commit hooks
- Update editorconfig to match Django
  (with a few necessary adjustments for Anymail)
- Update `tox -e lint` to run all pre-commit hooks
- Update contributing docs
2023-02-06 15:05:24 -08:00
medmunds
52c7c11312 Release 9.0 2022-12-18 16:27:36 -08:00
medmunds
416d7d433c CI: remove workaround for broken PyPY sqlite release 2022-12-18 16:20:24 -08:00
medmunds
07f5d5f224 CI: update action dependencies
Fixes Node 12 deprecation warnings.

- actions/checkout@v2 --> v3
- actions/setup-python@v2 --> v4
- fkirc/skip-duplicate-actions@v3.4.1 --> v5.3.0
  [pinned to hash]

Also set continue-on-error true in skip_duplicate_runs job,
per recommendation in skip-duplicate-actions release notes.
2022-12-18 16:20:24 -08:00
medmunds
b86613cf15 Docs: add source repo link to main ToC
(Based on feedback from docs site.)
2022-12-18 16:20:24 -08:00
medmunds
287c2175f4 Sendinblue: Support send_at
Add support for delayed sending via
Sendinblue's public beta "scheduledAt"
parameter.

Closes #280
2022-12-18 15:53:45 -08:00
Jelte Fennema
a8cfb2e5eb Fix link to mailjet apikeys
The old link returns a 404 now
2022-12-18 12:22:43 -08:00
medmunds
d37f4ef109 Fix test workflows (again)
Pin to tox v3 for now - in one more place.
2022-12-15 16:29:27 -08:00
medmunds
e9f3444daa Fix test workflows
Pin to tox v3 for now.
(tox plugins aren't ready for tox v4 yet.)
2022-12-15 09:54:44 -08:00
medmunds
681a4afe6b Sendinblue: fix "invalid headers" error
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
2022-11-04 16:46:25 -07:00
medmunds
448e8d9d95 Tests: move integration tests to Django 4.1 2022-08-29 13:25:47 -07:00