From df1f751bd58dac56c6045570a28f0a2058defdf0 Mon Sep 17 00:00:00 2001 From: Dmitriy Alekseev <1865999+dragoangel@users.noreply.github.com> Date: Tue, 8 Nov 2022 12:21:42 +0200 Subject: [PATCH 1/6] Update firststeps-dmarc_reporting.en.md --- .../firststeps-dmarc_reporting.en.md | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/docs/post_installation/firststeps-dmarc_reporting.en.md b/docs/post_installation/firststeps-dmarc_reporting.en.md index b1529d0be..5e2b672fb 100644 --- a/docs/post_installation/firststeps-dmarc_reporting.en.md +++ b/docs/post_installation/firststeps-dmarc_reporting.en.md @@ -45,8 +45,8 @@ services: - MASTER=${MASTER:-y} labels: ofelia.enabled: "true" - ofelia.job-exec.rspamd_dmarc_reporting.schedule: "@every 24h" - ofelia.job-exec.rspamd_dmarc_reporting.command: "/bin/bash -c \"[[ $${MASTER} == y ]] && /usr/bin/rspamadm dmarc_report > /var/lib/rspamd/dmarc_reports_last_log 2>&1 || exit 0\"" + ofelia.job-exec.rspamd_dmarc_reporting_yesturday.schedule: "@every 24h" + ofelia.job-exec.rspamd_dmarc_reporting_yesturday.command: "/bin/bash -c \"[[ $${MASTER} == y ]] && /usr/bin/rspamadm dmarc_report $(date --date yesterday '+%Y%m%d') > /var/lib/rspamd/dmarc_reports_last_log 2>&1 || exit 0\"" ofelia-mailcow: depends_on: - rspamd-mailcow @@ -106,13 +106,33 @@ docker compose exec redis-mailcow redis-cli ZRANGE "dmarc_rpt;microsoft.com;mail ## Change DMARC reporting frequency -In the example above reports are sent once every 24 hours. +In the example above reports are sent once every 24 hours and send reports for yesturday. This will be okay for most setups. + +If you have a large mail volume and want to run the DMARC reporting more than once a day you need create second schedule and run it with `dmarc_report $(date '+%Y%m%d')` to process the current day. You have to make sure that the first run on each day also processes the last report from the day before, so it needs to be started twice, one time with `$(date --date yesterday '+%Y%m%d')` at `@midnight` and then with `$(date '+%Y%m%d')` with interval you desire. The Ofelia schedule has the same implementation as `cron` in Go, supported syntax described at [cron Documentation](https://pkg.go.dev/github.com/robfig/cron) To change schedule: -1. Edit `docker-compose.override.yml` and a djust `ofelia.job-exec.rspamd_dmarc_reporting.schedule: "@every 24h"` to a desired value, for example to `"@midnight"` +1. Edit `docker-compose.override.yml`: + +``` +version: '2.1' + +services: + rspamd-mailcow: + environment: + - MASTER=${MASTER:-y} + labels: + ofelia.enabled: "true" + ofelia.job-exec.rspamd_dmarc_reporting_yesturday.schedule: "@midnight" + ofelia.job-exec.rspamd_dmarc_reporting_yesturday.command: "/bin/bash -c \"[[ $${MASTER} == y ]] && /usr/bin/rspamadm dmarc_report $(date --date yesterday '+%Y%m%d') > /var/lib/rspamd/dmarc_reports_last_log 2>&1 || exit 0\"" + ofelia.job-exec.rspamd_dmarc_reporting_today.schedule: "@every 12h" + ofelia.job-exec.rspamd_dmarc_reporting_today.command: "/bin/bash -c \"[[ $${MASTER} == y ]] && /usr/bin/rspamadm dmarc_report $(date '+%Y%m%d') > /var/lib/rspamd/dmarc_reports_last_log 2>&1 || exit 0\"" + ofelia-mailcow: + depends_on: + - rspamd-mailcow +``` 2. Run `docker compose up -d` From c36786057544de0597e614ae49ab0bd289fa6f40 Mon Sep 17 00:00:00 2001 From: Dmitriy Alekseev <1865999+dragoangel@users.noreply.github.com> Date: Tue, 8 Nov 2022 12:28:57 +0200 Subject: [PATCH 2/6] Update firststeps-dmarc_reporting.en.md --- docs/post_installation/firststeps-dmarc_reporting.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/post_installation/firststeps-dmarc_reporting.en.md b/docs/post_installation/firststeps-dmarc_reporting.en.md index 5e2b672fb..472215efb 100644 --- a/docs/post_installation/firststeps-dmarc_reporting.en.md +++ b/docs/post_installation/firststeps-dmarc_reporting.en.md @@ -108,7 +108,7 @@ docker compose exec redis-mailcow redis-cli ZRANGE "dmarc_rpt;microsoft.com;mail In the example above reports are sent once every 24 hours and send reports for yesturday. This will be okay for most setups. -If you have a large mail volume and want to run the DMARC reporting more than once a day you need create second schedule and run it with `dmarc_report $(date '+%Y%m%d')` to process the current day. You have to make sure that the first run on each day also processes the last report from the day before, so it needs to be started twice, one time with `$(date --date yesterday '+%Y%m%d')` at `@midnight` and then with `$(date '+%Y%m%d')` with interval you desire. +If you have a large mail volume and want to run the DMARC reporting more than once a day you need create second schedule and run it with `dmarc_report $(date '+%Y%m%d')` to process the current day. You have to make sure that the first run on each day also processes the last report from the day before, so it needs to be started twice, one time with `$(date --date yesterday '+%Y%m%d')` at `@midnight` and then with `$(date '+%Y%m%d')` with desired interval. The Ofelia schedule has the same implementation as `cron` in Go, supported syntax described at [cron Documentation](https://pkg.go.dev/github.com/robfig/cron) From 345171478d3698fc6dc781e1fbd9c247d5a7ee96 Mon Sep 17 00:00:00 2001 From: Dmitriy Alekseev <1865999+dragoangel@users.noreply.github.com> Date: Tue, 8 Nov 2022 12:41:43 +0200 Subject: [PATCH 3/6] Update firststeps-dmarc_reporting.en.md --- docs/post_installation/firststeps-dmarc_reporting.en.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/post_installation/firststeps-dmarc_reporting.en.md b/docs/post_installation/firststeps-dmarc_reporting.en.md index 472215efb..73e47a176 100644 --- a/docs/post_installation/firststeps-dmarc_reporting.en.md +++ b/docs/post_installation/firststeps-dmarc_reporting.en.md @@ -45,8 +45,8 @@ services: - MASTER=${MASTER:-y} labels: ofelia.enabled: "true" - ofelia.job-exec.rspamd_dmarc_reporting_yesturday.schedule: "@every 24h" - ofelia.job-exec.rspamd_dmarc_reporting_yesturday.command: "/bin/bash -c \"[[ $${MASTER} == y ]] && /usr/bin/rspamadm dmarc_report $(date --date yesterday '+%Y%m%d') > /var/lib/rspamd/dmarc_reports_last_log 2>&1 || exit 0\"" + ofelia.job-exec.rspamd_dmarc_reporting_yesterday.schedule: "@every 24h" + ofelia.job-exec.rspamd_dmarc_reporting_yesterday.command: "/bin/bash -c \"[[ $${MASTER} == y ]] && /usr/bin/rspamadm dmarc_report $(date --date yesterday '+%Y%m%d') > /var/lib/rspamd/dmarc_reports_last_log 2>&1 || exit 0\"" ofelia-mailcow: depends_on: - rspamd-mailcow @@ -125,8 +125,8 @@ services: - MASTER=${MASTER:-y} labels: ofelia.enabled: "true" - ofelia.job-exec.rspamd_dmarc_reporting_yesturday.schedule: "@midnight" - ofelia.job-exec.rspamd_dmarc_reporting_yesturday.command: "/bin/bash -c \"[[ $${MASTER} == y ]] && /usr/bin/rspamadm dmarc_report $(date --date yesterday '+%Y%m%d') > /var/lib/rspamd/dmarc_reports_last_log 2>&1 || exit 0\"" + ofelia.job-exec.rspamd_dmarc_reporting_yesterday.schedule: "@midnight" + ofelia.job-exec.rspamd_dmarc_reporting_yesterday.command: "/bin/bash -c \"[[ $${MASTER} == y ]] && /usr/bin/rspamadm dmarc_report $(date --date yesterday '+%Y%m%d') > /var/lib/rspamd/dmarc_reports_last_log 2>&1 || exit 0\"" ofelia.job-exec.rspamd_dmarc_reporting_today.schedule: "@every 12h" ofelia.job-exec.rspamd_dmarc_reporting_today.command: "/bin/bash -c \"[[ $${MASTER} == y ]] && /usr/bin/rspamadm dmarc_report $(date '+%Y%m%d') > /var/lib/rspamd/dmarc_reports_last_log 2>&1 || exit 0\"" ofelia-mailcow: From a732d6a0ce38fb4ceb49734a104b2810d953602e Mon Sep 17 00:00:00 2001 From: DerLinkman Date: Tue, 8 Nov 2022 11:55:47 +0100 Subject: [PATCH 4/6] Added German Version --- .../firststeps-dmarc_reporting.de.md | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/docs/post_installation/firststeps-dmarc_reporting.de.md b/docs/post_installation/firststeps-dmarc_reporting.de.md index d0ffa2b8f..9ff233939 100644 --- a/docs/post_installation/firststeps-dmarc_reporting.de.md +++ b/docs/post_installation/firststeps-dmarc_reporting.de.md @@ -45,8 +45,8 @@ services: - MASTER=${MASTER:-y} labels: ofelia.enabled: "true" - ofelia.job-exec.rspamd_dmarc_reporting.schedule: "@every 24h" - ofelia.job-exec.rspamd_dmarc_reporting.command: "/bin/bash -c \"[[ $${MASTER} == y ]] && /usr/bin/rspamadm dmarc_report > /var/lib/rspamd/dmarc_reports_last_log 2>&1 || exit 0\"" + ofelia.job-exec.rspamd_dmarc_reporting_yesterday.schedule: "@every 24h" + ofelia.job-exec.rspamd_dmarc_reporting_yesterday.command: "/bin/bash -c \"[[ $${MASTER} == y ]] && /usr/bin/rspamadm dmarc_report $(date --date yesterday '+%Y%m%d') > /var/lib/rspamd/dmarc_reports_last_log 2>&1 || exit 0\"" ofelia-mailcow: depends_on: - rspamd-mailcow @@ -109,13 +109,33 @@ docker compose exec redis-mailcow redis-cli ZRANGE "dmarc_rpt;microsoft.com;mail ## Ändern Sie die Häufigkeit der DMARC-Berichte -Im obigen Beispiel werden die Berichte einmal alle 24 Stunden gesendet. +Im obigen Beispiel werden die Berichte einmal alle 24 Stunden sowie für den gestrigen Tag versendet. Dies ist für die meisten Konfigurationen ausreichend. + +Wenn Sie ein großes E-Mail-Aufkommen haben und die DMARC-Berichterstattung mehr als einmal am Tag durchführen wollen, müssen Sie einen zweiten Zeitplan erstellen und ihn mit `dmarc_report $(date '+%Y%m%d')` ausführen, um den aktuellen Tag zu verarbeiten. Sie müssen sicherstellen, dass der erste Lauf an jedem Tag auch den letzten Bericht vom Vortag verarbeitet, also muss er zweimal gestartet werden, einmal mit `$(date --date yesterday '+%Y%m%d')` um `@midnight` und dann mit `$(date '+%Y%m%d')` mit dem gewünschten Intervall. Der Ofelia-Zeitplan hat die gleiche Implementierung wie `cron` in Go, die unterstützte Syntax ist beschrieben in [cron Documentation](https://pkg.go.dev/github.com/robfig/cron) Um den Zeitplan zu ändern: -1. Bearbeiten Sie `docker-compose.override.yml` und stellen Sie `ofelia.job-exec.rspamd_dmarc_reporting.schedule: "@every 24h"` auf einen gewünschten Wert, zum Beispiel auf `"@midnight"` +1. `docker-compose.override.yml` bearbeiten: + +``` +version: '2.1' + +services: + rspamd-mailcow: + environment: + - MASTER=${MASTER:-y} + labels: + ofelia.enabled: "true" + ofelia.job-exec.rspamd_dmarc_reporting_yesterday.schedule: "@midnight" + ofelia.job-exec.rspamd_dmarc_reporting_yesterday.command: "/bin/bash -c \"[[ $${MASTER} == y ]] && /usr/bin/rspamadm dmarc_report $(date --date yesterday '+%Y%m%d') > /var/lib/rspamd/dmarc_reports_last_log 2>&1 || exit 0\"" + ofelia.job-exec.rspamd_dmarc_reporting_today.schedule: "@every 12h" + ofelia.job-exec.rspamd_dmarc_reporting_today.command: "/bin/bash -c \"[[ $${MASTER} == y ]] && /usr/bin/rspamadm dmarc_report $(date '+%Y%m%d') > /var/lib/rspamd/dmarc_reports_last_log 2>&1 || exit 0\"" + ofelia-mailcow: + depends_on: + - rspamd-mailcow +``` 2. Führen Sie `docker compose up -d` aus. From 8edc8c350b827b304becb0d98915946108ad662f Mon Sep 17 00:00:00 2001 From: Dmitriy Alekseev <1865999+dragoangel@users.noreply.github.com> Date: Wed, 9 Nov 2022 02:01:48 +0200 Subject: [PATCH 5/6] Update firststeps-dmarc_reporting.en.md --- docs/post_installation/firststeps-dmarc_reporting.en.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/post_installation/firststeps-dmarc_reporting.en.md b/docs/post_installation/firststeps-dmarc_reporting.en.md index 73e47a176..2643a3ecb 100644 --- a/docs/post_installation/firststeps-dmarc_reporting.en.md +++ b/docs/post_installation/firststeps-dmarc_reporting.en.md @@ -106,9 +106,9 @@ docker compose exec redis-mailcow redis-cli ZRANGE "dmarc_rpt;microsoft.com;mail ## Change DMARC reporting frequency -In the example above reports are sent once every 24 hours and send reports for yesturday. This will be okay for most setups. +In the example above reports are sent once every 24 hours and send reports for yesterday. This will be okay for most setups. -If you have a large mail volume and want to run the DMARC reporting more than once a day you need create second schedule and run it with `dmarc_report $(date '+%Y%m%d')` to process the current day. You have to make sure that the first run on each day also processes the last report from the day before, so it needs to be started twice, one time with `$(date --date yesterday '+%Y%m%d')` at `@midnight` and then with `$(date '+%Y%m%d')` with desired interval. +If you have a large mail volume and want to run the DMARC reporting more than once a day you need create second schedule and run it with `dmarc_report $(date '+%Y%m%d')` to process the current day. You have to make sure that the first run on each day also processes the last report from the day before, so it needs to be started twice, one time with `$(date --date yesterday '+%Y%m%d')` at `0 5 0 * * *` (00:05 AM) and then with `$(date '+%Y%m%d')` with desired interval. The Ofelia schedule has the same implementation as `cron` in Go, supported syntax described at [cron Documentation](https://pkg.go.dev/github.com/robfig/cron) @@ -125,7 +125,7 @@ services: - MASTER=${MASTER:-y} labels: ofelia.enabled: "true" - ofelia.job-exec.rspamd_dmarc_reporting_yesterday.schedule: "@midnight" + ofelia.job-exec.rspamd_dmarc_reporting_yesterday.schedule: "0 5 0 * * *" ofelia.job-exec.rspamd_dmarc_reporting_yesterday.command: "/bin/bash -c \"[[ $${MASTER} == y ]] && /usr/bin/rspamadm dmarc_report $(date --date yesterday '+%Y%m%d') > /var/lib/rspamd/dmarc_reports_last_log 2>&1 || exit 0\"" ofelia.job-exec.rspamd_dmarc_reporting_today.schedule: "@every 12h" ofelia.job-exec.rspamd_dmarc_reporting_today.command: "/bin/bash -c \"[[ $${MASTER} == y ]] && /usr/bin/rspamadm dmarc_report $(date '+%Y%m%d') > /var/lib/rspamd/dmarc_reports_last_log 2>&1 || exit 0\"" From 173650c5d9c158a5c2d02b9657bd0ad0afcc36eb Mon Sep 17 00:00:00 2001 From: Dmitriy Alekseev <1865999+dragoangel@users.noreply.github.com> Date: Wed, 9 Nov 2022 02:03:46 +0200 Subject: [PATCH 6/6] Update firststeps-dmarc_reporting.de.md --- docs/post_installation/firststeps-dmarc_reporting.de.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/post_installation/firststeps-dmarc_reporting.de.md b/docs/post_installation/firststeps-dmarc_reporting.de.md index 9ff233939..5ba98fb61 100644 --- a/docs/post_installation/firststeps-dmarc_reporting.de.md +++ b/docs/post_installation/firststeps-dmarc_reporting.de.md @@ -111,7 +111,7 @@ docker compose exec redis-mailcow redis-cli ZRANGE "dmarc_rpt;microsoft.com;mail Im obigen Beispiel werden die Berichte einmal alle 24 Stunden sowie für den gestrigen Tag versendet. Dies ist für die meisten Konfigurationen ausreichend. -Wenn Sie ein großes E-Mail-Aufkommen haben und die DMARC-Berichterstattung mehr als einmal am Tag durchführen wollen, müssen Sie einen zweiten Zeitplan erstellen und ihn mit `dmarc_report $(date '+%Y%m%d')` ausführen, um den aktuellen Tag zu verarbeiten. Sie müssen sicherstellen, dass der erste Lauf an jedem Tag auch den letzten Bericht vom Vortag verarbeitet, also muss er zweimal gestartet werden, einmal mit `$(date --date yesterday '+%Y%m%d')` um `@midnight` und dann mit `$(date '+%Y%m%d')` mit dem gewünschten Intervall. +Wenn Sie ein großes E-Mail-Aufkommen haben und die DMARC-Berichterstattung mehr als einmal am Tag durchführen wollen, müssen Sie einen zweiten Zeitplan erstellen und ihn mit `dmarc_report $(date '+%Y%m%d')` ausführen, um den aktuellen Tag zu verarbeiten. Sie müssen sicherstellen, dass der erste Lauf an jedem Tag auch den letzten Bericht vom Vortag verarbeitet, also muss er zweimal gestartet werden, einmal mit `$(date --date yesterday '+%Y%m%d')` um `0 5 0 * * *` (00:05 AM) und dann mit `$(date '+%Y%m%d')` mit dem gewünschten Intervall. Der Ofelia-Zeitplan hat die gleiche Implementierung wie `cron` in Go, die unterstützte Syntax ist beschrieben in [cron Documentation](https://pkg.go.dev/github.com/robfig/cron) @@ -128,7 +128,7 @@ services: - MASTER=${MASTER:-y} labels: ofelia.enabled: "true" - ofelia.job-exec.rspamd_dmarc_reporting_yesterday.schedule: "@midnight" + ofelia.job-exec.rspamd_dmarc_reporting_yesterday.schedule: "0 5 0 * * *" ofelia.job-exec.rspamd_dmarc_reporting_yesterday.command: "/bin/bash -c \"[[ $${MASTER} == y ]] && /usr/bin/rspamadm dmarc_report $(date --date yesterday '+%Y%m%d') > /var/lib/rspamd/dmarc_reports_last_log 2>&1 || exit 0\"" ofelia.job-exec.rspamd_dmarc_reporting_today.schedule: "@every 12h" ofelia.job-exec.rspamd_dmarc_reporting_today.command: "/bin/bash -c \"[[ $${MASTER} == y ]] && /usr/bin/rspamadm dmarc_report $(date '+%Y%m%d') > /var/lib/rspamd/dmarc_reports_last_log 2>&1 || exit 0\""