1

Topic: fail2ban error Command not found

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version: 1.7.3
- Deployed with: downloadable installer
- Linux distribution: Debian 12
- Store mail accounts in backend: MySQL
- Web server: Nginx
- Manage mail accounts with iRedAdmin-Pro: no
====

Hello,

on basic iRedmail install, I observe errors like this in journal:

```
Jun 10 13:13:40 srv-un-19 fail2ban.utils[493]: ERROR 7fcce4fcd080 -- stderr: '2025-06-10T13:13:39.382646+02:00 srv-un-19 postfix/postscreen[530172]: PREGREET 219 after 0 from [65.49.1.30]:11831: GET / HTTP/1.1\\r\\nHost: 212.79.111.19:25\\r\\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWe: 2: /usr/local/bin/fail2ban_banned_db: not found'
Jun 10 13:13:40 srv-un-19 fail2ban.utils[493]: ERROR 7fcce4fcd080 -- returned 127
Jun 10 13:13:40 srv-un-19 fail2ban.utils[493]: INFO HINT on 127: "Command not found".  Make sure that all commands in ['f2bV_ipjailmatches=$0 \n/usr/local/bin/fail2ban_banned_db ban 65.49.1.30 80,443,25,587,465,110,995,143,993,4190 tcp pregreet 1 $f2bV_ipjailmatches', '2025-06-10T13:13:39.382646+02:00 srv-un-19 postfix/postscreen[530172]: PREGREET 219 after 0 from [65.49.1.30]:11831: GET / HTTP/1.1\\r\\nHost: 212.79.111.19:25\\r\\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWe'] are in the PATH of fail2ban-server process (grep -a PATH= /proc/`pidof -x fail2ban-server`/environ). You may want to start "fail2ban-server -f" separately, initiate it with "fail2ban-client reload" in another shell session and observe if additional informative error messages appear in the terminals.
Jun 10 13:13:40 srv-un-19 fail2ban.actions[493]: ERROR Failed to execute ban jail 'pregreet' action 'banned_db' info 'ActionInfo({'ip': '65.49.1.30', 'family': 'inet4', 'fid': <function Actions.ActionInfo.<lambda> at 0x7fcce5112160>, 'ipjailmatches': '2025-06-10T13:13:39.382646+02:00 srv-un-19 postfix/postscreen[530172]: PREGREET 219 after 0 from [65.49.1.30]:11831: GET / HTTP/1.1\\r\\nHost: 212.79.111.19:25\\r\\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWe', 'ipjailfailures': 1, 'raw-ticket': <function Actions.ActionInfo.<lambda> at 0x7fcce51128e0>})': Error banning 65.49.1.30
```

Is that smth to worry about ? Thanks in advance for any help.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: fail2ban error Command not found

Please show us command output:

ls -l /usr/local/bin/fail2ban_banned_db

And try to fix it with commands below, run as root user:

wget https://github.com/iredmail/iRedMail/raw/master/samples/fail2ban/bin/fail2ban_banned_db
mv fail2ban_banned_db /usr/local/bin/
chmod 0550 /usr/local/bin/fail2ban_banned_db

3

Re: fail2ban error Command not found

Here it is:

ls -l /usr/local/bin/fail2ban_banned_db
-r-xr-x--- 1 root root 8555 Jun  3 09:10 /usr/local/bin/fail2ban_banned_db

It looks like the problem possibly was, that it specified non-existing path to bash on first line:

#!/usr/local/bin/bash

I did that second step, monitoring log now - so far seems it helped.

Thanks !