Registry / auth-security / authheaders

authheaders

JSON →
library0.16.3pypypi✓ verified 80d ago

A library wrapping email authentication header verification and generation, supporting DKIM, SPF, and DMARC. Current version 0.16.3, release cadence irregular with updates every few months.

pip install authheaders
INSTALL
IMPORT
SIG · AUTHHEADERS
A
authheaders
auth-securitypythonv0.16.3
Install
4.3s avg
Import
Disk
21MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.16.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 22.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.3s · import 0.000s · 23MB
21MB installed
● package 21MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

authenticate_message
from authheaders import authenticate_message
from authheaders import authentic_headers

Generates Authentication-Results headers for a message. Requires dict of email headers and connecting IP.

from authheaders import authentic_headers # Generate authentication-results header for a single email headers = {'from': 'sender@example.com', 'to': 'recipient@example.com', 'subject': 'Test'} result = authentic_headers(headers, '127.0.0.1', 'example.com', spf_timeout=5, dkim_timeout=5, dmarc_timeout=5) print(result)
Debug
Known issues
deprecatedThe 'publicsuffix' package is deprecated; use 'publicsuffix2' instead. authheaders switched in 0.13.0.
fix
pip install publicsuffix2 and ensure authheaders >=0.13.0
affects: <0.13.0
breakingRemoved 'importlib_resources' dependency in 0.16.1; now uses 'importlib.resources' (Python 3.9+). May break on Python 3.7/3.8.
fix
Use Python >=3.9 or pin to authheaders==0.16.0
affects: >=0.16.1
gotchaThe 'authentic_headers' function expects headers as a dict with case-insensitive keys. Providing 'From' instead of 'from' can cause silent failures.
fix
Ensure header keys are lowercase (e.g., 'from', 'to', 'subject')
affects: all
gotchaThe library may raise 'authheaders.errors.AuthError' for various failures; catch it explicitly.
fix
from authheaders.errors import AuthError
affects: all
Upgrade
Version history
0.16.3latest on PyPI · released Jun 24, 2024
Audit
Dependencies
authresrequiredRequired for email authentication result parsing/generation
dkimpyrequiredDKIM signature verification/generation
publicsuffix2requiredPublic suffix list for DMARC org domains
dnspythonrequiredDNS lookups for SPF and DMARC
Agent activity
43 hits · last 30 days
node
36
Amazon
1
OpenAI (training)
1
Resources
authheaders — pip install authheaders · libregistry