Skip to main content

DKIM signing e-mail backend for Django

Project description

https://img.shields.io/github/workflow/status/stinovlas/django-dkim/Run%20python%20tests%20and%20quality%20control/master https://img.shields.io/pypi/pyversions/django-dkim.svg https://img.shields.io/pypi/djversions/django-dkim.svg

DKIM signing is generally better left to the mailserver. However, there are situations when you are unable to configure the SMTP server you use for sending mail. If you still want to sign your messages with DKIM, you can do it manually, on the application level.

This library provides custom e-mail backends with DKIM signing for Django web framework. Singing itself is provided by dkimpy library.

Installation

You can install stable version of django-dkim from PyPi:

$ pip install django-dkim

Settings

In order to use this custom backends, you have to add a few configuration options into your Django settings.

  • EMAIL_BACKEND — dotted path to custom e-mail backend

  • DKIM_SELECTOR — string containing DKIM selector

  • DKIM_DOMAIN — string containing DKIM domain

  • DKIM_PRIVATE_KEY — string containing whole private key (including the header)

Note: This library is not Django application, so you don’t need to change your INSTALLED_APPS setting.

Example

EMAIL_BACKEND = 'django_dkim.backends.smtp.EmailBackend'
DKIM_SELECTOR = 'selector'
DKIM_DOMAIN = 'example.com'
DKIM_PRIVATE_KEY = '''-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQDQUTvs1Rqjw6Vq2/LRnI7LzycT1gM1G4ZRMdWiLFg7y4TEPwfW
r6RgR04f56L9PxM1B6gW+gTkm30dwxNbU60u7emcqu+mYCzyVBHx9a4uhI3Ts8sy
67zIIeXarmxh+V/jqmAbdRAzRzAvjs0S74di1mwCplxYvVOEsDOj7OIEDQIDAQAB
AoGAR2rSJIuaqnI0j8IAKSSHQBAw0XgZeWeKUOPI3eReC4HmbnE9eriUnf1UJ1P+
aNvq9c8+LUJh0w4LgtySEklJoaK6rqLsdQhriHRiYThctMlzoZiLuVo6MQdACHBj
5LvjQY+PSIkpdoQumQJAwngyG0Zkg+t2u57UINn+p3zBxoECQQDuaF5HBELdbu84
08UsiG+zvuGoKEjtr4EjRZ9hdgkErooO8SXbJT+ALwJ6M6awGvkxQiPYR39kgCcG
VpB744aFAkEA37Bx33DKOpbOju2IaF4nwJ/JBmz54EvFOTl2ImP9iHM2qfZo8ueg
/iOG2vifayt5FvgTN7I7rpo3oQcI1DLR6QJBANskYmyi9Rd3zjsNJfQeYZb2gZRB
m2+n4Gtcpvk+N2HvUgYUEfkTjwAztfJAIhtEYASwSCSY6/ekeLqxvVOzu8UCQQCm
F4eWF1OxiUS6j9kXVcJCnuJPKR+o0doRkX8MLh6U8KeIL/ThV+gMjCiX8r+8fb0d
tvneAzOZg90Gbgi6NznxAkAXQz0rYjnQwRjlCyS/KUG1fek/EfJBlgiDmMtYuUpq
UPPnqkzsGyB9LqzL4aoKg1LDsbVP0hSt97SYhB9TtcgO
-----END RSA PRIVATE KEY-----'''

Available e-mail backends

  • django_dkim.backends.smtp.EmailBackend — DKIM extension of Django SMTP backend

  • django_dkim.backends.console.EmailBackend — DKIM extension of Django console backend

Contributing

This project is pretty small and self-contained, but I’m willing to add features, if they are useful. If you have an idea, bugfix, or really anything, please create Issue on GitLab. Don’t create GitHub issues — the GitHub repo is only a mirror of GitLab, where real development happens.

Project details


Download files

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

Source Distribution

django-dkim-0.1.3.tar.gz (19.3 kB view details)

Uploaded Source

Built Distribution

django_dkim-0.1.3-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

Details for the file django-dkim-0.1.3.tar.gz.

File metadata

  • Download URL: django-dkim-0.1.3.tar.gz
  • Upload date:
  • Size: 19.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for django-dkim-0.1.3.tar.gz
Algorithm Hash digest
SHA256 a95df5652772b5ddc9b031ad9332152a6f69954e3a11002c9b936b022db4940a
MD5 2a3ad4d06a00863b37445e2f177d0794
BLAKE2b-256 9f23094ab7e6540e48ad0fe4388f0e83768eaf5780e72c9c521fbd7a5e60a254

See more details on using hashes here.

File details

Details for the file django_dkim-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: django_dkim-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 19.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for django_dkim-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b4db0312f12941f31011aa82d54404db4d7dce54658bca4e910baec33f8391da
MD5 d8da362e41ff85cd7655a6876c4b4652
BLAKE2b-256 68514c4bbfa825b36da0dea2cfd1de7d8229f66e73c2e3ac4279ed5051c2119d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page