Skip to main content

SPF (Sender Policy Framework) and DKIM parser and checker.

Project description

emailsec

emailsec is a Python library that provides tools to parse and verify SPF (Sender Policy Framework) and DKIM (DomainKeys Identified Mail) records.

This project is still in early development.

Sender Policy Framework

RFC 7208-compliant parser and checker.

Parser

>>> from emailsec.spf.parser import parse_record
>>> parse_record("v=spf1 +a mx/30 mx:example.org/30 -all")
[A(qualifier=<Qualifier.PASS: '+'>, domain_spec=None, cidr=None),
 MX(qualifier=<Qualifier.PASS: '+'>, domain_spec=None, cidr='/30'),
 MX(qualifier=<Qualifier.PASS: '+'>, domain_spec='example.org', cidr='/30'),
 All(qualifier=<Qualifier.FAIL: '-'>)]

Checker

>>> import asyncio
>>> from emailsec.spf.checker import check_host
>>>  asyncio.run(check_host(ip="192.0.2.10", sender="hello@example.com"))
(<Result.PASS: 'pass'>, '')

Contribution

Contributions are welcome but please open an issue to start a discussion before starting something consequent.

License

Copyright (c) 2025 Thomas Sileo and contributors. Released under the MIT license.

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

emailsec-0.1.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

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

emailsec-0.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file emailsec-0.1.0.tar.gz.

File metadata

  • Download URL: emailsec-0.1.0.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.2

File hashes

Hashes for emailsec-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d047d7cc08273227c88c003c321fd9a14d75fee3e664e9ed57ce8edeff402dfb
MD5 c6264e35e520347e6356703fd3ddc351
BLAKE2b-256 3292ab1eb60580252838d137179b7c49b67840a568b628f87a75b378c7e4b5b3

See more details on using hashes here.

File details

Details for the file emailsec-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: emailsec-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.2

File hashes

Hashes for emailsec-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 95a8cfeac1a4a0bbfb8dbdcc4839bc0d744f41dc255954af55300bde9a8ad108
MD5 82fa0c2736b085a5ba7c1cf04ec5fc8a
BLAKE2b-256 9328e8c7dc5f4d5598b6182963d9c95b0855eebf979544e7db095966dc7d863a

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