Skip to content


Folders and files

Last commit message
Last commit date

Latest commit


Repository files navigation

docker-dmarc-report Docker Build Docker Pulls

This image is intended to combine a dmarc report parser (see by and John Bieling) with a report viewer (see by the same people) into a runnable docker image / microservice.

It fetches dmarc report mails regularly from an IMAP server, stores them into a MySQL DB and visualizes them via Webserver/PHP module.


  1. Create a TXT DNS record for your domain, containg an IMAP postbox, e.g.
17:18 $ dig TXT +short
"v=DMARC1\; p=quarantine\; fo=1\;\;\; adkim=s\; aspf=s\;"
  1. Create a MySQL Database and a user for this service

  2. Run this docker image with below mentioned env vars

  3. Access port 80 on the container (or 443) or put it behind a reverse proxy to view reports

docker pull gutmensch/dmarc-report
docker run -e ... -ti gutmensch/dmarc-report

New dmarc reports will be fetched every 15 minutes past the hour, every hour. Therefore it can take up to one hour for the first report to be fetched.

Versions for last build latest and docker image tag 1.4

dmarcts report viewer: 2024-02-04

dmarcts report parser: 2024-02-04

CAUTION: The old gutmensch/dmarc-report:latest image (older alpine, php5, etc.) is available still as gutmensch/dmarc-report:0.5. The current latest (and 1.0) uses the latest alpine version, newer MySQL client libraries, newer OpenSSL, etc. and improves compatibilitiy with MySQL 8+.

Frontend Screenshot

DMARC Report Viewer

Sample docker compose / Environment variables

The variables should be self-explanatory. Make sure to create the IMAP folders before the cron job runs!


version: "3.6"

    image: "gutmensch/dmarc-report:latest"
    hostname: dmarc-report
    container_name: dmarc-report
      - db
      - "80:80"
      - "REPORT_DB_HOST=db"
      - "REPORT_DB_PORT=3306"
      - "REPORT_DB_NAME=dmarc_report"
      - "REPORT_DB_USER=dmarc_report"
      - "REPORT_DB_PASS=dbpassword"
      - "PARSER_IMAP_SERVER=mail"
      - "PARSER_IMAP_PORT=143"
      - ""
      - "PARSER_IMAP_PASS=foobar"
      - "PARSER_IMAP_MOVE_FOLDER=processed"

    image: mariadb:10
    command: --skip-innodb-read-only-compressed
      - "MYSQL_ROOT_PASSWORD=dbrootpassword"
      - "MYSQL_DATABASE=dmarc_report"
      - "MYSQL_USER=dmarc_report"
      - "MYSQL_PASSWORD=dbpassword"
      - ./dmarc-report-db:/var/lib/mysql
      test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-pdbrootpassword"]
      interval: 10s
      timeout: 10s
      retries: 5

Optional extended configuration

Use SSL instead of default TLS. Set both to 0 to turn off encryption. (not recommended)


Ignore ERROR: message_string() issue experienced with Exchange Online.


Parser and Viewer support Postgres now too (default is mysql)

- "REPORT_DB_TYPE=pgsql"

Increase the maximum size of the XML file. (default is 50000 bytes)
When the size exceeds the maximum, one could experience an error Uncaught ValueError: DOMDocument::loadXML(): Argument #1 ($source) must not be empty.



Stargazers over time

Stargazers over time