Read DMARC aggregate reports from IMAP and show a table, chart, and problems to fix.
235
Read DMARC aggregate reports from one or more IMAP mailboxes and show them in a private web page.
The page has a table of report rows, a 14-day pass/fail chart, and a list of problems to fix. Problems are grouped into Not fixed and Fixed. You can mark an item fixed and record the date.
The container speaks HTTP on port 8080. Put it behind your existing HTTPS reverse proxy.
Current tags: 1.0.0 and latest.
.xml, .xml.gz, .gz, and .zip attachments.Set DMARC_IMAP_TLS_NAME when the certificate name differs from the IMAP hostname.
| Severity | When |
|---|---|
| High | Mail from an address in DMARC_OWN_IPS failed SPF or DKIM |
| Medium | Another address failed both SPF and DKIM |
| Low | Another address passed both checks |
| Medium | The report shows DMARC p=none on a failing message |
| Low | The report shows pct below 100 |
Repeated rows for the same domain and server are one card. The message count is added up.
_dmarc rua tag.DMARC_UI_PASSWORD of at least 12 characters. A shorter password makes the process exit.DMARC_OWN_IPS: the public addresses of your own mail servers, separated by commas.Create a text file named dmarc-accounts on the host before you start the container. This file is not a command. Each line is one mailbox that receives DMARC reports, then a space, then that mailbox's IMAP password:
[email protected] mailbox-password
[email protected] is the address in your DMARC rua tag. mailbox-password is the password used to log in to that mailbox. A second mailbox is a second line. Blank lines are skipped. A line that starts with # is a comment.
This file is separate from the web page login. The page login is DMARC_UI_USER and DMARC_UI_PASSWORD.
The container reads the file from /run/dmarc-accounts. The docker run and Compose examples mount your file there, read-only:
-v "$PWD/dmarc-accounts:/run/dmarc-accounts:ro"
The container checks those mailboxes and leaves the messages in the inbox.
Save dmarc-accounts in the directory where you run this command, with one mailbox line as shown above.
docker run -d \
--name dmarc-report \
-p 8080:8080 \
-e DMARC_IMAP_HOST=mail.example.com \
-e DMARC_IMAP_PORT=993 \
-e DMARC_IMAP_TLS_NAME=mail.example.com \
-e DMARC_OWN_IPS=203.0.113.10 \
-e DMARC_UI_USER=admin \
-e DMARC_UI_PASSWORD=replace-with-a-long-password \
-e DMARC_ACCOUNTS_FILE=/run/dmarc-accounts \
-e DMARC_DB=/data/dmarc.sqlite \
-v dmarc_data:/data \
-v "$PWD/dmarc-accounts:/run/dmarc-accounts:ro" \
webkutir/dmarc-report:1.0.0
Open http://127.0.0.1:8080 and sign in with DMARC_UI_USER and DMARC_UI_PASSWORD.
Put dmarc-accounts next to the Compose file.
services:
dmarc-report:
image: webkutir/dmarc-report:1.0.0
environment:
DMARC_IMAP_HOST: mail.example.com
DMARC_IMAP_PORT: "993"
DMARC_IMAP_TLS_NAME: mail.example.com
DMARC_OWN_IPS: 203.0.113.10
DMARC_UI_USER: admin
DMARC_UI_PASSWORD: replace-with-a-long-password
DMARC_ACCOUNTS_FILE: /run/dmarc-accounts
DMARC_DB: /data/dmarc.sqlite
volumes:
- dmarc_data:/data
- ./dmarc-accounts:/run/dmarc-accounts:ro
ports:
- "8080:8080"
volumes:
dmarc_data:
Use a network such as 10.0.0.0/24 when the mail server is another container. Publish port 8080 only on the trusted proxy network when the page is reached through HTTPS.
| Variable | Default | Purpose |
|---|---|---|
DMARC_IMAP_HOST | mailserver_postfix | IMAP server |
DMARC_IMAP_PORT | 993 | IMAPS port |
DMARC_IMAP_TLS_NAME | set this | Name checked on the IMAP certificate |
DMARC_OWN_IPS | empty | Your mail servers' public addresses |
DMARC_ACCOUNTS_FILE | /run/dmarc-accounts | Path of the accounts file inside the container |
DMARC_DB | /data/dmarc.sqlite | Report database |
DMARC_POLL_SECONDS | 900 | How often mailboxes are read |
DMARC_UI_USER | admin | Page login name |
DMARC_UI_PASSWORD | empty | Page login password, minimum 12 characters |
DMARC_LISTEN | 0.0.0.0:8080 | HTTP listen address |
The page also has a Check mailboxes now button.
Built from python:3.13-slim. The application uses the Python standard library only.
docker pull webkutir/dmarc-report:latest