Linux/Mailserver/Fail2ban

From Wiki

/etc/fail2ban/jail.local

[postfix]
enabled  = true
maxretry = 3
bantime  = 21600
findtime = 3600
port     = smtp,465,submission
logpath  = /var/log/mail/mail.log
           /var/log/mail/mail.err



/etc/fail2ban/filter.d/postfix.local

  • add:
 ^%(__prefix_line)slost connection after (?:AUTH|UNKNOWN) from \S+\[<HOST>\]$