Fail2Ban service fails to start right after installing Email module

Fail2Ban service fails to start after installing the Email module, because there is no log file for the dovecot jail.
As a quick test, creating a dummy log file gets rid of the error.

/var/log/messages:

Jun  9 14:39:24 server pkgaction[2944]: install: @nethserver-mail, nethserver-roundcubemail, nethserver-getmail
(...)
Jun  9 14:41:46 server systemd: Starting Fail2Ban Service...
Jun  9 14:41:47 server fail2ban-client: ERROR  No file(s) found for glob /var/log/imap*
Jun  9 14:41:47 server fail2ban-client: ERROR  Failed during configuration: Have not found any log file for dovecot-nethserver jail
Jun  9 14:41:47 server systemd: fail2ban.service: control process exited, code=exited status=255
Jun  9 14:41:47 server systemd: Failed to start Fail2Ban Service.
Jun  9 14:41:47 server systemd: Unit fail2ban.service entered failed state.
Jun  9 14:41:47 server systemd: fail2ban.service failed.
Jun  9 14:41:47 server esmith::event[4178]: Job for fail2ban.service failed because the control process exited with error code. See "systemctl status fail2ban.service" and "journalctl -xe" for details.
Jun  9 14:41:47 server esmith::event[4178]: [WARNING] restart service fail2ban failed!
Jun  9 14:41:47 server esmith::event[4178]: Action: /etc/e-smith/events/actions/adjust-services FAILED: 1 [18.045521]
Jun  9 14:41:47 server esmith::event[4178]: Event: runlevel-adjust FAILED
1 Like

Hi marc

Thank for your input, I corrected it for ns6 and ns7. Unfortunately we cannot monitor logs right after the dovecot installation, we need to wait that it starts to write in /var/log/imap, then the jail will be ready if you launch a fail2ban event manually or install another rpm or change/save the settings in the panel

Tested on Nethserver 7. Trying to replicate the problem reported, with your patch now fail2ban service starts successfully.

1 Like