DMARC service
A service for us and our customers, to help with making sure emails get through properly in spite of the efforts of Google. Yahoo etc.
SatoshiDMARC (Working Title)
A hyper-lightweight, zero-daemon, open-source DMARC aggregator, setup assistant, and reporting dashboard.
Instead of running a heavy backend server (like Node.js or Go) and a database daemon, this project uses a Cron-based Parser + Static HTML Dashboard architecture. It is designed to be extremely secure, resource-efficient, and easy to deploy on any VPS or shared host.
The Vision & Architecture
┌─────────────────────────┐
│ DMARC Report Emails │
└────────────┬────────────┘
│
▼ (IMAP Polling)
┌─────────────────────────┐
│ python parser.py (Cron)│
└────────────┬────────────┘
│
┌──────────┴──────────┐
▼ ▼
┌───────────────┐ ┌───────────────┐
│ dmarc.sqlite │ │ data.json │
│ (Local DB) │ │ (Exported API)│
└───────────────┘ └───────┬───────┘
│
▼ (Fetch / Local)
┌─────────────────────────┐
│ Static HTML/CSS/JS UI │
│ (Served by Nginx/Apache)│
└─────────────────────────┘
- No Running Daemons: No Node.js process, no Go server, no Docker container running 24/7. Just standard static files and a cron job.
- Ultra-Low Memory & CPU: Memory usage is 0MB when idle. The parser runs for a few seconds once or twice a day to fetch and process reports.
- Pure Vanilla Frontend: Built with custom Vanilla CSS and JavaScript (no React, no Tailwind, no heavy frameworks). We render everything—including the charts—using native SVGs and CSS variables. This ensures the dashboard loads instantly, is highly customizable, and will never break due to dependency updates.
- Security by Isolation: The frontend is 100% static. There are no API endpoints to exploit, no SQL injection risks on the web, and no active backend listener.
Components
1. The Parser (parser.py)
- IMAP Fetcher: Logs into a dedicated report mailbox (e.g.,
dmarc@yourdomain.com) using Python’s built-inimaplib. - Attachment Extractor: Extracts XML reports compressed in
.zipor.xml.gzformats. - XML Parser: Parses the DMARC report fields (source IP, message count, SPF/DKIM verification results, policy evaluated) using Python’s native
xml.etree.ElementTree. - Database & Export: Stores raw records in a local SQLite file (
dmarc.sqlite) for historical query support, then exports an aggregated, lightweight JSON file (data.json) for the dashboard. - DNS Checker: Performs periodic
TXTquery lookups to verify SPF, DKIM, and DMARC records for monitored domains.
2. The Dashboard (index.html, style.css, app.js)
index.html: Semantic HTML structure containing layout grids for domains and detail reports.style.css: A premium CSS stylesheet featuring a modern dark theme, glassmorphism, responsive grids, custom scrollbars, and micro-animations.app.js: Vanilla JS that fetchesdata.json, handles navigation tabs, generates search filters, and dynamically renders interactive SVG-based charts.
Roadmap & Phase 1 Scope
Phase 1: The Core Script & Local Data
- [ ] Write
parser.pyusing Python’s standard library.- IMAP receiver logic.
- XML parser for DMARC reports.
- SQLite database setup.
- [ ] Implement the DNS checker within
parser.py(querying_dmarc.domain.tld, SPF, and DKIM keys).
Phase 2: Design System & Dashboard Boilerplate
- [ ] Design the Custom CSS system (
style.css) with color tokens, typography, and buttons. - [ ] Build the UI Layout:
- Domain Checklist / Wizard: Shows current DNS configuration, validation status, and next steps to move to
p=reject. - Detail Panel: Shows parsed report statistics (volume, pass rate, failure sources).
- Domain Checklist / Wizard: Shows current DNS configuration, validation status, and next steps to move to
- [ ] Write Vanilla JS (
app.js) to parsedata.jsonand draw responsive SVG charts.
Phase 3: Packaging & Cron Setup
- [ ] Create a simple installation/deployment shell script.
- [ ] Document setting up the crontab and configuring standard Nginx/Apache to serve the folder.
Deployment Environment
cron (for scheduling the parser run)
Target Server: dr2-dmarc VPS (KVM, 1.5 GB RAM, 25 GB Disk Space)
Operating System: Debian 12 (Bookworm) (Confirmed for stability and minimal resource footprint)
Status: Under preparation by Andy
System Dependencies:
python3 (built-in on Debian)
nginx (to serve the static web files)