From 69cf9b8cf971befa6ae8e1851b71b01499161c01 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 27 Dec 2019 10:56:16 +0000 Subject: [PATCH] a few changes to lower rate limits (required by community forum user) and to improve score of e.email domain (cherry picked from commit 63045b7e015058c2f329b248e34e107a77959942) --- config-static/mail/rspamd/multimap.conf | 6 ++++++ config-static/mail/rspamd/ratelimit.conf | 17 +++++++++++++++++ .../mail/rspamd/whitelist.sender.domain.map | 1 + .../docker-compose/docker-compose-base.yml | 3 +++ 4 files changed, 27 insertions(+) create mode 100644 config-static/mail/rspamd/multimap.conf create mode 100644 config-static/mail/rspamd/ratelimit.conf create mode 100644 config-static/mail/rspamd/whitelist.sender.domain.map diff --git a/config-static/mail/rspamd/multimap.conf b/config-static/mail/rspamd/multimap.conf new file mode 100644 index 0000000..cb8ca45 --- /dev/null +++ b/config-static/mail/rspamd/multimap.conf @@ -0,0 +1,6 @@ +WHITELIST_SENDER_DOMAIN { + type = "from"; + filter = "email:domain"; + map = "/etc/rspamd/local.d/whitelist.sender.domain.map"; + score = -6.0 +} diff --git a/config-static/mail/rspamd/ratelimit.conf b/config-static/mail/rspamd/ratelimit.conf new file mode 100644 index 0000000..95d879e --- /dev/null +++ b/config-static/mail/rspamd/ratelimit.conf @@ -0,0 +1,17 @@ +rates { + # Limit for all mail per recipient (rate 10 per minute) + to = "10 / 1m"; + # Limit for all mail per one source ip (rate 15 per minute) + to_ip = "15 / 1m"; + # Limit for all mail per one source ip and from address (rate 10 per minute) + to_ip_from = "10 / 1m"; + # Limit for all bounce mail (rate 2 per hour) + bounce_to = "2 / 1h"; + # Limit for bounce mail per one source ip (rate 1 per hour) + bounce_to_ip = "1 / 1h"; + # Limit for all mail per authenticated user (rate 10 per minute) + user = "10 / 1m"; +} + +whitelisted_rcpts = "postmaster,mailer-daemon"; +max_rcpt = 5; diff --git a/config-static/mail/rspamd/whitelist.sender.domain.map b/config-static/mail/rspamd/whitelist.sender.domain.map new file mode 100644 index 0000000..883cb0f --- /dev/null +++ b/config-static/mail/rspamd/whitelist.sender.domain.map @@ -0,0 +1 @@ +e.email diff --git a/templates/docker-compose/docker-compose-base.yml b/templates/docker-compose/docker-compose-base.yml index 866834e..4b714e0 100644 --- a/templates/docker-compose/docker-compose-base.yml +++ b/templates/docker-compose/docker-compose-base.yml @@ -32,6 +32,9 @@ services: - /mnt/repo-base/config-static/mail/dovecot/10-mail.conf:/etc/dovecot/conf.d/10-mail.conf - /mnt/repo-base/config-static/mail/dovecot/90-quota.conf:/etc/dovecot/conf.d/90-quota.conf - /mnt/repo-base/config-static/mail/dovecot/90-sieve.conf:/etc/dovecot/conf.d/90-sieve.conf + - /mnt/repo-base/config-static/mail/rspamd/multimap.conf:/etc/rspamd/local.d/multimap.conf + - /mnt/repo-base/config-static/mail/rspamd/whitelist.sender.domain.map:/etc/rspamd/local.d/whitelist.sender.domain.map + - /mnt/repo-base/config-static/mail/rspamd/ratelimit.conf:/etc/rspamd/local.d/ratelimit.conf depends_on: - mariadb - redis -- GitLab