Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

django-email-bandit is a Django email backend for hijacking email sending in a test environment.

Project description

Build Status

master:Build Status
develop:Build Status

A Django email backend for hijacking email sending in a staging/test environment. It extends the default SMTP backend to intercept outgoing emails and instead send them to a single email address that you specify. It does not intercept emails going to the site admins (as defined by the ADMINS setting) so it will not interfere with 500 error emails.

You can also configure the hijacked emails to be logged through standard Python logging. Mixin classes are provided to use the same hijack logic for any existing email backend such as django-ses.

Requirements

  • Python 2.7 or 3.5+
  • Django >= 1.8 (supported versions)

Installation

To install django-email-bandit via pip:

pip install django-email-bandit

For your test environment you should enable the backend:

EMAIL_BACKEND = 'bandit.backends.smtp.HijackSMTPBackend'

and set the email which will receive all of the emails:

BANDIT_EMAIL = 'bandit@example.com'

or even multiple addresses:

BANDIT_EMAIL = [‘bandit@example.com’, ‘accomplice@example.com’]

It’s also possible to whitelist certain email addresses and domains:

BANDIT_WHITELIST = [
    'iloveemail@example.com',  # Just this specific email address
    'example.net'   # All email addresses @example.net
]

Documentation

Full project documentation is on Read the Docs.

Questions or Issues?

If you have questions, issues or requests for improvements please let us know on Github.

Development sponsored by Caktus Consulting Group, LLC.

Release history Release notifications

This version
History Node

1.5

History Node

1.4

History Node

1.3

History Node

1.2

History Node

1.2.dev0

History Node

1.1

History Node

1.0

History Node

0.3

History Node

0.2

History Node

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
django_email_bandit-1.5-py2-none-any.whl (10.0 kB) Copy SHA256 hash SHA256 Wheel py2 Jan 11, 2018
django-email-bandit-1.5.tar.gz (7.3 kB) Copy SHA256 hash SHA256 Source None Jan 11, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page