I have installed postfix with dovecot and after while i have found tons of authentication failures from internet. I have installed and configured fail2ban and every not authenticated IP is banned but maybe there is other solution or maybe i'm doing something wrong.
Log example:
Mar 8 08:48:01 somehostname auth: pam_unix(dovecot:auth): authentication failure; logname= uid=0 euid=0 tty=dovecot ruser=news rhost=45.88.90.208 user=news
Is there any other solutions to disable login/connection for clients from internet and enable only from local net ? - there is no need to retrieve emails from internet for clients in my case. Maybe there is other solution ?
Dovecot sample configuration in postfix main.cf:
smtpd_sasl_type = dovecot
Thank you in advance AD
You could disable SASL authentication on SMTP port
25
altogether, as authenticated users should be using submissions a.k.a. Implicit TLS for SMTP Submission (RFC 8314, 3.3), instead.In
main.cf
:smtpd_sasl_auth_enable = no
(default)Override the SASL authentication related settings in
master.cf
forsmptd
instancesmtps
/465
, e.g.,After that you could limit the port
465
for local networks in a firewall.You may restrict imap ports 143,465,587,993 with iptables to LAN only.