Skip to main content

Parse and evaluate DMARC email authentication policy

Project description

DMARC (Domain-based Message Authentication, Reporting & Conformance)

This module allows an application to parse and evaluate email authentication policy, to application supplied TXT RR, SPF and DKIM results.

Installation

Use the package manager pip to install dmarc.

pip install dmarc

Usage

>>> import dmarc

# represent verified SPF and DKIM status
>>> aspf = dmarc.SPF(domain='news.example.com', result=dmarc.SPF_PASS)

>>> adkim = dmarc.DKIM(domain='example.com', result=dmarc.DKIM_PASS)

>>> d = dmarc.DMARC()

# parse policy TXT RR
>>> p = d.parse_record(record='v=DMARC1; p=reject;', domain='example.com')

# evaluate policy
>>> r = d.get_result(p, spf=aspf, dkim=adkim)

# check result
>>> r.result == dmarc.POLICY_PASS
True

# check disposition
>>> r.disposition == dmarc.POLICY_DIS_NONE
True

License

MIT

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

dmarc-1.0.1.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dmarc-1.0.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file dmarc-1.0.1.tar.gz.

File metadata

  • Download URL: dmarc-1.0.1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.2 pkginfo/1.4.2 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for dmarc-1.0.1.tar.gz
Algorithm Hash digest
SHA256 809860bc43f84bd0112a30280ddd2f9c691eae3580bd384fc0f87be040c72417
MD5 85f26ca5cefa46f8af9dc9757299c58a
BLAKE2b-256 df1584bd83a15b2161526730bd88c2bebdee812e14a00e26f5ff5a7a92aac68f

See more details on using hashes here.

File details

Details for the file dmarc-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: dmarc-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.2 pkginfo/1.4.2 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for dmarc-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f5d9d0502d32f84430417aeb21b90b93fcff309391142091487ebda353b4ba34
MD5 6c2393e9e544dbea4816234d96c0d3db
BLAKE2b-256 0aa09c404307f06711e73c8126df5a0d8c260e399dcf7ba6947ed023449796b5

See more details on using hashes here.

Supported by

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