2023-01-07 23:48:36 +01:00
# docker-dmarc-report  [](https://registry.hub.docker.com/u/gutmensch/dmarc-report/)
2016-12-04 19:09:27 +01:00
2018-03-31 22:42:24 +02:00
This image is intended to combine a dmarc report parser (see https://github.com/techsneeze/dmarcts-report-parser by TechSneeze.com and John Bieling) with a report viewer (see https://github.com/techsneeze/dmarcts-report-viewer/ by the same people) into a runnable docker image / microservice.
2017-02-11 15:22:31 +01:00
2018-03-31 22:42:24 +02:00
It fetches dmarc report mails regularly from an IMAP server, stores them into a MySQL DB and visualizes them via Webserver/PHP module.
## Howto
2023-01-07 23:04:11 +01:00
1. Create a \_dmarc.example.com TXT DNS record for your domain, containg an IMAP postbox, e.g.
```bash
2019-01-04 17:19:57 +01:00
17:18 $ dig TXT _dmarc.schumann.link +short
"v=DMARC1\; p=quarantine\; fo=1\; rua=mailto:dmarc@schumann .link\; ruf=mailto:dmarc@schumann .link\; adkim=s\; aspf=s\;"
```
2023-01-07 23:04:11 +01:00
1. Create a MySQL Database and a user for this service
1. Run this docker image with below mentioned env vars
1. Access port 80 on the container (or 443) or put it behind a reverse proxy to view reports
```bash
2018-03-31 19:40:29 +02:00
docker pull gutmensch/dmarc-report
2018-04-01 13:19:29 +02:00
docker run -e ... -ti gutmensch/dmarc-report
2016-12-04 19:18:45 +01:00
```
2018-03-31 21:47:10 +02:00
2020-04-13 16:50:30 +02:00
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.
2023-01-07 23:04:11 +01:00
## Versions for last build latest and docker image tag 1.4
2018-04-01 13:19:29 +02:00
2023-01-07 23:04:11 +01:00
dmarcts report viewer: 2023-01-07
dmarcts report parser: 2023-01-07
2021-07-04 13:30:09 +02:00
2022-07-28 14:36:53 -07:00
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+.
2018-03-31 21:47:10 +02:00
2020-11-22 16:50:37 +01:00
## Frontend Screenshot
2023-01-07 23:04:11 +01:00
2020-11-22 16:50:37 +01:00

2018-03-31 22:42:24 +02:00
## Sample docker compose / Environment variables
2023-01-07 23:04:11 +01:00
2020-04-13 16:50:30 +02:00
The variables should be self-explanatory. Make sure to create the IMAP folders before the cron job runs!
**docker-compose.yml**
2023-01-07 23:04:11 +01:00
2020-04-13 16:50:30 +02:00
```yaml
2023-01-07 23:04:11 +01:00
version: "3.6"
2020-04-13 16:50:30 +02:00
services:
dmarc-report:
image: "gutmensch/dmarc-report:latest"
hostname: dmarc-report
container_name: dmarc-report
depends_on:
- db
ports:
- "80:80"
environment:
- "REPORT_DB_HOST=db"
2021-07-04 13:30:09 +02:00
- "REPORT_DB_PORT=3306"
2020-04-13 16:50:30 +02:00
- "REPORT_DB_NAME=dmarc_report"
- "REPORT_DB_USER=dmarc_report"
- "REPORT_DB_PASS=dbpassword"
2020-09-06 13:55:09 +02:00
- "PARSER_IMAP_SERVER=mail"
- "PARSER_IMAP_PORT=143"
2020-04-13 16:50:30 +02:00
- "PARSER_IMAP_USER=foobar@example .com"
- "PARSER_IMAP_PASS=foobar"
- "PARSER_IMAP_READ_FOLDER=Inbox"
- "PARSER_IMAP_MOVE_FOLDER=processed"
2020-09-06 13:55:09 +02:00
- "PARSER_IMAP_MOVE_FOLDER_ERR=error"
2020-04-13 16:50:30 +02:00
db:
image: mariadb:10
2021-07-24 13:59:01 +02:00
command: --skip-innodb-read-only-compressed
2020-04-13 16:50:30 +02:00
environment:
- "MYSQL_ROOT_PASSWORD=dbrootpassword"
- "MYSQL_DATABASE=dmarc_report"
- "MYSQL_USER=dmarc_report"
- "MYSQL_PASSWORD=dbpassword"
2018-03-31 22:42:24 +02:00
```
2019-01-04 11:40:31 -08:00
## Optional extended configuration
2023-01-07 23:04:11 +01:00
2019-01-04 11:40:31 -08:00
Use SSL instead of default TLS. Set both to 0 to turn off encryption. (not recommended)
2023-01-07 23:04:11 +01:00
2020-04-13 16:50:30 +02:00
```yaml
2023-01-07 23:04:11 +01:00
- "PARSER_IMAP_SSL=1"
- "PARSER_IMAP_TLS=0"
2019-01-04 11:40:31 -08:00
```
2023-01-07 23:04:11 +01:00
2021-11-21 05:23:06 -07:00
Ignore ERROR: message_string() issue experienced with Exchange Online.
2023-01-07 23:04:11 +01:00
2021-11-21 05:23:06 -07:00
```yaml
2023-01-07 23:04:11 +01:00
- "PARSER_IMAP_IGNORE_ERROR=1"
2021-11-21 05:23:06 -07:00
```
2023-01-07 23:04:11 +01:00
2022-08-10 00:38:04 +02:00
Parser and Viewer support Postgres now too (default is mysql)
2023-01-07 23:04:11 +01:00
2022-08-10 00:38:04 +02:00
```yaml
2023-01-07 23:04:11 +01:00
- "REPORT_DB_TYPE=Pg"
2022-08-10 00:38:04 +02:00
```