From 3bf241c3e08fa98708f47695fef50b0520f1d199 Mon Sep 17 00:00:00 2001 From: "github@kiekerjan.isdronken.nl" Date: Fri, 23 Apr 2021 22:03:22 +0200 Subject: [PATCH] add postfix spamhaus jail --- conf/fail2ban/filter.d/postfix-spamhaus.conf | 11 +++++++++++ conf/fail2ban/jails.conf | 9 ++++++++- setup/solr.sh | 10 +++++----- 3 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 conf/fail2ban/filter.d/postfix-spamhaus.conf diff --git a/conf/fail2ban/filter.d/postfix-spamhaus.conf b/conf/fail2ban/filter.d/postfix-spamhaus.conf new file mode 100644 index 00000000..40ccaf3d --- /dev/null +++ b/conf/fail2ban/filter.d/postfix-spamhaus.conf @@ -0,0 +1,11 @@ +# Fail2Ban filter based on spamhaus entries + +[INCLUDES] + +before = common.conf + +[Definition] + +failregex = .*?box postfix/smtpd.*?NOQUEUE: reject: RCPT from.*?\[\]: 554 5\.7\.1 Service unavailable.*?zen\.spamhaus\.org.*$ + +ignoreregex = diff --git a/conf/fail2ban/jails.conf b/conf/fail2ban/jails.conf index b2faf27a..56be14a4 100644 --- a/conf/fail2ban/jails.conf +++ b/conf/fail2ban/jails.conf @@ -87,4 +87,11 @@ maxretry = 4 bantime = 3600 mode = aggressive - +[postfix-spamhaus] +port = smtp,465,submission +filter = postfix-spamhaus +logpath = /var/log/mail.log +maxretry = 2 +findtime = 120m +bantime = 1d +enabled = true diff --git a/setup/solr.sh b/setup/solr.sh index 0277073b..3c3bcae6 100644 --- a/setup/solr.sh +++ b/setup/solr.sh @@ -131,13 +131,13 @@ EOF cat > /etc/logrotate.d/solr <