Metadata-Version: 2.1
Name: spf-validator
Version: 1.1.0
Summary: Validates Sender Policy Framework (SPF) strings to ensure they are formatted correctly.
Author-email: Frank Corso <frank@frankcorso.me>
License: MIT License
        
        Copyright (c) 2023 Frank Corso
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Repository, https://github.com/fpcorso/spf-validator
Keywords: spf,sender policy framework,email
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: dnspython==2.4.2

# 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:

```python
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:

```python
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:

```python
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.

When contributing please ensure you follow the guidelines below so that we can keep on top of things.

### Creating Issues

* If you have any bugs or feature requests for the plugin itself, please [create an issue](https://github.com/fpcorso/spf-validator/issues/new)
* For bug reports, please clearly describe the bug/issue and include steps on how to reproduce it
* For feature requests, please clearly describe what you would like and how it would be used

### Pull Requests

* Ensure you stick to the [PEP 8](https://peps.python.org/pep-0008/).
* When committing, reference your issue (if present) and include a note about the fix.

## License

This project is licensed under the MIT License. See [LICENSE](https://github.com/fpcorso/spf-validator/blob/main/LICENSE) for more details.
