Fail2ban does not work with Dovecot
Symptoms
The installed fail2ban rules do not work with Dovecot.
An error is displayed in the Dovecot log: «Failed during configuration: Have not found any log file for dovecot jail».
Causes
The Dovecot log is not allocated to a separate file.
Solution
By default, the Dovecot mail server log is written to the system log, so it's necessary to create a file for the log and specify the path to it in the log_path
directive in the configuration file at /etc/dovecot/conf.d/10-logging.conf.
After that, restart the services using the following command:
systemctl restart dovecot