Commit Graph

25 Commits

Author SHA1 Message Date
medmunds
1a6086f2b5 Security: rename WEBHOOK_AUTHORIZATION --> WEBHOOK_SECRET
This fixes a low severity security issue affecting Anymail v0.2--v1.3.

Django error reporting includes the value of your Anymail
WEBHOOK_AUTHORIZATION setting. In a properly-configured deployment,
this should not be cause for concern. But if you have somehow exposed
your Django error reports (e.g., by mis-deploying with DEBUG=True or by
sending error reports through insecure channels), anyone who gains
access to those reports could discover your webhook shared secret. An
attacker could use this to post fabricated or malicious Anymail
tracking/inbound events to your app, if you are using those Anymail
features.

The fix renames Anymail's webhook shared secret setting so that
Django's error reporting mechanism will [sanitize][0] it.

If you are using Anymail's event tracking and/or inbound webhooks, you
should upgrade to this release and change "WEBHOOK_AUTHORIZATION" to
"WEBHOOK_SECRET" in the ANYMAIL section of your settings.py. You may
also want to [rotate the shared secret][1] value, particularly if you
have ever exposed your Django error reports to untrusted individuals.

If you are only using Anymail's EmailBackends for sending email and
have not set up Anymail's webhooks, this issue does not affect you.

The old WEBHOOK_AUTHORIZATION setting is still allowed in this release,
but will issue a system-check warning when running most Django
management commands. It will be removed completely in a near-future
release, as a breaking change.

Thanks to Charlie DeTar (@yourcelf) for responsibly reporting this
security issue through private channels.

[0]: https://docs.djangoproject.com/en/stable/ref/settings/#debug
[1]: https://anymail.readthedocs.io/en/1.4/tips/securing_webhooks/#use-a-shared-authorization-secret
2018-02-08 11:38:15 -08:00
Mike Edmunds
b57eb94f64 Add inbound mail handling
Add normalized event, signal, and webhooks for inbound mail.

Closes #43
Closes #86
2018-02-02 10:38:53 -08:00
medmunds
09def30868 Add timeout to all Requests calls
Use a default timeout of 30 seconds for all requests, and add a
REQUESTS_TIMEOUT Anymail setting to override.

(I'm making a judgement call that this is not a breaking change in the
real world, and not bumping the major version. Theoretically, it could
affect you if your network somehow takes >30s to connect to your ESP,
but eventually succeeds. If so, set REQUESTS_TIMEOUT to None to restore
the earlier behavior.)

