1

Topic: Banned IP Addresses page not shown in iRedAdmin-Pro

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release):  1.2
- Deployed with the downloadable installer
- Linux/BSD distribution name and version: CentOS 7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? Yes, version 4.3.
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hi, we are trying to upgrade our email server. We are in the process of upgrade iRedMail from 1.1 to 1.2. We follow the documentation to implement "Fail2ban: Store banned IP addresses in SQL database" (URL: https://docs.iredmail.org/fail2ban.sql.html).

The steps are all followed: SQL DB is created and table created. The table can be updated when use the testing command to add banned IP or remove banned IP.

Now only the iRedAdmin-Pro is not working. The menu can show Activities -> Banned IP Addresses, but once clicked, it shows "Internal server error". Checked Nginx log and seems the error code is 500.

I followed the document to add below to iRedMail setting file: /var/www/iredadmin/settings.py

fail2ban_enabled = True
fail2ban_db_host = '127.0.0.1'
fail2ban_db_port = '3306'
fail2ban_db_name = 'fail2ban'
fail2ban_db_user = 'fail2ban'
fail2ban_db_password = 'xxxxxxxxxxxx'

Is that all need to do? Does this version of iRedAmin-Pro 4.3 work with fail2ban banned IP?

Thanks!

2

Re: Banned IP Addresses page not shown in iRedAdmin-Pro

misceh wrote:

fail2ban_db_port = '3306'

Please remove those 2 single quotes, then restart "iredadmin" service and try again.
Also, any relevant error in /var/log/messages when the "internal server error" happened?

----

Buy me a cup of coffee ($5) to support iRedMail:

buy me a cup of coffee

3

Re: Banned IP Addresses page not shown in iRedAdmin-Pro

ZhangHuangbin wrote:
misceh wrote:

fail2ban_db_port = '3306'

Please remove those 2 single quotes, then restart "iredadmin" service and try again.
Also, any relevant error in /var/log/messages when the "internal server error" happened?

Hi, I have removed single quotes, and restarted "iredadmin" service, but it is the same error for Banned IP Address page - "internal server error".

No error message in messages log.

In /var/log/nginx/access.log, it shows:
192.168.1.xxx - - [14/Jan/2021:09:03:31 +0800] "GET /iredadmin/activities/fail2ban/banned HTTP/1.1" 500 32 "https://mail-server.com/iredadmin/dashboard?checknew" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:82.0) Gecko/20100101 Firefox/82.0"

Any suggestion? Thanks!

4

Re: Banned IP Addresses page not shown in iRedAdmin-Pro

Hi, Mr Zhang, I just noticed, iRedAdmin-Pro 4.3 is supposed to work with iRedMail 1.1. However, our mail server was just upgraded to iRedMail 1.2. Is it possible that this cause the problem?

The banned IP in SQL database is introduced since iRedMail 1.2. Does it mean iRedAdmin-Pro 4.3 is not supporting banned IP yet?

Thanks!

5

Re: Banned IP Addresses page not shown in iRedAdmin-Pro

iRedAdmin-Pro-LDAP-4.3 supports viewing banned IP addresses.
With correct parameters in iRedAdmin-Pro config file (/opt/www/iredadmin/settings.py), and restarted "iredadmin" service, iRedAdmin-Pro should be able to display banned IP addresses.

How about upgrade iRedMail + iRedAdmin-Pro to the latest versions and check again?

----

Buy me a cup of coffee ($5) to support iRedMail:

buy me a cup of coffee