HUB
Sign inSign up
dmarc-report logo

webkutir/dmarc-report

By webkutir

•Updated 13 days ago

Read DMARC aggregate reports from IMAP and show a table, chart, and problems to fix.

Image
Security
Monitoring & observability
0

235

webkutir/dmarc-report repository overview

⁠webkutir/dmarc-report

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.

⁠What it reads

  • IMAPS, default port 993. The inbox is opened read-only and messages are left in the mailbox.
  • RFC 7489 aggregate XML in .xml, .xml.gz, .gz, and .zip attachments.
  • Several mailboxes. The list is a text file you create before the container starts. See The accounts file below.
  • Reports are stored in SQLite and duplicate messages are skipped.

Set DMARC_IMAP_TLS_NAME when the certificate name differs from the IMAP hostname.

⁠What it flags

SeverityWhen
HighMail from an address in DMARC_OWN_IPS failed SPF or DKIM
MediumAnother address failed both SPF and DKIM
LowAnother address passed both checks
MediumThe report shows DMARC p=none on a failing message
LowThe report shows pct below 100

Repeated rows for the same domain and server are one card. The message count is added up.

⁠Requirements

  • A mailbox that receives the addresses in your _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.

⁠The accounts file

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.

⁠Run

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.

⁠Compose

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.

⁠Environment

VariableDefaultPurpose
DMARC_IMAP_HOSTmailserver_postfixIMAP server
DMARC_IMAP_PORT993IMAPS port
DMARC_IMAP_TLS_NAMEset thisName checked on the IMAP certificate
DMARC_OWN_IPSemptyYour mail servers' public addresses
DMARC_ACCOUNTS_FILE/run/dmarc-accountsPath of the accounts file inside the container
DMARC_DB/data/dmarc.sqliteReport database
DMARC_POLL_SECONDS900How often mailboxes are read
DMARC_UI_USERadminPage login name
DMARC_UI_PASSWORDemptyPage login password, minimum 12 characters
DMARC_LISTEN0.0.0.0:8080HTTP listen address

The page also has a Check mailboxes now button.

⁠Image

Built from python:3.13-slim. The application uses the Python standard library only.

Tag summary
Recent tags
Content type
Image
Digest
sha256:4efa597fa…
Size
41.1 MB
Last updated
13 days ago
docker pull webkutir/dmarc-report:latest