diff --git a/config-static/mail/rspamd/multimap.conf b/config-static/mail/rspamd/multimap.conf new file mode 100644 index 0000000000000000000000000000000000000000..cb8ca45ad9683b157c069902317ec5e2dc90d0fc --- /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 0000000000000000000000000000000000000000..95d879ecddb4a404868d262f5dfdd5104fc0ee4b --- /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 0000000000000000000000000000000000000000..883cb0f2746a5a295cd8dccf9daea0e9f96d39a6 --- /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 866834e9033d4d9710eeb126c61f4bd1b0f18233..4b714e0cd2d144563246d5de7b81985ceb8ba242 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