skillfed

authheaders

A library wrapping email authentication header verification and generation.

authheaders v0.16.3 399.7K downloads/30d#6,946 on PyPI19
Permissive license MIT DORMANT released

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 authheaders

uv

uv add authheaders

poetry

poetry add authheaders

Installing 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

Development Status :: 4 - BetaLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Communications :: Email :: FiltersTopic :: Communications :: Email :: Mail Transport AgentsTopic :: Software Development :: Libraries :: Python ModulesTopic :: Utilities

Tags

email authentication headersDKIM SPF DMARC validationARC signingemail header generationauthentication results headeremail security headersmessage authentication
email-securitycryptographystandards-compliance

More Python Modules packages