1

Topic: /usr/local/bin/fail2ban_banned_db interpreter

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release):
- Deployed with iRedMail Easy or the downloadable installer?
- 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.
====

iRedMail 1.7.4
Deployed with downloadable installer
Debian 12
Mysql backend
Nginx
no iredadmin-pro

/usr/local/bin/fail2ban_banned_db floods fail2ban.log with errors

2025-08-18T12:27:20.642058+00:00 mail fail2ban.filter[137]: INFO Added logfile: '/var/log/mail.log' (pos = 5034, hash = ce701690a4c289b9d4f9f754e2b061a76c3f7e5c)
2025-08-18T12:27:20.642096+00:00 mail fail2ban.utils[137]: ERROR 746cc02680f0 -- exec: /usr/local/bin/fail2ban_banned_db start sshd
2025-08-18T12:27:20.642140+00:00 mail fail2ban.utils[137]: ERROR 746cc02680f0 -- stderr: '/bin/sh: 1: /usr/local/bin/fail2ban_banned_db: not found'
2025-08-18T12:27:20.642183+00:00 mail fail2ban.utils[137]: ERROR 746cc02680f0 -- returned 127
2025-08-18T12:27:20.642224+00:00 mail fail2ban.utils[137]: INFO HINT on 127: "Command not found".  Make sure that all commands in '/usr/local/bin/fail2ban_banned_db start sshd' are in the PATH of fail2ban-server process (grep -a PATH= />
2025-08-18T12:27:20.642270+00:00 mail fail2ban.actions[137]: ERROR Failed to start jail 'sshd' action 'banned_db': Error starting action Jail('sshd')/banned_db: 'Script error'
2025-08-18T12:27:20.642347+00:00 mail fail2ban.jail[137]: INFO Jail 'sshd' started
2025-08-18T12:27:20.642418+00:00 mail fail2ban.jail[137]: INFO Jail 'nginx-http-auth' started
2025-08-18T12:27:20.642521+00:00 mail fail2ban.utils[137]: ERROR 746cc02682d0 -- exec: /usr/local/bin/fail2ban_banned_db start nginx
2025-08-18T12:27:20.642594+00:00 mail fail2ban.jail[137]: INFO Jail 'postfix' started
2025-08-18T12:27:20.642671+00:00 mail fail2ban.utils[137]: ERROR 746cc02682d0 -- stderr: '/bin/sh: 1: /usr/local/bin/fail2ban_banned_db: not found'
2025-08-18T12:27:20.642744+00:00 mail fail2ban.utils[137]: ERROR 746cc02682d0 -- returned 127
2025-08-18T12:27:20.642807+00:00 mail fail2ban.utils[137]: INFO HINT on 127: "Command not found".  Make sure that all commands in '/usr/local/bin/fail2ban_banned_db start nginx' are in the PATH of fail2ban-server process (grep -a PATH= >
2025-08-18T12:27:20.642873+00:00 mail fail2ban.actions[137]: ERROR Failed to start jail 'nginx-http-auth' action 'banned_db-nginx': Error starting action Jail('nginx-http-auth')/banned_db-nginx: 'Script error'
2025-08-18T12:27:20.642944+00:00 mail fail2ban.jail[137]: INFO Jail 'dovecot' started
2025-08-18T12:27:20.643011+00:00 mail fail2ban.jail[137]: INFO Jail 'pregreet' started
2025-08-18T12:27:20.643077+00:00 mail fail2ban.utils[137]: ERROR 746cc02685d0 -- exec: /usr/local/bin/fail2ban_banned_db start postfix
2025-08-18T12:27:20.643144+00:00 mail fail2ban.utils[137]: ERROR 746cc02685d0 -- stderr: '/bin/sh: 1: /usr/local/bin/fail2ban_banned_db: not found'


The head interpreter for /usr/local/bin/fail2ban_banned_db scripts is #!/usr/local/bin/bash and it`s not ok on a vanilla debian install. After I corrected the script to use #!/bin/bash
, everything is ok. no more errors.

----

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

2

Re: /usr/local/bin/fail2ban_banned_db interpreter

If it's helpful, here are my fail2ban errors and fixes posts:

https://forum.iredmail.org/topic20748-o … l-172.html

https://forum.iredmail.org/topic20662-v … irect.html

https://forum.iredmail.org/topic20397-o … ailed.html

3

Re: /usr/local/bin/fail2ban_banned_db interpreter

I see that it`s fixed in the github version.