Skip to main content

spf-validator

spf-validator is a Python package for validating Sender Policy Framework strings and records to ensure they are formatted correctly.

The validation returns a list of strings where each string, if any, is an issue with the SPF record.

Installation

Use pip to install:

pip install spf-validator

Usage

There are two main functions in the package: validate_spf_string and validate_domain_spf. Both of these will return a list of strings where each string, if any, is an issue with the SPF record.

To validate an SPF string, use validate_spf_string by passing it the string.

To use:

from spf_validator import validator

issues_list = validator.validate_spf_string('v=spf1 a mx include:_spf.google.com ~all')

To validate an SPF record on a given domain, use validate_domain_spf by passing it the domain. This will retrieve the TXT records for the domain, locate the SPF record, and validate it.

To use:

from spf_validator import validator

issues_list = validator.validate_domain_spf('google.com')

Contributing

Community made feature requests, patches, bug reports, and contributions are always welcome. This project uses Poetry for dependency management and Ruff for linting.

Please review our contributing guidelines if you decide to make a contribution.

License

This project is licensed under the MIT License. See LICENSE for more details.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spf_validator-1.4.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

spf_validator-1.4.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file spf_validator-1.4.1.tar.gz.

File metadata

  • Download URL: spf_validator-1.4.1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for spf_validator-1.4.1.tar.gz
Algorithm Hash digest
SHA256 ab1a63d40fe96fa33b64fab3c4f760575083a62fe8a89eef2d0bb8ca4f610db0
MD5 c8556827cc9881e40ada124eda2ab19a
BLAKE2b-256 5b56787cc09142f4063cf32908643cbaa0f760d55380397889a62a4a16765d97

See more details on using hashes here.

File details

Details for the file spf_validator-1.4.1-py3-none-any.whl.

File metadata

  • Download URL: spf_validator-1.4.1-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for spf_validator-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 817c9e24341ecfc28725f1cec68da083cab53a49f5715a076a4440b0f96ff18b
MD5 3270a4a9b126703ba1605380856446f4
BLAKE2b-256 08c29ba7c5a6a6391426a734b2cfccca9112a41b311d77b4de07eea37a4644c0

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.4.1 This release

2 files

1.4.0

2 files

1.3.1

2 files

1.3.0

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.0

2 files

1.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page