Fixes #80.
2018-01-17 14:36:50 -08:00
medmunds
516312bf00 Docs: note auth header must be passed through WSGI for webhooks
(See #69.)
2017-07-13 16:05:54 -07:00
medmunds
79288603fb Rename EmailBackends for Django consistency
* **Future breaking change:**
  Rename all Anymail backends to just `EmailBackend`,
  matching Django's naming convention.
  (E.g., switch to "anymail.backends.mailgun.EmailBackend"
  rather than "anymail.backends.mailgun.MailgunBackend".)

  The old names still work, but will issue a DeprecationWarning
  and will be removed in some future release.

  (Apologies for this change; the old naming convention was
  a holdover from Djrill, and I wanted consistency with
  other Django EmailBackends before hitting 1.0.)

Fixes #49.
2017-01-20 15:47:37 -08:00
medmunds
e78410eea4 Docs: remove references to future inbound handling
(Postponed -- see discussion or vote to reopen in #4)

[ci skip]
2016-11-01 11:46:49 -07:00
medmunds
1cced97f65 Docs: clarify INSTALLED_APPS
* Trailing comma after "anymail" (see #40)
* Note order doesn't matter
* Change tuple to list (match examples to
  Django 1.9+ project template)

[ci skip]
2016-11-01 11:36:50 -07:00
Mike Edmunds
db101bf6b9 Add SparkPost support (#20)
Implement SparkPost backend and tracking webhooks.

Closes #11.
2016-06-22 15:31:30 -07:00
Linus Schoemaker
23353de8e6 Fix syntax error in installation instructions 2016-05-09 11:34:04 +02:00
medmunds
d3f914be12 Event-tracking webhooks
Closes #3
2016-04-29 18:10:50 -07:00
medmunds
df881fdb75 Allow kwargs overrides for (nearly) all settings
* Update utils.get_anymail_setting to support
  kwargs override of django.conf.settings values
* Use the updated version everywhere
* Switch from ImproperlyConfigured to
  AnymailConfigurationError exception
  (anticipates feature_wehooks change)

Closes #12
2016-04-29 14:34:34 -07:00
medmunds
fed98b14a8 install: remove need to name [esp]
Simplify install to just `pip install django-anymail`.
(Rather than `... django-anymail[mailgun]`

All of the ESPs so far require requests, so just move
that into the base requirements. (Chances are your
Django app already needs requests for some other
reason, anyway.)

Truly unique ESP dependencies (e.g., boto for
AWS-SES) could still use the setup extra features
mechanism.
2016-03-14 13:26:06 -07:00
medmunds
b6bbdf4791 The *package* name is "django-anymail"
(not just "anymail")
2016-03-09 20:27:44 -08:00
medmunds
1e80c3ec37 Invert unsupported-features setting
Change from UNSUPPORTED_FEATURE_ERRORS
(default True) to IGNORE_UNSUPPORTED_FEATURES
(default False). Parallels IGNORE_RECIPIENT_STATUS.
2016-03-09 18:47:42 -08:00
medmunds
20c6350140 Update (almost) all the docs 2016-03-09 18:37:11 -08:00
medmunds
9971c1780f Document MANDRILL_API_URL 2015-12-02 16:10:29 -08:00
medmunds
aa46fadb48 Clean up global MANDRILL_SETTINGS
* Clean up Djrill backend __init__
* Fold MANDRILL_SUBACCOUNT into
  global_settings logic
* Add some missing override tests
* Update docs
2015-12-02 15:58:23 -08:00
medmunds
d14b87c910 Raise error for invalid/rejected recipients
Raise new MandrillRecipientsRefused exception
when Mandrill returns 'reject' or 'invalid' status
for *all* recipients of a message.

(Similar to Django's SMTP email backend raising
SMTPRecipientsRefused.)

Add setting MANDRILL_IGNORE_RECIPIENT_STATUS
to override the new exception.

Trap JSON parsing errors in Mandrill API response,
and raise MandrillAPIError for them. (Helps with #93.)

Closes #80.
Closes #81.
2015-12-01 13:26:21 -08:00
medmunds
99ac099081 Remove DjrillAdminSite
Closes #78
2015-05-14 11:00:52 -07:00
medmunds
651292fd24 Note Django DEFAULT_FROM_EMAIL in docs.
Ref https://github.com/brack3t/Djrill/issues/69#issuecomment-74062569
2015-05-13 17:58:55 -07:00
medmunds
8ab36d2cd0 Django 1.8 alpha 1 support
* Test on Python 2.7, 3.4, pypy.
* Call super.setUpClass in DjrillAdminTests.
  https://docs.djangoproject.com/en/dev/releases/1.8/#overriding-setupclass-teardownclass-in-test-cases

Also clear up some new PendingDeprecationWarnings, where
the changes can easily remain compatible back to Django 1.3:

* Remove deprecated django.conf.urls.patterns.
  (And match Django recommendations in our docs.)
  https://docs.djangoproject.com/en/dev/releases/1.8/#django-conf-urls-patterns
* Remove deprecated SimpleTestCase.urls.
  (We've already back-ported @override_settings
  for testing older Django versions.)
  https://docs.djangoproject.com/en/dev/releases/1.8/#django-test-simpletestcase-urls
2015-01-16 16:17:31 -08:00
medmunds
c6b171b671 Document Django 1.7 admin installation changes.
Closes #74.
2014-09-29 14:44:22 -07:00
medmunds
ba2302ae56 Subaccounts: Document setting; verify message option overrides global setting 2014-04-20 12:57:08 -07:00
medmunds
c3da043260 Document webhook support 2013-04-17 16:02:29 -07:00
medmunds
28538a5391 Docs: break apart the lengthy readme into organized docs
Also sphinx-ify where appropriate, and lots of general cleanup/editing.
2013-03-04 20:24:26 -08:00