From 4a54f65c82f9c32d7d5ac23ac435ac4c6c3a8862 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 18 Aug 2020 16:20:06 +0200 Subject: [PATCH] Initial commit --- tasks/main.yml | 15 +++++++++++++++ templates/dmarc.conf | 4 ++++ templates/milter_headers.conf | 27 +++++++++++++++++++++++++++ templates/options.inc | 1 + 4 files changed, 47 insertions(+) create mode 100644 tasks/main.yml create mode 100644 templates/dmarc.conf create mode 100644 templates/milter_headers.conf create mode 100644 templates/options.inc diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..95747d0 --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,15 @@ +- name: Copy rspamd configs + loop: + - 'options.inc' + - 'milter_headers.conf' + - 'dmarc.conf' + template: + src: '{{ item }}' + dest: '/etc/rspamd/local.d/{{ item }}' + follow: yes + owner: root + group: root + mode: 730 + tags: + - rspamd + notify: Run service actions diff --git a/templates/dmarc.conf b/templates/dmarc.conf new file mode 100644 index 0000000..25854be --- /dev/null +++ b/templates/dmarc.conf @@ -0,0 +1,4 @@ +actions = { + quarantine = "add_header"; + reject = "reject"; +} diff --git a/templates/milter_headers.conf b/templates/milter_headers.conf new file mode 100644 index 0000000..cbc344f --- /dev/null +++ b/templates/milter_headers.conf @@ -0,0 +1,27 @@ +extended_spam_headers = true; +authenticated_headers = ["authentication-results"]; +spf_symbols { + pass = "R_SPF_ALLOW"; + fail = "R_SPF_FAIL"; + softfail = "R_SPF_SOFTFAIL"; + neutral = "R_SPF_NEUTRAL"; + temperror = "R_SPF_DNSFAIL"; + none = "R_SPF_NA"; + permerror = "R_SPF_PERMFAIL"; + } + dkim_symbols { + pass = "R_DKIM_ALLOW"; + fail = "R_DKIM_REJECT"; + temperror = "R_DKIM_TEMPFAIL"; + none = "R_DKIM_NA"; + permerror = "R_DKIM_PERMFAIL"; + } + dmarc_symbols { + pass = "DMARC_POLICY_ALLOW"; + permerror = "DMARC_BAD_POLICY"; + temperror = "DMARC_DNSFAIL"; + none = "DMARC_NA"; + reject = "DMARC_POLICY_REJECT"; + softfail = "DMARC_POLICY_SOFTFAIL"; + quarantine = "DMARC_POLICY_QUARANTINE"; + } diff --git a/templates/options.inc b/templates/options.inc new file mode 100644 index 0000000..6f03c83 --- /dev/null +++ b/templates/options.inc @@ -0,0 +1 @@ +filters = "chartable,dkim,spf,dmarc,milter_headers,phishing";