A Python module and command line parser for SPF and DMARC records
Project description
checkdmarc is a Python module and command line parser for SPF and DMARC DNS records
Command line usage
usage: checkdmarc [-h] [-d] [-f FORMAT] [-o OUTPUT] [-n NAMESERVER [NAMESERVER ...]] [-t TIMEOUT] [-v] [-w WAIT] domain [domain ...] Validates and parses SPF amd DMARC DNS records positional arguments: domain one or ore domains, or a single path to a file containing a list of domains optional arguments: -h, --help show this help message and exit -d, --descriptions include descriptions of DMARC tags in the JSON output -f FORMAT, --format FORMAT specify JSON or CSV output format -o OUTPUT, --output OUTPUT output to a file path rather than printing to the screen -n NAMESERVER [NAMESERVER ...], --nameserver NAMESERVER [NAMESERVER ...] nameservers to query -t TIMEOUT, --timeout TIMEOUT number of seconds to wait for an answer from DNS (default 6.0) -v, --version show program's version number and exit -w WAIT, --wait WAIT number os seconds to wait between processing domains (default 0.0)
$ checkdmarc fbi.gov
{
"domain": "fbi.gov",
"mx": {
"hosts": [
{
"preference": 10,
"hostname": "mx-east.fbi.gov",
"addresses": [
"153.31.160.5"
]
}
],
"warnings": []
},
"spf": {
"record": "v=spf1 +mx ip4:153.31.0.0/16 -all",
"valid": true,
"results": {
"pass": [
{
"value": "mx-east.fbi.gov",
"mechanism": "mx"
},
{
"value": "153.31.0.0/16",
"mechanism": "ip4"
}
],
"neutral": [],
"softfail": [],
"fail": [],
"include": [],
"redirect": null,
"exp": null,
"all": "fail"
},
"warnings": []
},
"dmarc": {
"record": "v=DMARC1; p=reject; adkim=r; aspf=r; rua=mailto:dmarc-feedback@fbi.gov; ruf=mailto:dmarc-feedback@fbi.gov; pct=100",
"valid": true,
"organisational_domain": "fbi.gov",
"tags": {
"v": {
"value": "DMARC1",
"explicit": true
},
"p": {
"value": "reject",
"explicit": true
},
"adkim": {
"value": "r",
"explicit": true
},
"aspf": {
"value": "r",
"explicit": true
},
"rua": {
"value": "mailto:dmarc-feedback@fbi.gov",
"explicit": true
},
"ruf": {
"value": "mailto:dmarc-feedback@fbi.gov",
"explicit": true
},
"pct": {
"value": 100,
"explicit": true
},
"fo": {
"value": "0",
"explicit": false
},
"rf": {
"value": "afrf",
"explicit": false
},
"ri": {
"value": 86400,
"explicit": false
},
"sp": {
"value": "reject",
"explicit": false
}
},
"warnings": []
}
}
Installation
checkdmarc requires Python 3.
On Debian or Ubuntu systems, run:
$ sudo apt-get install python3-pip
Python 3 installers for Windows and macOS can be found at https://www.python.org/downloads/
To install or upgrade to the latest stable release checkdmarc on macOS or Linux, run
$ sudo pip3 -U install checkdmarc
Or, install the latest development release directly from GitHub:
$ sudo pip3 -U install git+https://github.com/domainaware/checkdmarc.git
Documentation
Bug reports
Please report bugs on the GitHub issue tracker
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file checkdmarc-1.3.2-py3-none-any.whl
.
File metadata
- Download URL: checkdmarc-1.3.2-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 104bff1e374b45ecd8aed3f59cc11f0100afa420ab982ce5b3822949a6a22ef6 |
|
MD5 | 736547dbecf4837f16eb9beede43f044 |
|
BLAKE2b-256 | 581e2c84a54dd09fb5d2d4cce0b9f4ce602e50bd94621e52e6f9187adda47b29 |