Problem with the IP block

I have a hosting service with several email accounts, and the server is constantly blocking the office’s IP address. I have checked all the email account settings in Outlook, and everything is correct; in fact, all email accounts are working fine. However, the server keeps blocking the IP. Is there a way to prevent that IP from being blocked by the server, please?

For the long term, you really should examine the course of the blocking. If it is being blocked by fail2ban, you can examine its logfile.

For the short term, if fail2ban is indeed the cause, you can tell fail2ban to ignore that ipadres. Edit the file /etc/fail2ban/jail.local, find the [default] section, and add a line
ignoreip = w.x.y.z
or add w.x.y.z. to that line if it already exists.

Thank you so much. How can I access /etc/fail2ban/jail.local?

It is just a file that can be edited by root, nothing special needed.

Like this?


Must the [DEFAULT] be commented or not?

Sorry, I can not read text from a picture. [default] should not be commented.

1 Like

Sorry, which of these 2 ways is the correct one?:
#[DEFAULT]
ignoreip = 81.42.192.185 etc

or
[DEFAULT]
ignoreip = 81.42.192.185 etc

This one:

1 Like

Thank you so much indeed!

2 Likes

I have an account exactly like that, it says everything is working fine, but it keeps blocking their IPs, since they are dynamic, that solution is not viable. Do you know any way to ignore the specific user?

If the ip is dynamic, your client can use some dynamic dns service so a domain is always updated with the current dynamic ip and you can use that domain in ignoreip directive (fail2ban will check the right ip dynamically). I mean, you add dyn-client.example.net to ignoreip directive, restart fail2ban to accept the changes and that’s all, there is no need to restart fail2ban every time the ip changes.

Thanks!
I hadn’t thought of this option… :smiley:
I’ll try it.

1 Like

instead of working around this, you should check the log-files of exim and dovecot to find out which mail account fails authentication and have the user set up their mail clients correctly instead of continuing with wrong credentials and blocking access for everyone else.

2 Likes