Fail2ban keeps banning my own server's IP

Hello again!

OnlyOffice is working good under my Ubuntu Server 22.04, however I keep having to deal with this issue manually: the onlyoffice mailserver keeps banning it’s own IP.

I then have to enter this command: docker exec -it onlyoffice-mail-server iptables -D f2b-dovecot -s 179.218.25.212 -j REJECT, in order to unban it every single time.

Is there an option to unban my IP forever or anyway to disable fail2ban altogether?

Regrards,
Bruno Leon

Dear @brunoleonadvogado
I remember this case. Please give us some time to check for updates on it. I will come back to you as soon as possible.

Hello @brunoleonadvogado
Would you mind running a test? Please try to add your portal address to white list via this guide: How do I whitelist an IP address on fail2ban?

Hi @Alexandre

It did follow your instructions and It does look good, as I did manage to add my servers IP to the jail.conf file, inside the mail sever onlyoffice container.

However I can’t use the systemctl restart fail2ban final command, as I get systemctl: command not found. How can I restart the service inside the container?

My server keeps showing the same, as the system is still not reloaded.

Regards,
Bruno Leon

Hello Bruno,
Sorry for the late reply. Please try to use service fail2ban restart command in this scenario.
NB! It’s better to prepare whole server backup just in case.

Hi Alexandre,

After running that command, that’s my screen now:

To be fair, it seems to have solved my issue. Not sure about security though. But way better that way, thank you.

Regards,
Bruno Leon

Glad to hear that. Please feel free to contact us if you face any issues.