Compare commits

..

No commits in common. "master" and "v1.4.5" have entirely different histories.

5 changed files with 82 additions and 187 deletions

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 3.5 MiB

After

Width:  |  Height:  |  Size: 2.4 MiB

View File

@ -40,30 +40,80 @@ CAUTION: The old gutmensch/dmarc-report:latest image (older alpine, php5, etc.)
## Sample docker compose / Environment variables ## Sample docker compose / Environment variables
Make sure to create the IMAP-Folders for processed and error reports before the cron job runs! The variables should be self-explanatory. Make sure to create the IMAP folders before the cron job runs!
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). **docker-compose.yml**
Make sure to rename the [`env.example`](examples/env.example) file to `.env` and adjust the values to your needs. ```yaml
version: "3.6"
You can find templates for both, [`postgreql`](examples/docker-compose.postgres.yml) services:
and [`mysql`](examples/docker-compose.mysql.yml) dmarc-report:
db in the [`examples`](examples) directory. Just rename the setup you want to use to `docker-compose.yml`. image: "gutmensch/dmarc-report:latest"
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
## Manual update environment:
- "MYSQL_ROOT_PASSWORD=dbrootpassword"
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_DATABASE=dmarc_report"
- "MYSQL_USER=dmarc_report"
```bash - "MYSQL_PASSWORD=dbpassword"
docker compose exec dmarc-report /usr/bin/dmarcts-report-parser.pl -i -d -r=1 volumes:
- ./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
For further optional configuration see the docker-compose [`env-file`](examples/env.example). Use SSL instead of default TLS. Set both to 0 to turn off encryption. (not recommended)
```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

View File

@ -1,46 +0,0 @@
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

View File

@ -1,44 +0,0 @@
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

View File

@ -1,53 +0,0 @@
# 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