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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file emailsec-0.2.0.tar.gz.
File metadata
- Download URL: emailsec-0.2.0.tar.gz
- Upload date:
- Size: 27.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a02bdd8700bee04558fd250ed6ed200687339057e794cde8d5d85d5fbe0f3cab
|
|
| MD5 |
d2de3f41a34a14794256afec0e33534b
|
|
| BLAKE2b-256 |
48214955c8fb3de9ca249979d7be03aa2b2778ee76859c1f67bbc7505a1f2293
|
File details
Details for the file emailsec-0.2.0-py3-none-any.whl.
File metadata
- Download URL: emailsec-0.2.0-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1cf71f36af483e53d93ecdda7c2619a1b602080b4a717e9908e1d5ad91d5c7c
|
|
| MD5 |
604684db00db77c2967594b3e5238ca3
|
|
| BLAKE2b-256 |
1103fec8ba1b3391607e8cbe7bbc29ac390a0c670997c5da1e4e96e039875924
|