mirror of
https://github.com/gutmensch/docker-dmarc-report.git
synced 2025-12-17 17:56:30 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78144ee1e4 | ||
|
|
2bd4fa2677 | ||
|
|
5e95ad2e14 | ||
|
|
81cad2e81e | ||
|
|
919fe857ae | ||
|
|
b28ae804bf | ||
|
|
552f67da65 |
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 2.4 MiB After Width: | Height: | Size: 3.5 MiB |
82
README.md
82
README.md
@ -40,80 +40,30 @@ CAUTION: The old gutmensch/dmarc-report:latest image (older alpine, php5, etc.)
|
|||||||
|
|
||||||
## Sample docker compose / Environment variables
|
## Sample docker compose / Environment variables
|
||||||
|
|
||||||
The variables should be self-explanatory. Make sure to create the IMAP folders before the cron job runs!
|
Make sure to create the IMAP-Folders for processed and error reports before the cron job runs!
|
||||||
|
|
||||||
**docker-compose.yml**
|
The default foldernames are are [`error`](examples/env.example) & [`processed`](examples/env.example) but they can be changed within the [`env-file`](examples/env.example).
|
||||||
|
|
||||||
```yaml
|
Make sure to rename the [`env.example`](examples/env.example) file to `.env` and adjust the values to your needs.
|
||||||
version: "3.6"
|
|
||||||
|
|
||||||
services:
|
You can find templates for both, [`postgreql`](examples/docker-compose.postgres.yml)
|
||||||
dmarc-report:
|
and [`mysql`](examples/docker-compose.mysql.yml)
|
||||||
image: "gutmensch/dmarc-report:latest"
|
db in the [`examples`](examples) directory. Just rename the setup you want to use to `docker-compose.yml`.
|
||||||
hostname: dmarc-report
|
|
||||||
container_name: dmarc-report
|
|
||||||
depends_on:
|
|
||||||
- db
|
|
||||||
ports:
|
|
||||||
- "80:80"
|
|
||||||
environment:
|
|
||||||
- "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_USER=foobar@example.com"
|
|
||||||
- "PARSER_IMAP_PASS=foobar"
|
|
||||||
- "PARSER_IMAP_READ_FOLDER=Inbox"
|
|
||||||
- "PARSER_IMAP_MOVE_FOLDER=processed"
|
|
||||||
- "PARSER_IMAP_MOVE_FOLDER_ERR=error"
|
|
||||||
|
|
||||||
db:
|
|
||||||
image: mariadb:10
|
|
||||||
command: --skip-innodb-read-only-compressed
|
|
||||||
environment:
|
## Manual update
|
||||||
- "MYSQL_ROOT_PASSWORD=dbrootpassword"
|
|
||||||
- "MYSQL_DATABASE=dmarc_report"
|
If you are using the docker-compose file above, you can use this command to trigger an manual update. It will fetch the latest reports and parse them.
|
||||||
- "MYSQL_USER=dmarc_report"
|
|
||||||
- "MYSQL_PASSWORD=dbpassword"
|
```bash
|
||||||
volumes:
|
docker compose exec dmarc-report /usr/bin/dmarcts-report-parser.pl -i -d -r=1
|
||||||
- ./dmarc-report-db:/var/lib/mysql
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-pdbrootpassword"]
|
|
||||||
interval: 10s
|
|
||||||
timeout: 10s
|
|
||||||
retries: 5
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Optional extended configuration
|
## Optional extended configuration
|
||||||
|
|
||||||
Use SSL instead of default TLS. Set both to 0 to turn off encryption. (not recommended)
|
For further optional configuration see the docker-compose [`env-file`](examples/env.example).
|
||||||
|
|
||||||
```yaml
|
|
||||||
- "PARSER_IMAP_SSL=1"
|
|
||||||
- "PARSER_IMAP_TLS=0"
|
|
||||||
```
|
|
||||||
|
|
||||||
Ignore ERROR: message_string() issue experienced with Exchange Online.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
- "PARSER_IMAP_IGNORE_ERROR=1"
|
|
||||||
```
|
|
||||||
|
|
||||||
Parser and Viewer support Postgres now too (default is mysql)
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
- "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`.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
- "PARSER_XML_MAXSIZE=500000"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
|
|||||||
46
examples/docker-compose.mysql.yml
Normal file
46
examples/docker-compose.mysql.yml
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
services:
|
||||||
|
dmarc-report:
|
||||||
|
image: "gutmensch/dmarc-report:latest"
|
||||||
|
hostname: dmarc-report
|
||||||
|
container_name: dmarc-report
|
||||||
|
restart: always
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
|
environment:
|
||||||
|
- "REPORT_DB_HOST=${DB_HOST:-db}"
|
||||||
|
- "REPORT_DB_TYPE=${DB_TYPE:-mysql}"
|
||||||
|
- "REPORT_DB_PORT=${DB_PORT:-3306}"
|
||||||
|
- "REPORT_DB_NAME=${DB_NAME:-dmarc_report}"
|
||||||
|
- "REPORT_DB_USER=${DB_USER:-dmarc_report}"
|
||||||
|
- "REPORT_DB_PASS=${DB_PASSWORD}"
|
||||||
|
- "PARSER_IMAP_SERVER=${IMAP_SERVER}"
|
||||||
|
- "PARSER_IMAP_PORT=${IMAP_PORT:-993}"
|
||||||
|
- "PARSER_IMAP_USER=${IMAP_USER}"
|
||||||
|
- "PARSER_IMAP_PASS=${IMAP_PASSWORD}"
|
||||||
|
- "PARSER_IMAP_READ_FOLDER=${IMAP_READ_FOLDER:-Inbox}"
|
||||||
|
- "PARSER_IMAP_MOVE_FOLDER=${IMAP_MOVE_FOLDER:-processed}"
|
||||||
|
- "PARSER_IMAP_MOVE_FOLDER_ERR=${IMAP_MOVE_FOLDER_ERR:-error}"
|
||||||
|
- "PARSER_IMAP_SSL=${PARSER_IMAP_SSL}"
|
||||||
|
- "PARSER_IMAP_TLS=${PARSER_IMAP_TLS}"
|
||||||
|
- "PARSER_IMAP_IGNORE_ERROR=${PARSER_IMAP_IGNORE_ERROR}"
|
||||||
|
- "PARSER_XML_MAXSIZE=${PARSER_XML_MAXSIZE}"
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: mariadb:10
|
||||||
|
command: --skip-innodb-read-only-compressed
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
- "MYSQL_ROOT_PASSWORD=${ROOT_DB_PASSWORD}"
|
||||||
|
- "MYSQL_DATABASE=${DB_NAME:-dmarc_report}"
|
||||||
|
- "MYSQL_USER=${DB_USER:-dmarc_report}"
|
||||||
|
- "MYSQL_PASSWORD=${DB_PASSWORD}"
|
||||||
|
volumes:
|
||||||
|
- ./run/db:/var/lib/mysql
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-p${ROOT_DB_PASSWORD}"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 5
|
||||||
44
examples/docker-compose.postgres.yml
Normal file
44
examples/docker-compose.postgres.yml
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
services:
|
||||||
|
dmarc-report:
|
||||||
|
image: "gutmensch/dmarc-report:latest"
|
||||||
|
hostname: dmarc-report
|
||||||
|
container_name: dmarc-report
|
||||||
|
restart: always
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
|
environment:
|
||||||
|
- "REPORT_DB_HOST=${DB_HOST:-db}"
|
||||||
|
- "REPORT_DB_TYPE=${DB_TYPE:-pgsql}"
|
||||||
|
- "REPORT_DB_PORT=${DB_PORT:-5432}"
|
||||||
|
- "REPORT_DB_NAME=${DB_NAME:-dmarc_report}"
|
||||||
|
- "REPORT_DB_USER=${DB_USER:-dmarc_report}"
|
||||||
|
- "REPORT_DB_PASS=${DB_PASSWORD}"
|
||||||
|
- "PARSER_IMAP_SERVER=${IMAP_SERVER}"
|
||||||
|
- "PARSER_IMAP_PORT=${IMAP_PORT:-993}"
|
||||||
|
- "PARSER_IMAP_USER=${IMAP_USER}"
|
||||||
|
- "PARSER_IMAP_PASS=${IMAP_PASSWORD}"
|
||||||
|
- "PARSER_IMAP_READ_FOLDER=${IMAP_READ_FOLDER:-Inbox}"
|
||||||
|
- "PARSER_IMAP_MOVE_FOLDER=${IMAP_MOVE_FOLDER:-processed}"
|
||||||
|
- "PARSER_IMAP_MOVE_FOLDER_ERR=${IMAP_MOVE_FOLDER_ERR:-error}"
|
||||||
|
- "PARSER_IMAP_SSL=${PARSER_IMAP_SSL}"
|
||||||
|
- "PARSER_IMAP_TLS=${PARSER_IMAP_TLS}"
|
||||||
|
- "PARSER_IMAP_IGNORE_ERROR=${PARSER_IMAP_IGNORE_ERROR}"
|
||||||
|
- "PARSER_XML_MAXSIZE=${PARSER_XML_MAXSIZE}"
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: postgres:latest
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
- "POSTGRES_DB=${DB_NAME:-dmarc_report}"
|
||||||
|
- "POSTGRES_USER=${DB_USER:-dmarc_report}"
|
||||||
|
- "POSTGRES_PASSWORD=${DB_PASSWORD}"
|
||||||
|
volumes:
|
||||||
|
- ./run/db:/var/lib/postgresql/data
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U dmarc_report"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 5
|
||||||
53
examples/env.example
Normal file
53
examples/env.example
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
# database host address, leave empty for default host "db"
|
||||||
|
DB_HOST=
|
||||||
|
|
||||||
|
# the database type mysql or pgsql, leave empty for default (depending on your docker-compose.yml)
|
||||||
|
DB_TYPE=
|
||||||
|
|
||||||
|
# the database port (mysql 3306) (pqsql 5432), leave empty for default (depending on your docker-compose.yml)
|
||||||
|
DB_PORT=
|
||||||
|
|
||||||
|
# the database name, leave empty for default "dmarc_report"
|
||||||
|
DB_NAME=
|
||||||
|
|
||||||
|
# the database name, leave empty for default "dmarc_report"
|
||||||
|
DB_USER=
|
||||||
|
|
||||||
|
# mysql root password. Irrelevant if you are using postgres
|
||||||
|
ROOT_DB_PASSWORD=
|
||||||
|
|
||||||
|
# database password for the database user
|
||||||
|
DB_PASSWORD=
|
||||||
|
|
||||||
|
# the email address receiving the DMARC reports
|
||||||
|
IMAP_USER=
|
||||||
|
|
||||||
|
# the password for the email address receiving the DMARC reports
|
||||||
|
IMAP_PASSWORD=
|
||||||
|
|
||||||
|
# the server the email address is hosted on
|
||||||
|
IMAP_SERVER=
|
||||||
|
|
||||||
|
# optional: default is 993 (or 143)
|
||||||
|
IMAP_PORT=
|
||||||
|
|
||||||
|
# optional: default is "Inbox"
|
||||||
|
IMAP_READ_FOLDER=
|
||||||
|
|
||||||
|
# optional: default is "processed"
|
||||||
|
IMAP_MOVE_FOLDER=
|
||||||
|
|
||||||
|
# optional: default is "error"
|
||||||
|
IMAP_MOVE_FOLDER_ERR=
|
||||||
|
|
||||||
|
# Enable SSL and/or (START-)TLS. Set both to 0 to disable encryption (not recommended)
|
||||||
|
PARSER_IMAP_SSL=0
|
||||||
|
PARSER_IMAP_TLS=1
|
||||||
|
|
||||||
|
# Ignore ERROR: message_string() issue experienced with Exchange Online. Set to 1 to enable
|
||||||
|
PARSER_IMAP_IGNORE_ERROR=0
|
||||||
|
|
||||||
|
# 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.
|
||||||
|
PARSER_XML_MAXSIZE=50000
|
||||||
Loading…
x
Reference in New Issue
Block a user