Skip to content

BillionMail gives you open-source MailServer, NewsLetter, Email Marketing — fully self-hosted, dev-friendly, and free from monthly fees. Join the discord: https://discord.gg/asfXzBUhZr

Update fail2ban_init rule

aapanel.com1ce6ad9f82b9
diff --git a/Dockerfiles/core/core.sh b/Dockerfiles/core/core.sh
index eb03f975..98035fd7 100644
--- a/Dockerfiles/core/core.sh
+++ b/Dockerfiles/core/core.sh
@@ -72,9 +72,10 @@ fi
if [ ! -d "/opt/billionmail/core/logs/" ]; then
mkdir /opt/billionmail/core/logs
- if [ ! -f "/opt/billionmail/core/logs/access-$(date -u +"%Y%m%d").log" ]; then
- touch /opt/billionmail/core/logs/access-$(date -u +"%Y%m%d").log
- fi
+fi
+
+if [ ! -f "/opt/billionmail/core/logs/access-$(date -u +"%Y%m%d").log" ]; then
+ touch /opt/billionmail/core/logs/access-$(date -u +"%Y%m%d").log
fi
chmod +x /opt/billionmail/core/billionmail
diff --git a/conf/core/fail2ban_init/filter.d/core-limit-filter.conf b/conf/core/fail2ban_init/filter.d/core-limit-filter.conf
index 4f572f4a..05d1af86 100644
--- a/conf/core/fail2ban_init/filter.d/core-limit-filter.conf
+++ b/conf/core/fail2ban_init/filter.d/core-limit-filter.conf
@@ -1,4 +1,4 @@
[Definition]
-failregex = ^.*? \d+ "(GET|POST|HEAD|PUT|DELETE|PATCH|OPTIONS|CONNECT|TRACE) http [^ ]+ \S+ HTTP.*" [^,]+, <HOST>, ".*?", ".*?"$
+failregex = ^.*? \d+ "(GET|POST|HEAD|PUT|DELETE|PATCH|OPTIONS|CONNECT|TRACE) http [^ ]+ \S+ HTTP.*" .*, <HOST>, ".*?", ".*?"$
ignoreregex = .*/roundcube.*
diff --git a/conf/core/fail2ban_init/filter.d/roundcube-limit-filter.conf b/conf/core/fail2ban_init/filter.d/roundcube-limit-filter.conf
index 62b450c4..43247423 100644
--- a/conf/core/fail2ban_init/filter.d/roundcube-limit-filter.conf
+++ b/conf/core/fail2ban_init/filter.d/roundcube-limit-filter.conf
@@ -1,4 +1,4 @@
[Definition]
# Only match roundcube logs
-failregex = ^.*? \d+ "(GET|POST|HEAD|PUT|DELETE|PATCH|OPTIONS|CONNECT|TRACE) http [^ ]+ /roundcube(?:/\S*)? HTTP.*" [^,]+, <HOST>, ".*?", ".*?"$
-ignoreregex =
\ No newline at end of file
+failregex = ^.*? \d+ "(GET|POST|HEAD|PUT|DELETE|PATCH|OPTIONS|CONNECT|TRACE) http [^ ]+ /roundcube(?:[/?][^ \"]*)? HTTP.*" .*, <HOST>, ".*?", ".*?"$
+ignoreregex = ^.* /roundcube/(?:skins|plugins|assets|images)/
\ No newline at end of file