Topic: Fail2ban doesn't work properly
==== Required information ====
- iRedMail version (check /etc/iredmail-release):
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro?
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
======== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.6 MARIADB edition.
- Linux/BSD distribution name and version: CentOS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
====
Hello
I wanted to test my system, and it seems that Fail2ban actually don't work properly. I tried to login several times with wrong login credentials, and Fail2ban doesn't see these failed logins.
Please see the below output of /var/mail/log:
[root@mail frederik]# cat /var/log/maillog
[...]
May 21 14:23:36 mail postfix/anvil[6168]: statistics: max cache size 1 at May 21 20:20:15
May 21 14:23:55 mail roundcube: <33sm0ich> IMAP Error: Login failed for frederik@[mydomain].com from 104.254.90.195(X-Forwarded-For: 145.47.201.135). LOGIN: Authentication failed. in /var/www/roundcubemail-1.2.4/program/lib/Roundcube/rcube_imap.php on line 193 (POST /?_task=login&_action=login)
May 21 14:24:14 mail roundcube: <33sm0ich> IMAP Error: Login failed for frederik@[mydomain].com from 104.254.90.195(X-Forwarded-For: 6.115.0.189). LOGIN: Authentication failed. in /var/www/roundcubemail-1.2.4/program/lib/Roundcube/rcube_imap.php on line 193 (POST /?_task=login&_action=login)
May 21 14:24:42 mail roundcube: <33sm0ich> IMAP Error: Login failed for frederik@[mydomain].com from 104.254.90.195(X-Forwarded-For: 186.210.50.87). LOGIN: Authentication failed. in /var/www/roundcubemail-1.2.4/program/lib/Roundcube/rcube_imap.php on line 193 (POST /?_task=login&_action=login)
May 21 14:25:50 mail roundcube: <o53kfqri> IMAP Error: Login failed for frederik@[mydomain].com from 104.254.90.195. LOGIN: Authentication failed. in /var/www/roundcubemail-1.2.4/program/lib/Roundcube/rcube_imap.php on line 193 (POST /?_task=login&_action=login)
May 21 14:26:04 mail roundcube: <o53kfqri> IMAP Error: Login failed for frederik@[mydomain].com from 104.254.90.195. LOGIN: Authentication failed. in /var/www/roundcubemail-1.2.4/program/lib/Roundcube/rcube_imap.php on line 193 (POST /?_task=login&_action=login)
From above code it seems that the log shows the failed logins, but when I try to look in Fail2ban it doesn't seem to find these failures:
[root@mail frederik]# fail2ban-client status roundcube-iredmail
Status for the jail: roundcube-iredmail
|- Filter
| |- Currently failed: 0
| |- Total failed: 0
| `- File list: /var/log/maillog
`- Actions
|- Currently banned: 0
|- Total banned: 0
`- Banned IP list:
Any help would be greatly appreciated.
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.