authheaders
A library wrapping email authentication header verification and generation.
What it is and what it does
authheaders is a Python library for generating and validating email authentication headers. It implements DKIM, SPF, DMARC, and ARC standards, allowing you to both verify incoming messages against these protocols and sign outgoing messages with DKIM or ARC signatures. The library packages validation results into standard Authentication-Results headers that mail systems use to communicate authentication status downstream.
The package includes an embedded Public Suffix List (PSL) for DMARC organizational boundary detection, with optional support for system-provided PSL copies or manual updates. It also supports experimental extensions like PSD DMARC (RFC 9091) and DMARCbis policy discovery, though these are opt-in. The main entry points are `authenticate_message()` for validation and `sign_message()` for generating signatures.
Use it for:
- Validate incoming email messages against SPF, DKIM, and DMARC policies and generate Authentication-Results headers for downstream processing.
- Sign outgoing messages with DKIM or ARC signatures to prove authenticity and prevent spoofing.
- Build mail filtering or security systems that need to evaluate authentication status before delivery.
- Implement DMARC policy enforcement in mail transport agents or filtering appliances.
- Debug email authentication failures by examining raw validation results and header generation.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates and validates email authentication headers (DKIM, SPF, DMARC, ARC) and packages validation results into Authentication-Results headers for email messages.
Yes, if you need email authentication header handling in Python and can tolerate dormant maintenance. The library is stable, has no known vulnerabilities, and covers the core DKIM/SPF/DMARC/ARC use cases well. However, the 781-day release lag and lack of active development mean you should verify that the embedded PSL is current for your use case and be prepared to maintain a fork if critical bugs emerge. Suitable for production systems with low-change email authentication requirements.
Install
authheaders on PyPI
pip
pip install authheadersuv
uv add authheaderspoetry
poetry add authheadersInstalling authheaders
Before you install
High install friction due to no runtime dependencies but a source distribution requiring build-time setup. Maintenance is dormant—last release was 781 days ago, though the repository remains active with a recent commit on 2024-06-24. The package has been stable since its 2017 initial release.
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions. No license-related barriers to adoption.
Quickstart
from authheaders import authenticate_message
message = """From: sender@test.com\nTo: recipient@example.com\nSubject: Test\n\nBody"""
result = authenticate_message(message, "example.com", ip='192.168.50.81', mail_from="test.com", helo="domain.of.sender.net")
print(result)
Requires Python >3.7. The package uses a Public Suffix List (PSL) embedded in the package; for current data, run `python3 setup.py pslupdate` before installation, or configure a system PSL path if available.
Verify before relying
- Whether the embedded PSL copy is kept reasonably current given the 781-day release lag
- Performance characteristics when validating large message volumes or complex DMARC policies
- Compatibility with modern email infrastructure (e.g., BIMI, report-uri handling)
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>3.7) |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | dormant — 781 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 399,655/month — #6,946 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: authheaders-0.16.3.tar.gz
Keywords: email, headers, SPF, DKIM, DMARC, ARC
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
checkdmarcValidates SPF, DMARC, BIMI, MTA-STS, and…
permissive · top 15,000 on PyPI
dkimpyImplements DKIM (DomainKeys Identified Mail)…
permissive · top 5,000 on PyPI
mailsuitemailsuite retrieves, parses, and sends emails…
permissive · top 15,000 on PyPI
parsedmarcParses DMARC, TLS-RPT, and related email…
permissive · top 15,000 on PyPI
emailsBuild and send HTML and plain-text emails with…
permissive · top 15,000 on PyPI
email-validatorValidates email address syntax and optionally…
permissive · top 1,000 on PyPI
validate_emailValidates email addresses for proper format and…
copyleft · top 15,000 on PyPI
mail-parserParses raw email messages into structured…
permissive · top 5,000 on PyPI
pyIsEmailValidates email addresses against RFC standards…
permissive · top 15,000 on PyPI
flask-talismanFlask extension that automatically sets HTTP…
permissive · top 5,000 on PyPI