From 39bf5db940d9dd312341a6a1b6ec497af6f2281f Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 9 Aug 2023 12:13:50 +0200 Subject: [PATCH] Fix the cron jobs. jump chain configurable. --- defaults/main.yml | 8 +++++--- meta/main.yml | 8 +++++--- tasks/mailman.yml | 4 ++-- templates/mailman.cfg.j2 | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 7119cb4..5381062 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -118,12 +118,14 @@ mailman_dmarc_enabled: 'yes' mailman_dkim_enabled: 'yes' mailman_antispam_header_checks: - - 'X-Spam: (yes|maybe)' - - 'X-Spam: (YES)' - - 'X-Spam-Flag: (yes|maybe)' - 'X-Spam-Flag: (YES)' #- 'Authentication-Results: mail.example.com; dmarc=(fail|quarantine)' +# The chain to jump to if any of the header patterns matches. This must be +# the name of an existing chain such as 'discard', 'reject', 'hold', or +# 'accept', otherwise 'hold' will be used. +mailman_antispam_chain_behaviour: "hold" + mailman_start_nntp_runner: 'no' mailman_repository: 'https://gitlab.com/mailman/mailman-suite.git' diff --git a/meta/main.yml b/meta/main.yml index 4acbe0a..50ceb27 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,14 +1,16 @@ --- galaxy_info: - author: adellam + author: Andrea Dell'Amico + namespace: adellam + role_name: mailman description: Mailman 3 installation, configuration, and management for Linux using pip company: ISTI-CNR license: license (EUPL) - min_ansible_version: 2.7 + min_ansible_version: "2.7" platforms: - name: EL versions: - - 7 + - "7" galaxy_tags: - mail - mailing diff --git a/tasks/mailman.yml b/tasks/mailman.yml index 1cdc55a..f92e9d1 100644 --- a/tasks/mailman.yml +++ b/tasks/mailman.yml @@ -114,7 +114,7 @@ block: - name: Add a daily cron job that sends digests cron: - job: "{{ mailman_bindir }}/mailman digests --periodic > {{ mailman_log_dir }}/mailman_cron_digest.log 2>&1" + job: "{{ mailman_bindir }}/mailman -C {{ mailman_conf_dir }}/mailman.cfg digests --periodic > {{ mailman_log_dir }}/mailman_cron_digest.log 2>&1" special_time: daily user: '{{ mailman_user }}' name: "Mailman digests" @@ -123,7 +123,7 @@ - name: Add a daily cron job that sends notifications to the list administrators and list owners cron: - job: "{{ mailman_bindir }}/mailman notify > {{ mailman_log_dir }}/mailman_cron_notifications.log 2>&1" + job: "{{ mailman_bindir }}/mailman -C {{ mailman_conf_dir }}/mailman.cfg notify > {{ mailman_log_dir }}/mailman_cron_notifications.log 2>&1" minute: '0' hour: '7' user: '{{ mailman_user }}' diff --git a/templates/mailman.cfg.j2 b/templates/mailman.cfg.j2 index 8853dac..5ccfb33 100644 --- a/templates/mailman.cfg.j2 +++ b/templates/mailman.cfg.j2 @@ -242,7 +242,7 @@ header_checks: # The chain to jump to if any of the header patterns matches. This must be # the name of an existing chain such as 'discard', 'reject', 'hold', or # 'accept', otherwise 'hold' will be used. -jump_chain: hold +jump_chain: "{{ mailman_antispam_chain_behaviour }}" [runner.nntp] class: mailman.runners.nntp.NNTPRunner