A Python Flask application that serves as a DMARC parser API. Parse a provided DMARC record and to check the current DNS DMARC record. Simple as that.
- Python: 3.9 or higher
- Docker
- Docker Compose
PYTHONUNBUFFERED=1
FLASK_ENV=development
API_KEY=your_api_key
-
Build and Run the Application
docker-compose up --build
-
Access the API
App root:
http://localhost:8080
.
-
Endpoint
POST /parse_dmarc
-
Headers
x-api-key: your_api_key Content-Type: application/json
-
Request Body
{ "dmarc_record": "v=DMARC1; p=none; rua=mailto:[email protected]" }
-
Response
{ "v": "DMARC1", "p": "none", "rua": "mailto:[email protected]" }
-
Example with
curl
curl -X POST \ -H "Content-Type: application/json" \ -H "x-api-key: your_api_key" \ -d '{"dmarc_record": "v=DMARC1; p=none; rua=mailto:[email protected]"}' \ http://localhost:8080/parse_dmarc
-
Endpoint
GET /check_dmarc/<domain>
-
Headers
x-api-key: your_api_key
-
Response
{ "v": "DMARC1", "p": "reject", "rua": "mailto:[email protected]" }
-
Example with
curl
curl -H "x-api-key: your_api_key" \ http://localhost:8080/check_dmarc/example.com
I created this API for a personal project and wanted to publish it. Feel free to fork or contribute it. But please don't expect me to maintain it on ocassion.