mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-07-10 01:15:00 +02:00
Add ban feature to fail2ban script (#2538)
This commit is contained in:
parent
9aaf15b38f
commit
de61d42e68
9 changed files with 105 additions and 30 deletions
|
@ -97,7 +97,7 @@ You can also manage and list the banned IPs with the [`setup.sh`][docs-setupsh]
|
|||
### List bans
|
||||
|
||||
```sh
|
||||
./setup.sh debug fail2ban
|
||||
./setup.sh fail2ban
|
||||
```
|
||||
|
||||
### Un-ban
|
||||
|
@ -105,7 +105,7 @@ You can also manage and list the banned IPs with the [`setup.sh`][docs-setupsh]
|
|||
Here `192.168.1.15` is our banned IP.
|
||||
|
||||
```sh
|
||||
./setup.sh debug fail2ban unban 192.168.1.15
|
||||
./setup.sh fail2ban unban 192.168.1.15
|
||||
```
|
||||
|
||||
[docs-setupsh]: ../setup.sh.md
|
||||
|
|
|
@ -73,8 +73,12 @@ DESCRIPTION
|
|||
./setup.sh relay add-domain <DOMAIN> <HOST> [<PORT>]
|
||||
./setup.sh relay exclude-domain <DOMAIN>
|
||||
|
||||
COMMAND fail2ban =
|
||||
./setup.sh fail2ban
|
||||
./setup.sh fail2ban ban <IP>
|
||||
./setup.sh fail2ban unban <IP>
|
||||
|
||||
COMMAND debug :=
|
||||
./setup.sh debug fail2ban [unban <IP>]
|
||||
./setup.sh debug fetchmail
|
||||
./setup.sh debug login <COMMANDS>
|
||||
./setup.sh debug show-mail-logs
|
||||
|
|
|
@ -427,6 +427,17 @@ sed -i 's/rimap -r/rimap/' /etc/supervisor/conf.d/saslauth.conf
|
|||
supervisorctl update
|
||||
```
|
||||
|
||||
### How to ban custom IP addresses with Fail2ban
|
||||
|
||||
Use the following command:
|
||||
|
||||
```bash
|
||||
./setup.sh fail2ban ban <IP>
|
||||
```
|
||||
|
||||
The default bantime is 180 days. This value can be [customized][fail2ban-customize].
|
||||
|
||||
[fail2ban-customize]: ./config/security/fail2ban.md
|
||||
[docs-maintenance]: ./config/advanced/maintenance/update-and-cleanup.md
|
||||
[docs-userpatches]: ./config/advanced/override-defaults/user-patches.md
|
||||
[github-issue-95]: https://github.com/docker-mailserver/docker-mailserver/issues/95
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue